Add various 1.1.0 accessors.
This gets cURL building against both BoringSSL as it is and BoringSSL
with OPENSSL_VERSION_NUMBER set to 1.1.0.
BUG=91
Change-Id: I5be73b84df701fe76f3055b1239ae4704a931082
Reviewed-on: https://boringssl-review.googlesource.com/10180
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
Commit-Queue: David Benjamin <davidben@google.com>
Commit-Queue: Adam Langley <agl@google.com>
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/rsa/rsa.c b/crypto/rsa/rsa.c
index 8aa9adc..e0a2b5a 100644
--- a/crypto/rsa/rsa.c
+++ b/crypto/rsa/rsa.c
@@ -169,6 +169,42 @@
return 1;
}
+void RSA_get0_key(const RSA *rsa, const BIGNUM **out_n, const BIGNUM **out_e,
+ const BIGNUM **out_d) {
+ if (out_n != NULL) {
+ *out_n = rsa->n;
+ }
+ if (out_e != NULL) {
+ *out_e = rsa->e;
+ }
+ if (out_d != NULL) {
+ *out_d = rsa->d;
+ }
+}
+
+void RSA_get0_factors(const RSA *rsa, const BIGNUM **out_p,
+ const BIGNUM **out_q) {
+ if (out_p != NULL) {
+ *out_p = rsa->p;
+ }
+ if (out_q != NULL) {
+ *out_q = rsa->q;
+ }
+}
+
+void RSA_get0_crt_params(const RSA *rsa, const BIGNUM **out_dmp1,
+ const BIGNUM **out_dmq1, const BIGNUM **out_iqmp) {
+ if (out_dmp1 != NULL) {
+ *out_dmp1 = rsa->dmp1;
+ }
+ if (out_dmq1 != NULL) {
+ *out_dmq1 = rsa->dmq1;
+ }
+ if (out_iqmp != NULL) {
+ *out_iqmp = rsa->iqmp;
+ }
+}
+
int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb) {
if (rsa->meth->keygen) {
return rsa->meth->keygen(rsa, bits, e_value, cb);