aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/asn1
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2014-01-18 14:51:40 +0000
committerDr. Stephen Henson <steve@openssl.org>2014-03-28 14:49:04 +0000
commit2514fa79acba998c2a8d4e5a8288a5b3ae990377 (patch)
tree28f4391dc3e8fc22197e53b75360800f182d9b19 /crypto/asn1
parent4563da1d7c53e969e8d092d018795179bb648a7c (diff)
downloadopenssl-2514fa79acba998c2a8d4e5a8288a5b3ae990377.tar.gz
Add functions returning security bits.
Add functions to return the "bits of security" for various public key algorithms. Based on SP800-57.
Diffstat (limited to 'crypto/asn1')
-rw-r--r--crypto/asn1/ameth_lib.c7
-rw-r--r--crypto/asn1/asn1_locl.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/crypto/asn1/ameth_lib.c b/crypto/asn1/ameth_lib.c
index 5fff226120..f317204d9c 100644
--- a/crypto/asn1/ameth_lib.c
+++ b/crypto/asn1/ameth_lib.c
@@ -462,3 +462,10 @@ void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth,
{
ameth->pkey_ctrl = pkey_ctrl;
}
+
+void EVP_PKEY_asn1_set_security_bits(EVP_PKEY_ASN1_METHOD *ameth,
+ int (*pkey_security_bits)(const EVP_PKEY *pk))
+ {
+ ameth->pkey_security_bits = pkey_security_bits;
+ }
+
diff --git a/crypto/asn1/asn1_locl.h b/crypto/asn1/asn1_locl.h
index a1035cd46e..023934bb2b 100644
--- a/crypto/asn1/asn1_locl.h
+++ b/crypto/asn1/asn1_locl.h
@@ -122,6 +122,7 @@ struct evp_pkey_asn1_method_st
int (*pkey_size)(const EVP_PKEY *pk);
int (*pkey_bits)(const EVP_PKEY *pk);
+ int (*pkey_security_bits)(const EVP_PKEY *pk);
int (*param_decode)(EVP_PKEY *pkey,
const unsigned char **pder, int derlen);