diff options
author | Richard Levitte <levitte@openssl.org> | 2021-02-01 08:58:58 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2021-02-24 19:50:10 +0100 |
commit | a8eb71ad577bbbd41cea915315451f0ef9f11581 (patch) | |
tree | 8d66d4332f9fc4099c4c8b8a343600996ad7fc3b /providers/implementations/kdfs | |
parent | da9988e0f5371cb7e2aeed9f3c9a6433a9acc595 (diff) |
Allow the sshkdf type to be passed as a single character
This partially reverts commit 270a5ce1d9ea579a2f1d45887971582b1ef2b6a1.
This also slightly modifies the way diverse parameters in are
specified in providers/fips/self_test_data.inc for better consistency.
Fixes #14027
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14035)
Diffstat (limited to 'providers/implementations/kdfs')
-rw-r--r-- | providers/implementations/kdfs/sshkdf.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/providers/implementations/kdfs/sshkdf.c b/providers/implementations/kdfs/sshkdf.c index 1caef4b7b8..cc8f946390 100644 --- a/providers/implementations/kdfs/sshkdf.c +++ b/providers/implementations/kdfs/sshkdf.c @@ -159,7 +159,8 @@ static int kdf_sshkdf_set_ctx_params(void *vctx, const OSSL_PARAM params[]) if (!OSSL_PARAM_get_utf8_string_ptr(p, &kdftype)) return 0; - if (kdftype == NULL || kdftype[0] == '\0' || kdftype[1] != '\0') + /* Expect one character (byte in this case) */ + if (kdftype == NULL || p->data_size != 1) return 0; if (kdftype[0] < 65 || kdftype[0] > 70) { ERR_raise(ERR_LIB_PROV, PROV_R_VALUE_ERROR); |