summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2022-06-27 12:30:28 +0000
committertb <>2022-06-27 12:30:28 +0000
commit480c1f602005c8b8ae31165e5edd93ad31443164 (patch)
tree213301d471852a025877e6d1502f9498529399f2 /src
parentfa34a807ea885934f65ce1aa4899138836157e6a (diff)
downloadopenbsd-480c1f602005c8b8ae31165e5edd93ad31443164.tar.gz
openbsd-480c1f602005c8b8ae31165e5edd93ad31443164.tar.bz2
openbsd-480c1f602005c8b8ae31165e5edd93ad31443164.zip
Prepare to provide RSA_security_bits()
ok beck jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/rsa/rsa.h6
-rw-r--r--src/lib/libcrypto/rsa/rsa_lib.c8
2 files changed, 12 insertions, 2 deletions
diff --git a/src/lib/libcrypto/rsa/rsa.h b/src/lib/libcrypto/rsa/rsa.h
index d59fd03f76..8e19da2c7f 100644
--- a/src/lib/libcrypto/rsa/rsa.h
+++ b/src/lib/libcrypto/rsa/rsa.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa.h,v 1.55 2022/01/14 08:34:39 tb Exp $ */ 1/* $OpenBSD: rsa.h,v 1.56 2022/06/27 12:30:28 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -372,6 +372,10 @@ int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
372int RSA_set_ex_data(RSA *r, int idx, void *arg); 372int RSA_set_ex_data(RSA *r, int idx, void *arg);
373void *RSA_get_ex_data(const RSA *r, int idx); 373void *RSA_get_ex_data(const RSA *r, int idx);
374 374
375#ifdef LIBRESSL_INTERNAL
376int RSA_security_bits(const RSA *rsa);
377#endif
378
375void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, 379void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e,
376 const BIGNUM **d); 380 const BIGNUM **d);
377int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d); 381int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d);
diff --git a/src/lib/libcrypto/rsa/rsa_lib.c b/src/lib/libcrypto/rsa/rsa_lib.c
index ddf3f1ba75..570bb6c05e 100644
--- a/src/lib/libcrypto/rsa/rsa_lib.c
+++ b/src/lib/libcrypto/rsa/rsa_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_lib.c,v 1.42 2022/01/07 09:55:32 tb Exp $ */ 1/* $OpenBSD: rsa_lib.c,v 1.43 2022/06/27 12:30:28 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -241,6 +241,12 @@ RSA_get_ex_data(const RSA *r, int idx)
241 return CRYPTO_get_ex_data(&r->ex_data, idx); 241 return CRYPTO_get_ex_data(&r->ex_data, idx);
242} 242}
243 243
244int
245RSA_security_bits(const RSA *rsa)
246{
247 return BN_security_bits(RSA_bits(rsa), -1);
248}
249
244void 250void
245RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) 251RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d)
246{ 252{