src/jdk.crypto.cryptoki/share/native/libj2pkcs11/pkcs11wrapper.h
author chegar
Thu, 17 Oct 2019 20:54:25 +0100
branchdatagramsocketimpl-branch
changeset 58679 9c3209ff7550
parent 58678 9cf78a70fa4f
parent 58489 2faeaa5933a6
permissions -rw-r--r--
datagramsocketimpl-branch: merge with default
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
55332
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
     2
 * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
/* Copyright  (c) 2002 Graz University of Technology. All rights reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * Redistribution and use in  source and binary forms, with or without
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * modification, are permitted  provided that the following conditions are met:
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * 1. Redistributions of  source code must retain the above copyright notice,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 *    this list of conditions and the following disclaimer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * 2. Redistributions in  binary form must reproduce the above copyright notice,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *    this list of conditions and the following disclaimer in the documentation
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 *    and/or other materials provided with the distribution.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * 3. The end-user documentation included with the redistribution, if any, must
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *    include the following acknowledgment:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *    "This product includes software developed by IAIK of Graz University of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 *     Technology."
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 *    Alternately, this acknowledgment may appear in the software itself, if
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 *    and wherever such third-party acknowledgments normally appear.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
 * 4. The names "Graz University of Technology" and "IAIK of Graz University of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 *    Technology" must not be used to endorse or promote products derived from
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 *    this software without prior written permission.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * 5. Products derived from this software may not be called
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 *    "IAIK PKCS Wrapper", nor may "IAIK" appear in their name, without prior
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 *    written permission of Graz University of Technology.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 *  THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 *  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE LICENSOR BE
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 *  OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 *  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 *  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 *  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 *  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 *  POSSIBILITY  OF SUCH DAMAGE.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * pkcs11wrapper.h
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * 18.05.2001
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * declaration of all functions used by pkcs11wrapper.c
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * @author Karl Scheibelhofer <Karl.Scheibelhofer@iaik.at>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * @author Martin Schlaeffer <schlaeff@sbox.tugraz.at>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
22964
59c522d83ed9 8034856: gcc warnings compiling src/solaris/native/sun/security/pkcs11
alanb
parents: 13678
diff changeset
    58
#ifndef _PKCS11WRAPPER_H
59c522d83ed9 8034856: gcc warnings compiling src/solaris/native/sun/security/pkcs11
alanb
parents: 13678
diff changeset
    59
#define _PKCS11WRAPPER_H 1
59c522d83ed9 8034856: gcc warnings compiling src/solaris/native/sun/security/pkcs11
alanb
parents: 13678
diff changeset
    60
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
/* disable asserts in product mode */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
#ifndef DEBUG
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
  #ifndef NDEBUG
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    #define NDEBUG
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
  #endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
/* extra PKCS#11 constants not in the standard include files */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
#define CKA_NETSCAPE_BASE                       (0x80000000 + 0x4E534350)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
#define CKA_NETSCAPE_TRUST_BASE                 (CKA_NETSCAPE_BASE + 0x2000)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
#define CKA_NETSCAPE_TRUST_SERVER_AUTH          (CKA_NETSCAPE_TRUST_BASE + 8)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
#define CKA_NETSCAPE_TRUST_CLIENT_AUTH          (CKA_NETSCAPE_TRUST_BASE + 9)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
#define CKA_NETSCAPE_TRUST_CODE_SIGNING (CKA_NETSCAPE_TRUST_BASE + 10)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
#define CKA_NETSCAPE_TRUST_EMAIL_PROTECTION     (CKA_NETSCAPE_TRUST_BASE + 11)
55332
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
    76
#define CKA_NETSCAPE_DB                         0xD5A0DB00
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
    77
#define CKM_NSS_TLS_PRF_GENERAL                 0x80000373
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 Define the PKCS#11 functions to include and exclude. Reduces the size
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
 of the binary somewhat.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
 This list needs to be kept in sync with the mapfile and PKCS11.java
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
*/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
#define P11_ENABLE_C_INITIALIZE
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
#define P11_ENABLE_C_FINALIZE
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
#define P11_ENABLE_C_GETINFO
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
#define P11_ENABLE_C_GETSLOTLIST
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
#define P11_ENABLE_C_GETSLOTINFO
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
#define P11_ENABLE_C_GETTOKENINFO
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
#define P11_ENABLE_C_GETMECHANISMLIST
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
#define P11_ENABLE_C_GETMECHANISMINFO
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
#undef  P11_ENABLE_C_INITTOKEN
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
#undef  P11_ENABLE_C_INITPIN
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
#undef  P11_ENABLE_C_SETPIN
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
#define P11_ENABLE_C_OPENSESSION
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
#define P11_ENABLE_C_CLOSESESSION
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
#undef  P11_ENABLE_C_CLOSEALLSESSIONS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
#define P11_ENABLE_C_GETSESSIONINFO
11507
bd978326a655 6414899: P11Digest should support cloning
valeriep
parents: 10798
diff changeset
   103
#define P11_ENABLE_C_GETOPERATIONSTATE
bd978326a655 6414899: P11Digest should support cloning
valeriep
parents: 10798
diff changeset
   104
