diff options
| author | tb <> | 2023-04-25 15:48:48 +0000 |
|---|---|---|
| committer | tb <> | 2023-04-25 15:48:48 +0000 |
| commit | 8c449d8a1445a23c96b8b2f389e256ea32662e36 (patch) | |
| tree | 8fc6489b768abe5eb7eafc75ed8631756451a226 /src/lib/libcrypto/ec/ec_pmeth.c | |
| parent | ce06a4ca1e5719ee36f665b7473fb078d8d34a0f (diff) | |
| download | openbsd-8c449d8a1445a23c96b8b2f389e256ea32662e36.tar.gz openbsd-8c449d8a1445a23c96b8b2f389e256ea32662e36.tar.bz2 openbsd-8c449d8a1445a23c96b8b2f389e256ea32662e36.zip | |
Wire up truncated SHA-2, SHA-3 and related things
from jsing
Diffstat (limited to 'src/lib/libcrypto/ec/ec_pmeth.c')
| -rw-r--r-- | src/lib/libcrypto/ec/ec_pmeth.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/libcrypto/ec/ec_pmeth.c b/src/lib/libcrypto/ec/ec_pmeth.c index 9582224037..d1bb52d9ed 100644 --- a/src/lib/libcrypto/ec/ec_pmeth.c +++ b/src/lib/libcrypto/ec/ec_pmeth.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ec_pmeth.c,v 1.16 2022/11/26 16:08:52 tb Exp $ */ | 1 | /* $OpenBSD: ec_pmeth.c,v 1.17 2023/04/25 15:48:48 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 2006. | 3 | * project 2006. |
| 4 | */ | 4 | */ |
| @@ -381,12 +381,17 @@ pkey_ec_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) | |||
| 381 | return dctx->kdf_ukmlen; | 381 | return dctx->kdf_ukmlen; |
| 382 | 382 | ||
| 383 | case EVP_PKEY_CTRL_MD: | 383 | case EVP_PKEY_CTRL_MD: |
| 384 | /* RFC 3279, RFC 5758 and NIST CSOR. */ | ||
| 384 | if (EVP_MD_type((const EVP_MD *) p2) != NID_sha1 && | 385 | if (EVP_MD_type((const EVP_MD *) p2) != NID_sha1 && |
| 385 | EVP_MD_type((const EVP_MD *) p2) != NID_ecdsa_with_SHA1 && | 386 | EVP_MD_type((const EVP_MD *) p2) != NID_ecdsa_with_SHA1 && |
| 386 | EVP_MD_type((const EVP_MD *) p2) != NID_sha224 && | 387 | EVP_MD_type((const EVP_MD *) p2) != NID_sha224 && |
| 387 | EVP_MD_type((const EVP_MD *) p2) != NID_sha256 && | 388 | EVP_MD_type((const EVP_MD *) p2) != NID_sha256 && |
| 388 | EVP_MD_type((const EVP_MD *) p2) != NID_sha384 && | 389 | EVP_MD_type((const EVP_MD *) p2) != NID_sha384 && |
| 389 | EVP_MD_type((const EVP_MD *) p2) != NID_sha512) { | 390 | EVP_MD_type((const EVP_MD *) p2) != NID_sha512 && |
| 391 | EVP_MD_type((const EVP_MD *) p2) != NID_sha3_224 && | ||
| 392 | EVP_MD_type((const EVP_MD *) p2) != NID_sha3_256 && | ||
| 393 | EVP_MD_type((const EVP_MD *) p2) != NID_sha3_384 && | ||
| 394 | EVP_MD_type((const EVP_MD *) p2) != NID_sha3_512) { | ||
| 390 | ECerror(EC_R_INVALID_DIGEST_TYPE); | 395 | ECerror(EC_R_INVALID_DIGEST_TYPE); |
| 391 | return 0; | 396 | return 0; |
| 392 | } | 397 | } |
