diff options
| author | tb <> | 2022-06-27 12:36:06 +0000 |
|---|---|---|
| committer | tb <> | 2022-06-27 12:36:06 +0000 |
| commit | 3a9b1012fb6b57946e4cf3ee7b795a4bdcb905cc (patch) | |
| tree | 1ce3c6ef198c92eb3730b767a8f90f5a0e5f1ac1 /src/lib/libcrypto/dh/dh_ameth.c | |
| parent | e9bc35a6d120c0aa1f30feafb92222df91771dbd (diff) | |
| download | openbsd-3a9b1012fb6b57946e4cf3ee7b795a4bdcb905cc.tar.gz openbsd-3a9b1012fb6b57946e4cf3ee7b795a4bdcb905cc.tar.bz2 openbsd-3a9b1012fb6b57946e4cf3ee7b795a4bdcb905cc.zip | |
Prepare to provide EVP_PKEY_security_bits()
This also provides a pkey_security_bits member to the PKEY ASN.1 methods
and a corresponding setter EVP_PKEY_asn1_set_security_bits().
ok beck jsing
Diffstat (limited to 'src/lib/libcrypto/dh/dh_ameth.c')
| -rw-r--r-- | src/lib/libcrypto/dh/dh_ameth.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/libcrypto/dh/dh_ameth.c b/src/lib/libcrypto/dh/dh_ameth.c index 0df7fbc739..3701946cef 100644 --- a/src/lib/libcrypto/dh/dh_ameth.c +++ b/src/lib/libcrypto/dh/dh_ameth.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: dh_ameth.c,v 1.23 2022/01/20 11:00:34 inoguchi Exp $ */ | 1 | /* $OpenBSD: dh_ameth.c,v 1.24 2022/06/27 12:36:05 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 | */ |
| @@ -398,6 +398,12 @@ dh_bits(const EVP_PKEY *pkey) | |||
| 398 | } | 398 | } |
| 399 | 399 | ||
| 400 | static int | 400 | static int |
| 401 | dh_security_bits(const EVP_PKEY *pkey) | ||
| 402 | { | ||
| 403 | return DH_security_bits(pkey->pkey.dh); | ||
| 404 | } | ||
| 405 | |||
| 406 | static int | ||
| 401 | dh_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b) | 407 | dh_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b) |
| 402 | { | 408 | { |
| 403 | if (BN_cmp(a->pkey.dh->p, b->pkey.dh->p) || | 409 | if (BN_cmp(a->pkey.dh->p, b->pkey.dh->p) || |
| @@ -512,6 +518,7 @@ const EVP_PKEY_ASN1_METHOD dh_asn1_meth = { | |||
| 512 | 518 | ||
| 513 | .pkey_size = int_dh_size, | 519 | .pkey_size = int_dh_size, |
| 514 | .pkey_bits = dh_bits, | 520 | .pkey_bits = dh_bits, |
| 521 | .pkey_security_bits = dh_security_bits, | ||
| 515 | 522 | ||
| 516 | .param_decode = dh_param_decode, | 523 | .param_decode = dh_param_decode, |
| 517 | .param_encode = dh_param_encode, | 524 | .param_encode = dh_param_encode, |