#define P11_ENABLE_C_SETOPERATIONSTATE
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
#define P11_ENABLE_C_LOGIN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
#define P11_ENABLE_C_LOGOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
#define P11_ENABLE_C_CREATEOBJECT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
#define P11_ENABLE_C_COPYOBJECT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
#define P11_ENABLE_C_DESTROYOBJECT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
#undef  P11_ENABLE_C_GETOBJECTSIZE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
#define P11_ENABLE_C_GETATTRIBUTEVALUE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
#define P11_ENABLE_C_SETATTRIBUTEVALUE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
#define P11_ENABLE_C_FINDOBJECTSINIT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
#define P11_ENABLE_C_FINDOBJECTS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
#define P11_ENABLE_C_FINDOBJECTSFINAL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
#define P11_ENABLE_C_ENCRYPTINIT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
#define P11_ENABLE_C_ENCRYPT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
#define P11_ENABLE_C_ENCRYPTUPDATE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
#define P11_ENABLE_C_ENCRYPTFINAL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
#define P11_ENABLE_C_DECRYPTINIT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
#define P11_ENABLE_C_DECRYPT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
#define P11_ENABLE_C_DECRYPTUPDATE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
#define P11_ENABLE_C_DECRYPTFINAL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
#define P11_ENABLE_C_DIGESTINIT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
#define P11_ENABLE_C_DIGEST
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
#define P11_ENABLE_C_DIGESTUPDATE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
#define P11_ENABLE_C_DIGESTKEY
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
#define P11_ENABLE_C_DIGESTFINAL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
#define P11_ENABLE_C_SIGNINIT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
#define P11_ENABLE_C_SIGN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
#define P11_ENABLE_C_SIGNUPDATE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
#define P11_ENABLE_C_SIGNFINAL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
#define P11_ENABLE_C_SIGNRECOVERINIT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
#define P11_ENABLE_C_SIGNRECOVER
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
#define P11_ENABLE_C_VERIFYINIT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
#define P11_ENABLE_C_VERIFY
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
#define P11_ENABLE_C_VERIFYUPDATE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
#define P11_ENABLE_C_VERIFYFINAL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
#define P11_ENABLE_C_VERIFYRECOVERINIT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
#define P11_ENABLE_C_VERIFYRECOVER
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
#undef  P11_ENABLE_C_DIGESTENCRYPTUPDATE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
#undef  P11_ENABLE_C_DECRYPTDIGESTUPDATE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
#undef  P11_ENABLE_C_SIGNENCRYPTUPDATE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
#undef  P11_ENABLE_C_DECRYPTVERIFYUPDATE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
#define P11_ENABLE_C_GENERATEKEY
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
#define P11_ENABLE_C_GENERATEKEYPAIR
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
#define P11_ENABLE_C_WRAPKEY
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
#define P11_ENABLE_C_UNWRAPKEY
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
#define P11_ENABLE_C_DERIVEKEY
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
#define P11_ENABLE_C_SEEDRANDOM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
#define P11_ENABLE_C_GENERATERANDOM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
#undef  P11_ENABLE_C_GETFUNCTIONSTATUS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
#undef  P11_ENABLE_C_CANCELFUNCTION
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
#undef  P11_ENABLE_C_WAITFORSLOTEVENT
53257
5170dc2bcf64 6913047: Long term memory leak when using PKCS11 and JCE exceeds 32 bit process address space
mbalao
parents: 51800
diff changeset
   155
#define P11_ENABLE_GETNATIVEKEYINFO
5170dc2bcf64 6913047: Long term memory leak when using PKCS11 and JCE exceeds 32 bit process address space
mbalao
parents: 51800
diff changeset
   156
#define P11_ENABLE_CREATENATIVEKEY
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
55332
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
   158
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
/* include the platform dependent part of the header */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
#include "p11_md.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
#include <jni.h>
2180
9994f4f08a59 6812738: SSL stress test with GF leads to 32 bit max process size in less than 5 minutes with PCKS11 provider
valeriep
parents: 2
diff changeset
   163
#include <jni_util.h>
39142
bf48a9f13cf2 8074580: sun/security/pkcs11/rsa/TestKeyPairGenerator.java fails due to PKCS11Exception: CKR_FUNCTION_FAILED
asmotrak
parents: 25859
diff changeset
   164
#include <stdarg.h>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
#define MAX_STACK_BUFFER_LEN (4 * 1024)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
#define MAX_HEAP_BUFFER_LEN (64 * 1024)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
#define MAX_DIGEST_LEN (64)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
#ifndef min
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
#define min(a, b)       (((a) < (b)) ? (a) : (b))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
#define ckBBoolToJBoolean(x) ((x == TRUE) ? JNI_TRUE : JNI_FALSE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
#define jBooleanToCKBBool(x) ((x == JNI_TRUE) ? TRUE : FALSE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
#define ckByteToJByte(x) ((jbyte) x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
#define jByteToCKByte(x) ((CK_BYTE) x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
#define ckLongToJLong(x) ((jlong) x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
#define jLongToCKLong(x) ((CK_LONG) x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
#define ckULongToJLong(x) ((jlong) x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
#define jLongToCKULong(x) ((CK_ULONG) x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
// For CK_UNAVAILABLE_INFORMATION, always return -1 to avoid 32/64 bit problems.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
#define ckULongSpecialToJLong(x) (((x) == CK_UNAVAILABLE_INFORMATION) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    ? (jlong)-1 : ((jlong) x))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
#define ckCharToJChar(x) ((jchar) x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
#define jCharToCKChar(x) ((CK_CHAR) x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
#define ckUTF8CharToJChar(x) ((jchar) x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
#define jCharToCKUTF8Char(x) ((CK_UTF8CHAR) x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
#define ckFlageToJLong(x) ((jlong) x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
#define ckVoidPtrToJObject(x) ((jobject) x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
#define jObjectToCKVoidPtr(x) ((CK_VOID_PTR) x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
#define jIntToCKLong(x)         ((CK_LONG) x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
#define jIntToCKULong(x)        ((CK_ULONG) x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
#define ckLongToJInt(x)         ((jint) x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
#define ckULongToJInt(x)        ((jint) x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
#define ckULongToJSize(x)       ((jsize) x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
#define unsignedIntToCKULong(x) ((CK_ULONG) x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
57737
6bbb4af131e3 8228835: Memory leak in PKCS11 provider when using AES GCM
valeriep
parents: 55332
diff changeset
   209
