OLD | NEW |
1 /* This Source Code Form is subject to the terms of the Mozilla Public | 1 /* This Source Code Form is subject to the terms of the Mozilla Public |
2 * License, v. 2.0. If a copy of the MPL was not distributed with this | 2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 | 4 |
5 #ifndef _PKCS11N_H_ | 5 #ifndef _PKCS11N_H_ |
6 #define _PKCS11N_H_ | 6 #define _PKCS11N_H_ |
7 | 7 |
8 #ifdef DEBUG | 8 #ifdef DEBUG |
9 static const char CKT_CVS_ID[] = "@(#) $RCSfile: pkcs11n.h,v $ $Revision: 1.28 $
$Date: 2012/04/25 14:50:16 $"; | 9 static const char CKT_CVS_ID[] = "@(#) $RCSfile: pkcs11n.h,v $ $Revision: 1.31 $
$Date: 2013/02/07 01:29:19 $"; |
10 #endif /* DEBUG */ | 10 #endif /* DEBUG */ |
11 | 11 |
12 /* | 12 /* |
13 * pkcs11n.h | 13 * pkcs11n.h |
14 * | 14 * |
15 * This file contains the NSS-specific type definitions for Cryptoki | 15 * This file contains the NSS-specific type definitions for Cryptoki |
16 * (PKCS#11). | 16 * (PKCS#11). |
17 */ | 17 */ |
18 | 18 |
19 /* | 19 /* |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 * Parameter type: CK_NSS_JPAKEFinalParams | 188 * Parameter type: CK_NSS_JPAKEFinalParams |
189 * | 189 * |
190 * You must apply a KDF (e.g. CKM_NSS_HKDF_*) to resultant keying material | 190 * You must apply a KDF (e.g. CKM_NSS_HKDF_*) to resultant keying material |
191 * to get a key with uniformly distributed bits. | 191 * to get a key with uniformly distributed bits. |
192 */ | 192 */ |
193 #define CKM_NSS_JPAKE_FINAL_SHA1 (CKM_NSS + 15) | 193 #define CKM_NSS_JPAKE_FINAL_SHA1 (CKM_NSS + 15) |
194 #define CKM_NSS_JPAKE_FINAL_SHA256 (CKM_NSS + 16) | 194 #define CKM_NSS_JPAKE_FINAL_SHA256 (CKM_NSS + 16) |
195 #define CKM_NSS_JPAKE_FINAL_SHA384 (CKM_NSS + 17) | 195 #define CKM_NSS_JPAKE_FINAL_SHA384 (CKM_NSS + 17) |
196 #define CKM_NSS_JPAKE_FINAL_SHA512 (CKM_NSS + 18) | 196 #define CKM_NSS_JPAKE_FINAL_SHA512 (CKM_NSS + 18) |
197 | 197 |
| 198 #define CKM_NSS_HMAC_CONSTANT_TIME (CKM_NSS + 19) |
| 199 #define CKM_NSS_SSL3_MAC_CONSTANT_TIME (CKM_NSS + 20) |
| 200 |
198 /* | 201 /* |
199 * HISTORICAL: | 202 * HISTORICAL: |
200 * Do not attempt to use these. They are only used by NETSCAPE's internal | 203 * Do not attempt to use these. They are only used by NETSCAPE's internal |
201 * PKCS #11 interface. Most of these are place holders for other mechanism | 204 * PKCS #11 interface. Most of these are place holders for other mechanism |
202 * and will change in the future. | 205 * and will change in the future. |
203 */ | 206 */ |
204 #define CKM_NETSCAPE_PBE_SHA1_DES_CBC 0x80000002UL | 207 #define CKM_NETSCAPE_PBE_SHA1_DES_CBC 0x80000002UL |
205 #define CKM_NETSCAPE_PBE_SHA1_TRIPLE_DES_CBC 0x80000003UL | 208 #define CKM_NETSCAPE_PBE_SHA1_TRIPLE_DES_CBC 0x80000003UL |
206 #define CKM_NETSCAPE_PBE_SHA1_40_BIT_RC2_CBC 0x80000004UL | 209 #define CKM_NETSCAPE_PBE_SHA1_40_BIT_RC2_CBC 0x80000004UL |
207 #define CKM_NETSCAPE_PBE_SHA1_128_BIT_RC2_CBC 0x80000005UL | 210 #define CKM_NETSCAPE_PBE_SHA1_128_BIT_RC2_CBC 0x80000005UL |
(...skipping 25 matching lines...) Expand all Loading... |
233 CK_ULONG ulSharedKeyLen; /* in */ | 236 CK_ULONG ulSharedKeyLen; /* in */ |
234 CK_NSS_JPAKEPublicValue gx3; /* in */ | 237 CK_NSS_JPAKEPublicValue gx3; /* in */ |
235 CK_NSS_JPAKEPublicValue gx4; /* in */ | 238 CK_NSS_JPAKEPublicValue gx4; /* in */ |
236 CK_NSS_JPAKEPublicValue A; /* out */ | 239 CK_NSS_JPAKEPublicValue A; /* out */ |
237 } CK_NSS_JPAKERound2Params; | 240 } CK_NSS_JPAKERound2Params; |
238 | 241 |
239 typedef struct CK_NSS_JPAKEFinalParams { | 242 typedef struct CK_NSS_JPAKEFinalParams { |
240 CK_NSS_JPAKEPublicValue B; /* in */ | 243 CK_NSS_JPAKEPublicValue B; /* in */ |
241 } CK_NSS_JPAKEFinalParams; | 244 } CK_NSS_JPAKEFinalParams; |
242 | 245 |
| 246 /* NOTE: the softoken's implementation of CKM_NSS_HMAC_CONSTANT_TIME and |
| 247 * CKM_NSS_SSL3_MAC_CONSTANT_TIME requires that the sum of ulBodyTotalLen |
| 248 * and ulHeaderLen be much smaller than 2^32 / 8 bytes because it uses an |
| 249 * unsigned int variable to represent the length in bits. This should not |
| 250 * be a problem because the SSL/TLS protocol limits the size of an SSL |
| 251 * record to something considerably less than 2^32 bytes. |
| 252 */ |
| 253 typedef struct CK_NSS_MAC_CONSTANT_TIME_PARAMS { |
| 254 CK_MECHANISM_TYPE macAlg; /* in */ |
| 255 CK_ULONG ulBodyTotalLen; /* in */ |
| 256 CK_BYTE * pHeader; /* in */ |
| 257 CK_ULONG ulHeaderLen; /* in */ |
| 258 } CK_NSS_MAC_CONSTANT_TIME_PARAMS; |
| 259 |
243 /* | 260 /* |
244 * NSS-defined return values | 261 * NSS-defined return values |
245 * | 262 * |
246 */ | 263 */ |
247 #define CKR_NSS (CKM_VENDOR_DEFINED|NSSCK_VENDOR_NSS) | 264 #define CKR_NSS (CKM_VENDOR_DEFINED|NSSCK_VENDOR_NSS) |
248 | 265 |
249 #define CKR_NSS_CERTDB_FAILED (CKR_NSS + 1) | 266 #define CKR_NSS_CERTDB_FAILED (CKR_NSS + 1) |
250 #define CKR_NSS_KEYDB_FAILED (CKR_NSS + 2) | 267 #define CKR_NSS_KEYDB_FAILED (CKR_NSS + 2) |
251 | 268 |
252 /* Mandatory parameter for the CKM_NSS_HKDF_* key deriviation mechanisms. | 269 /* Mandatory parameter for the CKM_NSS_HKDF_* key deriviation mechanisms. |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 char *parameters, void *moduleSpec); | 433 char *parameters, void *moduleSpec); |
417 | 434 |
418 /* softoken slot ID's */ | 435 /* softoken slot ID's */ |
419 #define SFTK_MIN_USER_SLOT_ID 4 | 436 #define SFTK_MIN_USER_SLOT_ID 4 |
420 #define SFTK_MAX_USER_SLOT_ID 100 | 437 #define SFTK_MAX_USER_SLOT_ID 100 |
421 #define SFTK_MIN_FIPS_USER_SLOT_ID 101 | 438 #define SFTK_MIN_FIPS_USER_SLOT_ID 101 |
422 #define SFTK_MAX_FIPS_USER_SLOT_ID 127 | 439 #define SFTK_MAX_FIPS_USER_SLOT_ID 127 |
423 | 440 |
424 | 441 |
425 #endif /* _PKCS11N_H_ */ | 442 #endif /* _PKCS11N_H_ */ |
OLD | NEW |