From: tb Date: Sun, 18 Feb 2018 12:52:13 +0000 (+0000) Subject: Provide RSA_bits() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9f33c1ce97e59be56b2a5c4a2a05a1e3db28c8ce;p=openbsd Provide RSA_bits() ok jsing --- diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list index ab4c8593d7e..8f18580b559 100644 --- a/lib/libcrypto/Symbols.list +++ b/lib/libcrypto/Symbols.list @@ -2203,6 +2203,7 @@ RSA_PSS_PARAMS_free RSA_PSS_PARAMS_it RSA_PSS_PARAMS_new RSA_X931_hash_id +RSA_bits RSA_blinding_off RSA_blinding_on RSA_check_key diff --git a/lib/libcrypto/rsa/rsa.h b/lib/libcrypto/rsa/rsa.h index 7d4bd838c50..7e28a8766c6 100644 --- a/lib/libcrypto/rsa/rsa.h +++ b/lib/libcrypto/rsa/rsa.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa.h,v 1.32 2018/02/17 13:47:36 tb Exp $ */ +/* $OpenBSD: rsa.h,v 1.33 2018/02/18 12:52:13 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -256,6 +256,7 @@ struct rsa_st { RSA *RSA_new(void); RSA *RSA_new_method(ENGINE *engine); +int RSA_bits(const RSA *rsa); int RSA_size(const RSA *rsa); /* Deprecated version */ diff --git a/lib/libcrypto/rsa/rsa_crpt.c b/lib/libcrypto/rsa/rsa_crpt.c index f0c925602f7..a646ded4a73 100644 --- a/lib/libcrypto/rsa/rsa_crpt.c +++ b/lib/libcrypto/rsa/rsa_crpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa_crpt.c,v 1.18 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: rsa_crpt.c,v 1.19 2018/02/18 12:52:13 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -72,6 +72,12 @@ #include #endif +int +RSA_bits(const RSA *r) +{ + return BN_num_bits(r->n); +} + int RSA_size(const RSA *r) {