//#define TRACE0d(s) { printf(s); fflush(stdout); }
6bbb4af131e3 8228835: Memory leak in PKCS11 provider when using AES GCM
valeriep
parents: 55332
diff changeset
   210
//#define TRACE1d(s, p1) { printf(s, p1); fflush(stdout); }
6bbb4af131e3 8228835: Memory leak in PKCS11 provider when using AES GCM
valeriep
parents: 55332
diff changeset
   211
//#define TRACE2d(s, p1, p2) { printf(s, p1, p2); fflush(stdout); }
6bbb4af131e3 8228835: Memory leak in PKCS11 provider when using AES GCM
valeriep
parents: 55332
diff changeset
   212
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
#ifdef P11_DEBUG
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
#define TRACE0(s) { printf(s); fflush(stdout); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
#define TRACE1(s, p1) { printf(s, p1); fflush(stdout); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
#define TRACE2(s, p1, p2) { printf(s, p1, p2); fflush(stdout); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
#define TRACE3(s, p1, p2, p3) { printf(s, p1, p2, p3); fflush(stdout); }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
#define TRACE0(s)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
#define TRACE1(s, p1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
#define TRACE2(s, p1, p2)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
#define TRACE3(s, p1, p2, p3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
#define TRACE_INTEND
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
#define TRACE_UNINTEND
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
39142
bf48a9f13cf2 8074580: sun/security/pkcs11/rsa/TestKeyPairGenerator.java fails due to PKCS11Exception: CKR_FUNCTION_FAILED
asmotrak
parents: 25859
diff changeset
   227
/* debug output */
bf48a9f13cf2 8074580: sun/security/pkcs11/rsa/TestKeyPairGenerator.java fails due to PKCS11Exception: CKR_FUNCTION_FAILED
asmotrak
parents: 25859
diff changeset
   228
extern jboolean debug;
bf48a9f13cf2 8074580: sun/security/pkcs11/rsa/TestKeyPairGenerator.java fails due to PKCS11Exception: CKR_FUNCTION_FAILED
asmotrak
parents: 25859
diff changeset
   229
void printDebug(const char *format, ...);
bf48a9f13cf2 8074580: sun/security/pkcs11/rsa/TestKeyPairGenerator.java fails due to PKCS11Exception: CKR_FUNCTION_FAILED
asmotrak
parents: 25859
diff changeset
   230
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
#define CK_ASSERT_OK 0L
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
55332
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
   233
#define CLASS_P11PSSSIGNATURE "sun/security/pkcs11/P11PSSSignature"
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
   234
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
#define CLASS_INFO "sun/security/pkcs11/wrapper/CK_INFO"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
#define CLASS_VERSION "sun/security/pkcs11/wrapper/CK_VERSION"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
#define CLASS_SLOT_INFO "sun/security/pkcs11/wrapper/CK_SLOT_INFO"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
#define CLASS_TOKEN_INFO "sun/security/pkcs11/wrapper/CK_TOKEN_INFO"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
#define CLASS_MECHANISM "sun/security/pkcs11/wrapper/CK_MECHANISM"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
#define CLASS_MECHANISM_INFO "sun/security/pkcs11/wrapper/CK_MECHANISM_INFO"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
#define CLASS_SESSION_INFO "sun/security/pkcs11/wrapper/CK_SESSION_INFO"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
#define CLASS_ATTRIBUTE "sun/security/pkcs11/wrapper/CK_ATTRIBUTE"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
#define CLASS_DATE "sun/security/pkcs11/wrapper/CK_DATE"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
#define CLASS_PKCS11EXCEPTION "sun/security/pkcs11/wrapper/PKCS11Exception"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
#define CLASS_PKCS11RUNTIMEEXCEPTION "sun/security/pkcs11/wrapper/PKCS11RuntimeException"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
#define CLASS_FILE_NOT_FOUND_EXCEPTION "java/io/FileNotFoundException"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
#define CLASS_C_INITIALIZE_ARGS "sun/security/pkcs11/wrapper/CK_C_INITIALIZE_ARGS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
#define CLASS_CREATEMUTEX "sun/security/pkcs11/wrapper/CK_CREATEMUTEX"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
#define CLASS_DESTROYMUTEX "sun/security/pkcs11/wrapper/CK_DESTROYMUTEX"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
#define CLASS_LOCKMUTEX "sun/security/pkcs11/wrapper/CK_LOCKMUTEX"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
#define CLASS_UNLOCKMUTEX "sun/security/pkcs11/wrapper/CK_UNLOCKMUTEX"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
#define CLASS_NOTIFY "sun/security/pkcs11/wrapper/CK_NOTIFY"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
/* mechanism parameter classes */
55332
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
   256
#define CLASS_AES_CTR_PARAMS "sun/security/pkcs11/wrapper/CK_AES_CTR_PARAMS"
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
   257
