summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortb <tb@openbsd.org>2018-02-20 17:42:32 +0000
committertb <tb@openbsd.org>2018-02-20 17:42:32 +0000
commit736a2db0c75238c8e1e07068dc5f24d1e26483ab (patch)
tree7540d63296453e744c4a756d4e2a90265680e257
parentProvide DH_{clear,set,test}_flags(). (diff)
downloadwireguard-openbsd-736a2db0c75238c8e1e07068dc5f24d1e26483ab.tar.xz
wireguard-openbsd-736a2db0c75238c8e1e07068dc5f24d1e26483ab.zip
Provide RSA_{clear,set,test}_flasg()
ok jsing
-rw-r--r--lib/libcrypto/Symbols.list3
-rw-r--r--lib/libcrypto/rsa/rsa.h5
-rw-r--r--lib/libcrypto/rsa/rsa_lib.c20
3 files changed, 26 insertions, 2 deletions
diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list
index 5a5df4702b8..a6137ca95da 100644
--- a/lib/libcrypto/Symbols.list
+++ b/lib/libcrypto/Symbols.list
@@ -2228,6 +2228,7 @@ RSA_bits
RSA_blinding_off
RSA_blinding_on
RSA_check_key
+RSA_clear_flags
RSA_flags
RSA_free
RSA_generate_key
@@ -2238,6 +2239,7 @@ RSA_get0_key
RSA_get_default_method
RSA_get_ex_data
RSA_get_ex_new_index
+RSA_get_flags
RSA_get_method
RSA_new
RSA_new_method
@@ -2264,6 +2266,7 @@ RSA_set0_factors
RSA_set0_key
RSA_set_default_method
RSA_set_ex_data
+RSA_set_flags
RSA_set_method
RSA_setup_blinding
RSA_sign
diff --git a/lib/libcrypto/rsa/rsa.h b/lib/libcrypto/rsa/rsa.h
index b131359e8c0..65a643f4c6d 100644
--- a/lib/libcrypto/rsa/rsa.h
+++ b/lib/libcrypto/rsa/rsa.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsa.h,v 1.36 2018/02/18 12:57:14 tb Exp $ */
+/* $OpenBSD: rsa.h,v 1.37 2018/02/20 17:42:32 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -404,6 +404,9 @@ void RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1,
int RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp);
void RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q);
int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q);
+void RSA_clear_flags(RSA *r, int flags);
+int RSA_test_flags(const RSA *r, int flags);
+void RSA_set_flags(RSA *r, int flags);
RSA *RSAPublicKey_dup(RSA *rsa);
RSA *RSAPrivateKey_dup(RSA *rsa);
diff --git a/lib/libcrypto/rsa/rsa_lib.c b/lib/libcrypto/rsa/rsa_lib.c
index 426c52f24af..544846f8252 100644
--- a/lib/libcrypto/rsa/rsa_lib.c
+++ b/lib/libcrypto/rsa/rsa_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsa_lib.c,v 1.35 2018/02/18 12:57:14 tb Exp $ */
+/* $OpenBSD: rsa_lib.c,v 1.36 2018/02/20 17:42:32 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -352,3 +352,21 @@ RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q)
return 1;
}
+
+void
+RSA_clear_flags(RSA *r, int flags)
+{
+ r->flags &= ~flags;
+}
+
+int
+RSA_test_flags(const RSA *r, int flags)
+{
+ return r->flags & flags;
+}
+
+void
+RSA_set_flags(RSA *r, int flags)
+{
+ r->flags |= flags;
+}