diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /security/nss/lib/pk11wrap/secpkcs5.h | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'security/nss/lib/pk11wrap/secpkcs5.h')
-rw-r--r-- | security/nss/lib/pk11wrap/secpkcs5.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/security/nss/lib/pk11wrap/secpkcs5.h b/security/nss/lib/pk11wrap/secpkcs5.h new file mode 100644 index 000000000..57856767b --- /dev/null +++ b/security/nss/lib/pk11wrap/secpkcs5.h @@ -0,0 +1,61 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#ifndef _SECPKCS5_H_ +#define _SECPKCS5_H_ +#include "seccomon.h" +#include "secmodt.h" + +/* used for V2 PKCS 12 Draft Spec */ +typedef enum { + pbeBitGenIDNull = 0, + pbeBitGenCipherKey = 0x01, + pbeBitGenCipherIV = 0x02, + pbeBitGenIntegrityKey = 0x03 +} PBEBitGenID; + +typedef struct PBEBitGenContextStr PBEBitGenContext; + +SEC_BEGIN_PROTOS + +/* private */ +SECAlgorithmID * +sec_pkcs5CreateAlgorithmID(SECOidTag algorithm, SECOidTag cipherAlgorithm, + SECOidTag prfAlg, SECOidTag *pPbeAlgorithm, + int keyLengh, SECItem *salt, int iteration); + +/* Get the initialization vector. The password is passed in, hashing + * is performed, and the initialization vector is returned. + * algid is a pointer to a PBE algorithm ID + * pwitem is the password + * If an error occurs or the algorithm id is not a PBE algrithm, + * NULL is returned. Otherwise, the iv is returned in a secitem. + */ +SECItem * +SEC_PKCS5GetIV(SECAlgorithmID *algid, SECItem *pwitem, PRBool faulty3DES); + +SECOidTag SEC_PKCS5GetCryptoAlgorithm(SECAlgorithmID *algid); +PRBool SEC_PKCS5IsAlgorithmPBEAlg(SECAlgorithmID *algid); +PRBool SEC_PKCS5IsAlgorithmPBEAlgTag(SECOidTag algTag); +SECOidTag SEC_PKCS5GetPBEAlgorithm(SECOidTag algTag, int keyLen); +int SEC_PKCS5GetKeyLength(SECAlgorithmID *algid); + +/********************************************************************** + * Deprecated PBE functions. Use the PBE functions in pk11func.h + * instead. + **********************************************************************/ + +PBEBitGenContext * +PBE_CreateContext(SECOidTag hashAlgorithm, PBEBitGenID bitGenPurpose, + SECItem *pwitem, SECItem *salt, unsigned int bitsNeeded, + unsigned int iterations); + +void +PBE_DestroyContext(PBEBitGenContext *context); + +SECItem * +PBE_GenerateBits(PBEBitGenContext *context); + +SEC_END_PROTOS + +#endif /* _SECPKS5_H_ */ |