#define CLASS_GCM_PARAMS "sun/security/pkcs11/wrapper/CK_GCM_PARAMS"
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
   258
#define CLASS_CCM_PARAMS "sun/security/pkcs11/wrapper/CK_CCM_PARAMS"
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
   259
#define CLASS_RSA_PKCS_PSS_PARAMS "sun/security/pkcs11/wrapper/CK_RSA_PKCS_PSS_PARAMS"
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
   260
#define CLASS_RSA_PKCS_OAEP_PARAMS "sun/security/pkcs11/wrapper/CK_RSA_PKCS_OAEP_PARAMS"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
#define CLASS_MAC_GENERAL_PARAMS "sun/security/pkcs11/wrapper/CK_MAC_GENERAL_PARAMS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
#define CLASS_PBE_PARAMS "sun/security/pkcs11/wrapper/CK_PBE_PARAMS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
#define PBE_INIT_VECTOR_SIZE 8
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
#define CLASS_PKCS5_PBKD2_PARAMS "sun/security/pkcs11/wrapper/CK_PKCS5_PBKD2_PARAMS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
#define CLASS_EXTRACT_PARAMS "sun/security/pkcs11/wrapper/CK_EXTRACT_PARAMS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
#define CLASS_ECDH1_DERIVE_PARAMS "sun/security/pkcs11/wrapper/CK_ECDH1_DERIVE_PARAMS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
#define CLASS_ECDH2_DERIVE_PARAMS "sun/security/pkcs11/wrapper/CK_ECDH2_DERIVE_PARAMS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
#define CLASS_X9_42_DH1_DERIVE_PARAMS "sun/security/pkcs11/wrapper/CK_X9_42_DH1_DERIVE_PARAMS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
#define CLASS_X9_42_DH2_DERIVE_PARAMS "sun/security/pkcs11/wrapper/CK_X9_42_DH2_DERIVE_PARAMS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
#define CLASS_KEA_DERIVE_PARAMS "sun/security/pkcs11/wrapper/CK_KEA_DERIVE_PARAMS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
#define CLASS_RC2_PARAMS "sun/security/pkcs11/wrapper/CK_RC2_PARAMS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
#define CLASS_RC2_CBC_PARAMS "sun/security/pkcs11/wrapper/CK_RC2_CBC_PARAMS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
#define CLASS_RC2_MAC_GENERAL_PARAMS "sun/security/pkcs11/wrapper/CK_RC2_MAC_GENERAL_PARAMS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
#define CLASS_RC5_PARAMS "sun/security/pkcs11/wrapper/CK_RC5_PARAMS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
#define CLASS_RC5_CBC_PARAMS "sun/security/pkcs11/wrapper/CK_RC5_CBC_PARAMS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
#define CLASS_RC5_MAC_GENERAL_PARAMS "sun/security/pkcs11/wrapper/CK_RC5_MAC_GENERAL_PARAMS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
#define CLASS_SKIPJACK_PRIVATE_WRAP_PARAMS "sun/security/pkcs11/wrapper/CK_SKIPJACK_PRIVATE_WRAP_PARAMS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
#define CLASS_SKIPJACK_RELAYX_PARAMS "sun/security/pkcs11/wrapper/CK_SKIPJACK_RELAYX_PARAMS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
#define CLASS_KEY_WRAP_SET_OAEP_PARAMS "sun/security/pkcs11/wrapper/CK_KEY_WRAP_SET_OAEP_PARAMS"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
#define CLASS_KEY_DERIVATION_STRING_DATA "sun/security/pkcs11/wrapper/CK_KEY_DERIVATION_STRING_DATA"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
*/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
#define CLASS_SSL3_RANDOM_DATA "sun/security/pkcs11/wrapper/CK_SSL3_RANDOM_DATA"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
// CLASS_SSL3_RANDOM_DATA is used by CLASS_SSL3_MASTER_KEY_DERIVE_PARAMS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
#define CLASS_SSL3_KEY_MAT_OUT "sun/security/pkcs11/wrapper/CK_SSL3_KEY_MAT_OUT"
51800
bccd9966f1ed 8029661: Support TLS v1.2 algorithm in SunPKCS11 provider
mbalao
parents: 47216
diff changeset
   290
// CLASS_SSL3_KEY_MAT_OUT is used by CLASS_SSL3_KEY_MAT_PARAMS and CK_TLS12_KEY_MAT_PARAMS
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
#define CLASS_SSL3_MASTER_KEY_DERIVE_PARAMS "sun/security/pkcs11/wrapper/CK_SSL3_MASTER_KEY_DERIVE_PARAMS"
51800
bccd9966f1ed 8029661: Support TLS v1.2 algorithm in SunPKCS11 provider
mbalao
parents: 47216
diff changeset
   292
#define CLASS_TLS12_MASTER_KEY_DERIVE_PARAMS "sun/security/pkcs11/wrapper/CK_TLS12_MASTER_KEY_DERIVE_PARAMS"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
#define CLASS_SSL3_KEY_MAT_PARAMS "sun/security/pkcs11/wrapper/CK_SSL3_KEY_MAT_PARAMS"
51800
bccd9966f1ed 8029661: Support TLS v1.2 algorithm in SunPKCS11 provider
mbalao
parents: 47216
diff changeset
   294
#define CLASS_TLS12_KEY_MAT_PARAMS "sun/security/pkcs11/wrapper/CK_TLS12_KEY_MAT_PARAMS"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
#define CLASS_TLS_PRF_PARAMS "sun/security/pkcs11/wrapper/CK_TLS_PRF_PARAMS"
51800
bccd9966f1ed 8029661: Support TLS v1.2 algorithm in SunPKCS11 provider
mbalao
parents: 47216
diff changeset
   296
