diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/p5_pbev2.c')
-rw-r--r-- | src/lib/libcrypto/asn1/p5_pbev2.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/libcrypto/asn1/p5_pbev2.c b/src/lib/libcrypto/asn1/p5_pbev2.c index 4c096ac5b9..64924d9b38 100644 --- a/src/lib/libcrypto/asn1/p5_pbev2.c +++ b/src/lib/libcrypto/asn1/p5_pbev2.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: p5_pbev2.c,v 1.37 2025/05/24 02:54:09 tb Exp $ */ | 1 | /* $OpenBSD: p5_pbev2.c,v 1.38 2025/05/24 02:57:14 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 1999-2004. | 3 | * project 1999-2004. |
4 | */ | 4 | */ |
@@ -67,6 +67,12 @@ | |||
67 | #include "evp_local.h" | 67 | #include "evp_local.h" |
68 | #include "x509_local.h" | 68 | #include "x509_local.h" |
69 | 69 | ||
70 | /* | ||
71 | * RFC 8018, sections 6.2 and 4 specify at least 64 bits for PBES2, apparently | ||
72 | * FIPS will require at least 128 bits in the future, OpenSSL does that. | ||
73 | */ | ||
74 | #define PKCS5_PBE2_SALT_LEN 16 | ||
75 | |||
70 | /* PKCS#5 v2.0 password based encryption structures */ | 76 | /* PKCS#5 v2.0 password based encryption structures */ |
71 | 77 | ||
72 | static const ASN1_TEMPLATE PBE2PARAM_seq_tt[] = { | 78 | static const ASN1_TEMPLATE PBE2PARAM_seq_tt[] = { |
@@ -292,7 +298,7 @@ PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen, int prf_nid, | |||
292 | kdf->salt->type = V_ASN1_OCTET_STRING; | 298 | kdf->salt->type = V_ASN1_OCTET_STRING; |
293 | 299 | ||
294 | if (!saltlen) | 300 | if (!saltlen) |
295 | saltlen = PKCS5_SALT_LEN; | 301 | saltlen = PKCS5_PBE2_SALT_LEN; |
296 | if (!(osalt->data = malloc (saltlen))) | 302 | if (!(osalt->data = malloc (saltlen))) |
297 | goto merr; | 303 | goto merr; |
298 | 304 | ||