Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/native/sun/security/pkcs11/j2secmod.h
38918 views
/*1* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425#include <jni.h>2627#include "sun_security_pkcs11_Secmod.h"2829// #define SECMOD_DEBUG3031#include "j2secmod_md.h"3233#include "p11_md.h"343536void *findFunction(JNIEnv *env, jlong jHandle, const char *functionName);3738#ifdef SECMOD_DEBUG39#define dprintf(s) printf(s)40#define dprintf1(s, p1) printf(s, p1)41#define dprintf2(s, p1, p2) printf(s, p1, p2)42#define dprintf3(s, p1, p2, p3) printf(s, p1, p2, p3)43#else44#define dprintf(s)45#define dprintf1(s, p1)46#define dprintf2(s, p1, p2)47#define dprintf3(s, p1, p2, p3)48#endif4950// NSS types5152typedef int PRBool;5354typedef struct SECMODModuleStr SECMODModule;55typedef struct SECMODModuleListStr SECMODModuleList;5657struct SECMODModuleStr {58void *v1;59PRBool internal; /* true of internally linked modules, false60* for the loaded modules */61PRBool loaded; /* Set to true if module has been loaded */62PRBool isFIPS; /* Set to true if module is finst internal */63char *dllName; /* name of the shared library which implements64* this module */65char *commonName; /* name of the module to display to the user */66void *library; /* pointer to the library. opaque. used only by67* pk11load.c */6869void *functionList; /* The PKCS #11 function table */70void *refLock; /* only used pk11db.c */71int refCount; /* Module reference count */72void **slots; /* array of slot points attached to this mod*/73int slotCount; /* count of slot in above array */74void *slotInfo; /* special info about slots default settings */75int slotInfoCount; /* count */76// incomplete, sizeof() is wrong77};7879struct SECMODModuleListStr {80SECMODModuleList *next;81SECMODModule *module;82};838485