#define CLASS_TLS_MAC_PARAMS "sun/security/pkcs11/wrapper/CK_TLS_MAC_PARAMS"
55332
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
   297
58489
2faeaa5933a6 8229243: SunPKCS11-Solaris provider tests failing on Solaris 11.4
valeriep
parents: 57737
diff changeset
   298
/* function to update the CK_NSS_GCM_PARAMS in mechanism pointer with
2faeaa5933a6 8229243: SunPKCS11-Solaris provider tests failing on Solaris 11.4
valeriep
parents: 57737
diff changeset
   299
 * CK_GCM_PARAMS
2faeaa5933a6 8229243: SunPKCS11-Solaris provider tests failing on Solaris 11.4
valeriep
parents: 57737
diff changeset
   300
 */
2faeaa5933a6 8229243: SunPKCS11-Solaris provider tests failing on Solaris 11.4
valeriep
parents: 57737
diff changeset
   301
CK_MECHANISM_PTR updateGCMParams(JNIEnv *env, CK_MECHANISM_PTR mechPtr);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
/* function to convert a PKCS#11 return value other than CK_OK into a Java Exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
 * or to throw a PKCS11RuntimeException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
jlong ckAssertReturnValueOK(JNIEnv *env, CK_RV returnValue);
10798
413b731e1818 7103549: Remove dependencies on libjava and libjvm from security libraries
chegar
parents: 8542
diff changeset
   308
void throwOutOfMemoryError(JNIEnv *env, const char *message);
413b731e1818 7103549: Remove dependencies on libjava and libjvm from security libraries
chegar
parents: 8542
diff changeset
   309
void throwNullPointerException(JNIEnv *env, const char *message);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
void throwIOException(JNIEnv *env, const char *message);
2180
9994f4f08a59 6812738: SSL stress test with GF leads to 32 bit max process size in less than 5 minutes with PCKS11 provider
valeriep
parents: 2
diff changeset
   311
void throwPKCS11RuntimeException(JNIEnv *env, const char *message);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
void throwDisconnectedRuntimeException(JNIEnv *env);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
55332
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
   314
/* functions to free CK structures and pointers
2180
9994f4f08a59 6812738: SSL stress test with GF leads to 32 bit max process size in less than 5 minutes with PCKS11 provider
valeriep
parents: 2
diff changeset
   315
 */
9994f4f08a59 6812738: SSL stress test with GF leads to 32 bit max process size in less than 5 minutes with PCKS11 provider
valeriep
parents: 2
diff changeset
   316
void freeCKAttributeArray(CK_ATTRIBUTE_PTR attrPtr, int len);
55332
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
   317
void freeCKMechanismPtr(CK_MECHANISM_PTR mechPtr);
2180
9994f4f08a59 6812738: SSL stress test with GF leads to 32 bit max process size in less than 5 minutes with PCKS11 provider
valeriep
parents: 2
diff changeset
   318
55332
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
   319
/* functions to convert Java arrays to a CK-type array and the array length */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
void jBooleanArrayToCKBBoolArray(JNIEnv *env, const jbooleanArray jArray, CK_BBOOL **ckpArray, CK_ULONG_PTR ckLength);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
void jByteArrayToCKByteArray(JNIEnv *env, const jbyteArray jArray, CK_BYTE_PTR *ckpArray, CK_ULONG_PTR ckLength);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
void jLongArrayToCKULongArray(JNIEnv *env, const jlongArray jArray, CK_ULONG_PTR *ckpArray, CK_ULONG_PTR ckLength);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
void jCharArrayToCKCharArray(JNIEnv *env, const jcharArray jArray, CK_CHAR_PTR *ckpArray, CK_ULONG_PTR ckLength);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
void jCharArrayToCKUTF8CharArray(JNIEnv *env, const jcharArray jArray, CK_UTF8CHAR_PTR *ckpArray, CK_ULONG_PTR ckLength);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
void jStringToCKUTF8CharArray(JNIEnv *env, const jstring jArray, CK_UTF8CHAR_PTR *ckpArray, CK_ULONG_PTR ckpLength);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
void jAttributeArrayToCKAttributeArray(JNIEnv *env, jobjectArray jAArray, CK_ATTRIBUTE_PTR *ckpArray, CK_ULONG_PTR ckpLength);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
/*void jObjectArrayToCKVoidPtrArray(JNIEnv *env, const jobjectArray jArray, CK_VOID_PTR_PTR ckpArray, CK_ULONG_PTR ckpLength); */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
55332
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
   331
/* functions to convert a CK-type array and the array length to a Java array */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
3321
fed33393bc52 6823905: crash in sun.security.pkcs11.wrapper.PKCS11.C_Sign during stress-test
valeriep
parents: 2180
diff changeset
   333
