diff options
author | Hubert Kario <hkario@redhat.com> | 2017-07-26 15:05:59 +0200 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2017-07-26 15:04:54 -0400 |
commit | e15c95ce8596bcc2a5f5e163ff78ccf469dbf994 (patch) | |
tree | e9c06483bc18465e6a08845a0080d5d73553e9b6 /crypto/asn1/p5_scrypt.c | |
parent | 11a25d34549461ad6ddd61322ed3b54dd4c69686 (diff) |
make scrypt ASN.1 parameter functions public
Since scrypt PBKDF can be used both in PKCS#5 and PKCS#12 files,
do share the code between them.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1334)
Diffstat (limited to 'crypto/asn1/p5_scrypt.c')
-rw-r--r-- | crypto/asn1/p5_scrypt.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/crypto/asn1/p5_scrypt.c b/crypto/asn1/p5_scrypt.c index 4cb7837498..c556d017f1 100644 --- a/crypto/asn1/p5_scrypt.c +++ b/crypto/asn1/p5_scrypt.c @@ -18,24 +18,15 @@ #ifndef OPENSSL_NO_SCRYPT /* PKCS#5 scrypt password based encryption structures */ -typedef struct { - ASN1_OCTET_STRING *salt; - ASN1_INTEGER *costParameter; - ASN1_INTEGER *blockSize; - ASN1_INTEGER *parallelizationParameter; - ASN1_INTEGER *keyLength; -} SCRYPT_PARAMS; - ASN1_SEQUENCE(SCRYPT_PARAMS) = { ASN1_SIMPLE(SCRYPT_PARAMS, salt, ASN1_OCTET_STRING), ASN1_SIMPLE(SCRYPT_PARAMS, costParameter, ASN1_INTEGER), ASN1_SIMPLE(SCRYPT_PARAMS, blockSize, ASN1_INTEGER), ASN1_SIMPLE(SCRYPT_PARAMS, parallelizationParameter, ASN1_INTEGER), ASN1_OPT(SCRYPT_PARAMS, keyLength, ASN1_INTEGER), -} static_ASN1_SEQUENCE_END(SCRYPT_PARAMS) +} ASN1_SEQUENCE_END(SCRYPT_PARAMS) -DECLARE_ASN1_ALLOC_FUNCTIONS(SCRYPT_PARAMS) -IMPLEMENT_ASN1_ALLOC_FUNCTIONS(SCRYPT_PARAMS) +IMPLEMENT_ASN1_FUNCTIONS(SCRYPT_PARAMS) static X509_ALGOR *pkcs5_scrypt_set(const unsigned char *salt, size_t saltlen, size_t keylen, uint64_t N, uint64_t r, |