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 * Internal data structures and functions used by pkcs11.c | 5 * Internal data structures and functions used by pkcs11.c |
6 */ | 6 */ |
7 #ifndef _PKCS11I_H_ | 7 #ifndef _PKCS11I_H_ |
8 #define _PKCS11I_H_ 1 | 8 #define _PKCS11I_H_ 1 |
9 | 9 |
10 #include "nssilock.h" | 10 #include "nssilock.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 typedef struct SFTKSSLMACInfoStr SFTKSSLMACInfo; | 107 typedef struct SFTKSSLMACInfoStr SFTKSSLMACInfo; |
108 typedef struct SFTKChaCha20Poly1305InfoStr SFTKChaCha20Poly1305Info; | 108 typedef struct SFTKChaCha20Poly1305InfoStr SFTKChaCha20Poly1305Info; |
109 typedef struct SFTKItemTemplateStr SFTKItemTemplate; | 109 typedef struct SFTKItemTemplateStr SFTKItemTemplate; |
110 | 110 |
111 /* define function pointer typdefs for pointer tables */ | 111 /* define function pointer typdefs for pointer tables */ |
112 typedef void (*SFTKDestroy)(void *, PRBool); | 112 typedef void (*SFTKDestroy)(void *, PRBool); |
113 typedef void (*SFTKBegin)(void *); | 113 typedef void (*SFTKBegin)(void *); |
114 typedef SECStatus (*SFTKCipher)(void *,void *,unsigned int *,unsigned int, | 114 typedef SECStatus (*SFTKCipher)(void *,void *,unsigned int *,unsigned int, |
115 void *, unsigned int); | 115 void *, unsigned int); |
116 typedef SECStatus (*SFTKVerify)(void *,void *,unsigned int,void *,unsigned int); | 116 typedef SECStatus (*SFTKVerify)(void *,void *,unsigned int,void *,unsigned int); |
117 typedef void (*SFTKHash)(void *,void *,unsigned int); | 117 typedef void (*SFTKHash)(void *,const void *,unsigned int); |
118 typedef void (*SFTKEnd)(void *,void *,unsigned int *,unsigned int); | 118 typedef void (*SFTKEnd)(void *,void *,unsigned int *,unsigned int); |
119 typedef void (*SFTKFree)(void *); | 119 typedef void (*SFTKFree)(void *); |
120 | 120 |
121 /* Value to tell if an attribute is modifiable or not. | 121 /* Value to tell if an attribute is modifiable or not. |
122 * NEVER: attribute is only set on creation. | 122 * NEVER: attribute is only set on creation. |
123 * ONCOPY: attribute is set on creation and can only be changed on copy. | 123 * ONCOPY: attribute is set on creation and can only be changed on copy. |
124 * SENSITIVE: attribute can only be changed to TRUE. | 124 * SENSITIVE: attribute can only be changed to TRUE. |
125 * ALWAYS: attribute can always be changed. | 125 * ALWAYS: attribute can always be changed. |
126 */ | 126 */ |
127 typedef enum { | 127 typedef enum { |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 unsigned int headerLength; | 729 unsigned int headerLength; |
730 unsigned int secretLength; | 730 unsigned int secretLength; |
731 unsigned int totalLength; | 731 unsigned int totalLength; |
732 unsigned char header[75]; | 732 unsigned char header[75]; |
733 }; | 733 }; |
734 typedef struct sftk_MACConstantTimeCtxStr sftk_MACConstantTimeCtx; | 734 typedef struct sftk_MACConstantTimeCtxStr sftk_MACConstantTimeCtx; |
735 sftk_MACConstantTimeCtx* sftk_HMACConstantTime_New( | 735 sftk_MACConstantTimeCtx* sftk_HMACConstantTime_New( |
736 CK_MECHANISM_PTR mech, SFTKObject *key); | 736 CK_MECHANISM_PTR mech, SFTKObject *key); |
737 sftk_MACConstantTimeCtx* sftk_SSLv3MACConstantTime_New( | 737 sftk_MACConstantTimeCtx* sftk_SSLv3MACConstantTime_New( |
738 CK_MECHANISM_PTR mech, SFTKObject *key); | 738 CK_MECHANISM_PTR mech, SFTKObject *key); |
739 void sftk_HMACConstantTime_Update(void *pctx, void *data, unsigned int len); | 739 void sftk_HMACConstantTime_Update(void *pctx, const void *data, unsigned int len
); |
740 void sftk_SSLv3MACConstantTime_Update(void *pctx, void *data, unsigned int len); | 740 void sftk_SSLv3MACConstantTime_Update(void *pctx, const void *data, unsigned int
len); |
741 void sftk_MACConstantTime_EndHash( | 741 void sftk_MACConstantTime_EndHash( |
742 void *pctx, void *out, unsigned int *outLength, unsigned int maxLength); | 742 void *pctx, void *out, unsigned int *outLength, unsigned int maxLength); |
743 void sftk_MACConstantTime_DestroyContext(void *pctx, PRBool); | 743 void sftk_MACConstantTime_DestroyContext(void *pctx, PRBool); |
744 | 744 |
745 /**************************************** | 745 /**************************************** |
746 * implement TLS Pseudo Random Function (PRF) | 746 * implement TLS Pseudo Random Function (PRF) |
747 */ | 747 */ |
748 | 748 |
749 extern CK_RV | 749 extern CK_RV |
750 sftk_TLSPRFInit(SFTKSessionContext *context, | 750 sftk_TLSPRFInit(SFTKSessionContext *context, |
751 SFTKObject * key, | 751 SFTKObject * key, |
752 CK_KEY_TYPE key_type, | 752 CK_KEY_TYPE key_type, |
753 » » HASH_HashType hash_alg); | 753 » » HASH_HashType hash_alg, |
| 754 » » unsigned int out_len); |
754 | 755 |
755 SEC_END_PROTOS | 756 SEC_END_PROTOS |
756 | 757 |
757 #endif /* _PKCS11I_H_ */ | 758 #endif /* _PKCS11I_H_ */ |
OLD | NEW |