jbyteArray ckByteArrayToJByteArray(JNIEnv *env, const CK_BYTE_PTR ckpArray, CK_ULONG ckLength);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
jlongArray ckULongArrayToJLongArray(JNIEnv *env, const CK_ULONG_PTR ckpArray, CK_ULONG ckLength);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
jcharArray ckCharArrayToJCharArray(JNIEnv *env, const CK_CHAR_PTR ckpArray, CK_ULONG length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
jcharArray ckUTF8CharArrayToJCharArray(JNIEnv *env, const CK_UTF8CHAR_PTR ckpArray, CK_ULONG ckLength);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
55332
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
   339
/* functions to convert a CK-type structure or a pointer to a CK-value to a Java object */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
jobject ckBBoolPtrToJBooleanObject(JNIEnv *env, const CK_BBOOL* ckpValue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
jobject ckULongPtrToJLongObject(JNIEnv *env, const CK_ULONG_PTR ckpValue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
jobject ckDatePtrToJDateObject(JNIEnv *env, const CK_DATE *ckpValue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
jobject ckVersionPtrToJVersion(JNIEnv *env, const CK_VERSION_PTR ckpVersion);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
jobject ckSessionInfoPtrToJSessionInfo(JNIEnv *env, const CK_SESSION_INFO_PTR ckpSessionInfo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
jobject ckAttributePtrToJAttribute(JNIEnv *env, const CK_ATTRIBUTE_PTR ckpAttribute);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
55332
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
   349
/* function to convert the CK-value used by the CK_ATTRIBUTE structure to a Java object */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
jobject ckAttributeValueToJObject(JNIEnv *env, const CK_ATTRIBUTE_PTR ckpAttribute);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
55332
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
   354
/* functions to convert a Java object to a CK-type structure or a pointer to a CK-value */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
CK_BBOOL* jBooleanObjectToCKBBoolPtr(JNIEnv *env, jobject jObject);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
CK_BYTE_PTR jByteObjectToCKBytePtr(JNIEnv *env, jobject jObject);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
CK_ULONG* jIntegerObjectToCKULongPtr(JNIEnv *env, jobject jObject);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
CK_ULONG* jLongObjectToCKULongPtr(JNIEnv *env, jobject jObject);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
CK_CHAR_PTR jCharObjectToCKCharPtr(JNIEnv *env, jobject jObject);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
CK_VERSION_PTR jVersionToCKVersionPtr(JNIEnv *env, jobject jVersion);
57737
6bbb4af131e3 8228835: Memory leak in PKCS11 provider when using AES GCM
valeriep
parents: 55332
diff changeset
   362
CK_DATE * jDateObjectToCKDatePtr(JNIEnv *env, jobject jDate);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
CK_ATTRIBUTE jAttributeToCKAttribute(JNIEnv *env, jobject jAttribute);
55332
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
   364
CK_MECHANISM_PTR jMechanismToCKMechanismPtr(JNIEnv *env, jobject jMechanism);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
55332
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
   367
/* functions to convert Java objects used by the Mechanism and Attribute class to a CK-type structure */
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
   368
CK_VOID_PTR jObjectToPrimitiveCKObjectPtr(JNIEnv *env, jobject jObject, CK_ULONG *ckpLength);
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
   369
CK_VOID_PTR jMechParamToCKMechParamPtr(JNIEnv *env, jobject jParam, CK_MECHANISM_TYPE, CK_ULONG
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
   370
*ckpLength);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
57737
6bbb4af131e3 8228835: Memory leak in PKCS11 provider when using AES GCM
valeriep
parents: 55332
diff changeset
   373
/* functions to convert a specific Java mechanism parameter object to a CK-mechanism parameter pointer */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
57737
6bbb4af131e3 8228835: Memory leak in PKCS11 provider when using AES GCM
valeriep
parents: 55332
diff changeset
   375
CK_RSA_PKCS_OAEP_PARAMS_PTR jRsaPkcsOaepParamToCKRsaPkcsOaepParamPtr(JNIEnv *env,
6bbb4af131e3 8228835: Memory leak in PKCS11 provider when using AES GCM
valeriep
parents: 55332
diff changeset
   376
    jobject jParam, CK_ULONG* pLength);
6bbb4af131e3 8228835: Memory leak in PKCS11 provider when using AES GCM
valeriep
parents: 55332
diff changeset
   377
CK_PBE_PARAMS_PTR jPbeParamToCKPbeParamPtr(JNIEnv *env, jobject jParam, CK_ULONG* pLength);
6bbb4af131e3 8228835: Memory leak in PKCS11 provider when using AES GCM
valeriep
parents: 55332
diff changeset
   378
CK_PKCS5_PBKD2_PARAMS_PTR jPkcs5Pbkd2ParamToCKPkcs5Pbkd2ParamPtr(JNIEnv *env, jobject jParam, CK_ULONG* pLength);
6bbb4af131e3 8228835: Memory leak in PKCS11 provider when using AES GCM
valeriep
parents: 55332
diff changeset
   379
CK_SSL3_MASTER_KEY_DERIVE_PARAMS_PTR jSsl3MasterKeyDeriveParamToCKSsl3MasterKeyDeriveParamPtr(JNIEnv *env, jobject jParam, CK_ULONG* pLength);
6bbb4af131e3 8228835: Memory leak in PKCS11 provider when using AES GCM
valeriep
parents: 55332
diff changeset
   380
CK_SSL3_KEY_MAT_PARAMS_PTR jSsl3KeyMatParamToCKSsl3KeyMatParamPtr(JNIEnv *env, jobject jParam, CK_ULONG* pLength);
6bbb4af131e3 8228835: Memory leak in PKCS11 provider when using AES GCM
valeriep
parents: 55332
diff changeset
   381
CK_KEY_DERIVATION_STRING_DATA jKeyDerivationStringDataToCKKeyDerivationStringData(JNIEnv *env, jobject jParam);
6bbb4af131e3 8228835: Memory leak in PKCS11 provider when using AES GCM
valeriep
parents: 55332
diff changeset
   382
CK_RSA_PKCS_PSS_PARAMS_PTR jRsaPkcsPssParamToCKRsaPkcsPssParamPtr(JNIEnv *env, jobject jParam, CK_ULONG* pLength);
6bbb4af131e3 8228835: Memory leak in PKCS11 provider when using AES GCM
valeriep
parents: 55332
diff changeset
   383
CK_ECDH1_DERIVE_PARAMS_PTR jEcdh1DeriveParamToCKEcdh1DeriveParamPtr(JNIEnv *env, jobject jParam, CK_ULONG* pLength);
6bbb4af131e3 8228835: Memory leak in PKCS11 provider when using AES GCM
valeriep
parents: 55332
diff changeset
   384
CK_ECDH2_DERIVE_PARAMS_PTR jEcdh2DeriveParamToCKEcdh2DeriveParamPtr(JNIEnv *env, jobject jParam, CK_ULONG* pLength);
6bbb4af131e3 8228835: Memory leak in PKCS11 provider when using AES GCM
valeriep
parents: 55332
diff changeset
   385
CK_X9_42_DH1_DERIVE_PARAMS_PTR jX942Dh1DeriveParamToCKX942Dh1DeriveParamPtr(JNIEnv *env, jobject jParam, CK_ULONG* pLength);
6bbb4af131e3 8228835: Memory leak in PKCS11 provider when using AES GCM
valeriep
parents: 55332
diff changeset
   386
CK_X9_42_DH2_DERIVE_PARAMS_PTR jX942Dh2DeriveParamToCKX942Dh2DeriveParamPtr(JNIEnv *env, jobject jParam, CK_ULONG* pLength);
6bbb4af131e3 8228835: Memory leak in PKCS11 provider when using AES GCM
valeriep
parents: 55332
diff changeset
   387
6bbb4af131e3 8228835: Memory leak in PKCS11 provider when using AES GCM
valeriep
parents: 55332
diff changeset
   388
/* functions to copy the returned values inside CK-mechanism back to Java object */
6bbb4af131e3 8228835: Memory leak in PKCS11 provider when using AES GCM
valeriep
parents: 55332
diff changeset
   389
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
void copyBackPBEInitializationVector(JNIEnv *env, CK_MECHANISM *ckMechanism, jobject jMechanism);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
void copyBackSetUnwrappedKey(JNIEnv *env, CK_MECHANISM *ckMechanism, jobject jMechanism);
51800
bccd9966f1ed 8029661: Support TLS v1.2 algorithm in SunPKCS11 provider
mbalao
parents: 47216
diff changeset
   392
void ssl3CopyBackClientVersion(JNIEnv *env, CK_MECHANISM *ckMechanism, jobject jMechanism);
bccd9966f1ed 8029661: Support TLS v1.2 algorithm in SunPKCS11 provider
mbalao
parents: 47216
diff changeset
   393
void tls12CopyBackClientVersion(JNIEnv *env, CK_MECHANISM *ckMechanism, jobject jMechanism);
bccd9966f1ed 8029661: Support TLS v1.2 algorithm in SunPKCS11 provider
mbalao
parents: 47216
diff changeset
   394
void ssl3CopyBackKeyMatParams(JNIEnv *env, CK_MECHANISM *ckMechanism, jobject jMechanism);
bccd9966f1ed 8029661: Support TLS v1.2 algorithm in SunPKCS11 provider
mbalao
parents: 47216
diff changeset
   395
void tls12CopyBackKeyMatParams(JNIEnv *env, CK_MECHANISM *ckMechanism, jobject jMechanism);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
/* functions to convert the InitArgs object for calling the right Java mutex functions */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
CK_C_INITIALIZE_ARGS_PTR makeCKInitArgsAdapter(JNIEnv *env, jobject pInitArgs);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
#ifndef NO_CALLBACKS /* if the library should not make callbacks; e.g. no javai.lib or jvm.lib available */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
CK_RV callJCreateMutex(CK_VOID_PTR_PTR ppMutex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
CK_RV callJDestroyMutex(CK_VOID_PTR pMutex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
CK_RV callJLockMutex(CK_VOID_PTR pMutex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
CK_RV callJUnlockMutex(CK_VOID_PTR pMutex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
#endif /* NO_CALLBACKS */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
void putModuleEntry(JNIEnv *env, jobject pkcs11Implementation, ModuleData *moduleData);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
ModuleData * removeModuleEntry(JNIEnv *env, jobject pkcs11Implementation);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
CK_FUNCTION_LIST_PTR getFunctionList(JNIEnv *env, jobject pkcs11Implementation);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
/* A structure to encapsulate the required data for a Notify callback */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
struct NotifyEncapsulation {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
    /* The object that implements the CK_NOTIFY interface and which should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
     * notified.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
    jobject jNotifyObject;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
    /* The data object to pass back to the Notify object upon callback. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
    jobject jApplicationData;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
typedef struct NotifyEncapsulation NotifyEncapsulation;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
/* The function for handling notify callbacks. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
CK_RV notifyCallback(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
    CK_SESSION_HANDLE hSession,     /* the session's handle */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
    CK_NOTIFICATION   event,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
    CK_VOID_PTR       pApplication  /* passed to C_OpenSession */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
/* A node of the list of notify callbacks. To be able to free the resources after use. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
struct NotifyListNode {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
    /* The handle of the session this notify object is attached to*/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
    CK_SESSION_HANDLE hSession;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
    /* Reference to the Notify encapsulation object that was passed to C_OpenSession. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
    NotifyEncapsulation *notifyEncapsulation;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
    /* Pointer to the next node in the list. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
    struct NotifyListNode *next;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
typedef struct NotifyListNode NotifyListNode;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
void putNotifyEntry(JNIEnv *env, CK_SESSION_HANDLE hSession, NotifyEncapsulation *notifyEncapsulation);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
NotifyEncapsulation * removeNotifyEntry(JNIEnv *env, CK_SESSION_HANDLE hSession);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
NotifyEncapsulation * removeFirstNotifyEntry(JNIEnv *env);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
jobject createLockObject(JNIEnv *env);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
void destroyLockObject(JNIEnv *env, jobject jLockObject);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
extern jfieldID pNativeDataID;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
extern jfieldID mech_mechanismID;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
extern jfieldID mech_pParameterID;
55332
f492567244ab 8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents: 53257
diff changeset
   459
extern jfieldID mech_pHandleID;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
extern jclass jByteArrayClass;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
extern jclass jLongClass;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
#ifndef NO_CALLBACKS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
extern NotifyListNode *notifyListHead;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
extern jobject notifyListLock;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
extern jobject jInitArgsObject;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
extern CK_C_INITIALIZE_ARGS_PTR ckpGlobalInitArgs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
#endif /* NO_CALLBACKS */
2180
9994f4f08a59 6812738: SSL stress test with GF leads to 32 bit max process size in less than 5 minutes with PCKS11 provider
valeriep
parents: 2
diff changeset
   471
9994f4f08a59 6812738: SSL stress test with GF leads to 32 bit max process size in less than 5 minutes with PCKS11 provider
valeriep
parents: 2
diff changeset
   472
#ifdef P11_MEMORYDEBUG
9994f4f08a59 6812738: SSL stress test with GF leads to 32 bit max process size in less than 5 minutes with PCKS11 provider
valeriep
parents: 2
diff changeset
   473
#include <stdlib.h>
9994f4f08a59 6812738: SSL stress test with GF leads to 32 bit max process size in less than 5 minutes with PCKS11 provider
valeriep
parents: 2
diff changeset
   474
57737
6bbb4af131e3 8228835: Memory leak in PKCS11 provider when using AES GCM
valeriep
parents: 55332
diff changeset
   475
/* Simple malloc/calloc/free dumper */
2180
9994f4f08a59 6812738: SSL stress test with GF leads to 32 bit max process size in less than 5 minutes with PCKS11 provider
valeriep
parents: 2
diff changeset
   476
void *p11malloc(size_t c, char *file, int line);
57737
6bbb4af131e3 8228835: Memory leak in PKCS11 provider when using AES GCM
valeriep
parents: 55332
diff changeset
   477
void *p11calloc(size_t c, size_t s, char *file, int line);
2180
9994f4f08a59 6812738: SSL stress test with GF leads to 32 bit max process size in less than 5 minutes with PCKS11 provider
valeriep
parents: 2
diff changeset
   478
void p11free(void *p, char *file, int line);
9994f4f08a59 6812738: SSL stress test with GF leads to 32 bit max process size in less than 5 minutes with PCKS11 provider
valeriep
parents: 2
diff changeset
   479
13678
5c8001201f98 7197771: Adjust jdk sources to avoid use of implementation defined value of __FILE__
ohair
parents: 11507
diff changeset
   480
/* Use THIS_FILE when it is available. */
5c8001201f98 7197771: Adjust jdk sources to avoid use of implementation defined value of __FILE__
ohair
parents: 11507
diff changeset
   481
#ifndef THIS_FILE
5c8001201f98 7197771: Adjust jdk sources to avoid use of implementation defined value of __FILE__
ohair
parents: 11507
diff changeset
   482
    #define THIS_FILE __FILE__
5c8001201f98 7197771: Adjust jdk sources to avoid use of implementation defined value of __FILE__
ohair
parents: 11507
diff changeset
   483
#endif
5c8001201f98 7197771: Adjust jdk sources to avoid use of implementation defined value of __FILE__
ohair
parents: 11507
diff changeset
   484
5c8001201f98 7197771: Adjust jdk sources to avoid use of implementation defined value of __FILE__
ohair
parents: 11507
diff changeset
   485
#define malloc(c)       (p11malloc((c), THIS_FILE, __LINE__))
57737
6bbb4af131e3 8228835: Memory leak in PKCS11 provider when using AES GCM
valeriep
parents: 55332
diff changeset
   486
#define calloc(c, s)    (p11calloc((c), (s), THIS_FILE, __LINE__))
13678
5c8001201f98 7197771: Adjust jdk sources to avoid use of implementation defined value of __FILE__
ohair
parents: 11507
diff changeset
   487
#define free(c)         (p11free((c), THIS_FILE, __LINE__))
2180
9994f4f08a59 6812738: SSL stress test with GF leads to 32 bit max process size in less than 5 minutes with PCKS11 provider
valeriep
parents: 2
diff changeset
   488
9994f4f08a59 6812738: SSL stress test with GF leads to 32 bit max process size in less than 5 minutes with PCKS11 provider
valeriep
parents: 2
diff changeset
   489
#endif
22964
59c522d83ed9 8034856: gcc warnings compiling src/solaris/native/sun/security/pkcs11
alanb
parents: 13678
diff changeset
   490
59c522d83ed9 8034856: gcc warnings compiling src/solaris/native/sun/security/pkcs11
alanb
parents: 13678
diff changeset
   491
#endif /* _PKCS11WRAPPER_H */