From eec5bb5de6de08ddb9bb4b14098bdf74403b758a Mon Sep 17 00:00:00 2001 From: tb <> Date: Wed, 5 Jan 2022 20:44:12 +0000 Subject: Prepare to provide a number of RSA accessors This adds RSA_get0_{n,e,d,p,q,dmp1,dmq1,iqmp,pss_params}() which will be exposed in the upcoming bump. ok inoguchi jsing --- src/lib/libcrypto/rsa/rsa_lib.c | 56 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) (limited to 'src/lib/libcrypto/rsa/rsa_lib.c') diff --git a/src/lib/libcrypto/rsa/rsa_lib.c b/src/lib/libcrypto/rsa/rsa_lib.c index 0b76aae398..92b2f32d61 100644 --- a/src/lib/libcrypto/rsa/rsa_lib.c +++ b/src/lib/libcrypto/rsa/rsa_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa_lib.c,v 1.40 2020/01/17 10:40:03 inoguchi Exp $ */ +/* $OpenBSD: rsa_lib.c,v 1.41 2022/01/05 20:44:12 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -336,6 +336,60 @@ RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q) return 1; } +const BIGNUM * +RSA_get0_n(const RSA *r) +{ + return r->n; +} + +const BIGNUM * +RSA_get0_e(const RSA *r) +{ + return r->e; +} + +const BIGNUM * +RSA_get0_d(const RSA *r) +{ + return r->d; +} + +const BIGNUM * +RSA_get0_p(const RSA *r) +{ + return r->p; +} + +const BIGNUM * +RSA_get0_q(const RSA *r) +{ + return r->q; +} + +const BIGNUM * +RSA_get0_dmp1(const RSA *r) +{ + return r->dmp1; +} + +const BIGNUM * +RSA_get0_dmq1(const RSA *r) +{ + return r->dmq1; +} + +const BIGNUM * +RSA_get0_iqmp(const RSA *r) +{ + return r->iqmp; +} + +const RSA_PSS_PARAMS * +RSA_get0_pss_params(const RSA *r) +{ + return r->pss; +} + void RSA_clear_flags(RSA *r, int flags) { -- cgit v1.2.3-55-g6feb