@@ -575,9 +575,6 @@ int _goboringcrypto_ECDSA_verify(EVP_MD *md, const uint8_t *arg1, size_t arg2, c
575
575
576
576
#include <openssl/rsa.h>
577
577
578
- // Note: order of struct fields here is unchecked.
579
- typedef BN_GENCB GO_BN_GENCB ;
580
-
581
578
int _goboringcrypto_RSA_sign (EVP_MD * md , const uint8_t * msg , unsigned int msgLen , uint8_t * sig , size_t * slen , RSA * rsa );
582
579
int _goboringcrypto_RSA_verify (EVP_MD * md , const uint8_t * msg , unsigned int msgLen , const uint8_t * sig , unsigned int slen , GO_RSA * rsa );
583
580
@@ -590,9 +587,6 @@ int _goboringcrypto_RSA_verify_raw(EVP_MD *md, const uint8_t *msg, size_t msgLen
590
587
591
588
DEFINEFUNC (GO_RSA * , RSA_new , (void ), ())
592
589
DEFINEFUNC (void , RSA_free , (GO_RSA * arg0 ), (arg0 ))
593
- DEFINEFUNC (int , RSA_generate_key_ex ,
594
- (GO_RSA * arg0 , int arg1 , GO_BIGNUM * arg2 , GO_BN_GENCB * arg3 ),
595
- (arg0 , arg1 , arg2 , arg3 ))
596
590
597
591
DEFINEFUNCINTERNAL (int , RSA_set0_factors ,
598
592
(GO_RSA * rsa , GO_BIGNUM * p , GO_BIGNUM * q ),
@@ -740,7 +734,8 @@ _goboringcrypto_RSA_get0_key(const GO_RSA *rsa, const GO_BIGNUM **n, const GO_BI
740
734
#endif
741
735
}
742
736
743
- int _goboringcrypto_RSA_generate_key_fips (GO_RSA * , int , GO_BN_GENCB * );
737
+ GO_RSA * _goboringcrypto_RSA_generate_key_fips (int bits );
738
+
744
739
enum
745
740
{
746
741
GO_RSA_PKCS1_PADDING = 1 ,
@@ -759,7 +754,6 @@ int _goboringcrypto_RSA_sign_pss_mgf1(GO_RSA *, unsigned int *out_len, uint8_t *
759
754
int _goboringcrypto_RSA_verify_pss_mgf1 (GO_RSA * , const uint8_t * msg , unsigned int msg_len , GO_EVP_MD * md , const GO_EVP_MD * mgf1_md , int salt_len , const uint8_t * sig , unsigned int sig_len );
760
755
761
756
DEFINEFUNC (unsigned int , RSA_size , (const GO_RSA * arg0 ), (arg0 ))
762
- DEFINEFUNC (int , RSA_check_key , (const GO_RSA * arg0 ), (arg0 ))
763
757
764
758
DEFINEFUNC (int , EVP_EncryptInit_ex ,
765
759
(EVP_CIPHER_CTX * ctx , const EVP_CIPHER * type , ENGINE * impl , const unsigned char * key , const unsigned char * iv ),
@@ -814,6 +808,7 @@ typedef EVP_PKEY GO_EVP_PKEY;
814
808
815
809
DEFINEFUNC (GO_EVP_PKEY * , EVP_PKEY_new , (void ), ())
816
810
DEFINEFUNC (void , EVP_PKEY_free , (GO_EVP_PKEY * arg0 ), (arg0 ))
811
+ DEFINEFUNC (GO_RSA * , EVP_PKEY_get1_RSA , (GO_EVP_PKEY * arg0 ), (arg0 ))
817
812
DEFINEFUNC (int , EVP_PKEY_set1_RSA , (GO_EVP_PKEY * arg0 , GO_RSA * arg1 ), (arg0 , arg1 ))
818
813
DEFINEFUNC (int , EVP_PKEY_set1_EC_KEY , (GO_EVP_PKEY * arg0 , GO_EC_KEY * arg1 ), (arg0 , arg1 ))
819
814
DEFINEFUNC (int , EVP_PKEY_verify ,
@@ -879,6 +874,22 @@ _goboringcrypto_EVP_PKEY_CTX_set_rsa_mgf1_md(GO_EVP_PKEY_CTX * ctx, const GO_EVP
879
874
EVP_PKEY_CTRL_RSA_MGF1_MD , 0 , (void * )md );
880
875
}
881
876
877
+ static inline int
878
+ _goboringcrypto_EVP_PKEY_CTX_set_rsa_keygen_bits (GO_EVP_PKEY_CTX * ctx , int mbits ) {
879
+ return _goboringcrypto_EVP_PKEY_CTX_ctrl (ctx , -1 ,
880
+ EVP_PKEY_OP_KEYGEN ,
881
+ EVP_PKEY_CTRL_RSA_KEYGEN_BITS ,
882
+ mbits , NULL );
883
+ }
884
+
885
+ static inline int
886
+ _goboringcrypto_EVP_PKEY_CTX_set_rsa_keygen_pubexp (GO_EVP_PKEY_CTX * ctx , GO_BIGNUM * pubexp ) {
887
+ return _goboringcrypto_EVP_PKEY_CTX_ctrl (ctx , -1 ,
888
+ EVP_PKEY_OP_KEYGEN ,
889
+ EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP ,
890
+ 0 , pubexp );
891
+ }
892
+
882
893
DEFINEFUNC (int , EVP_PKEY_decrypt ,
883
894
(GO_EVP_PKEY_CTX * arg0 , uint8_t * arg1 , size_t * arg2 , const uint8_t * arg3 , size_t arg4 ),
884
895
(arg0 , arg1 , arg2 , arg3 , arg4 ))
0 commit comments