Skip to content

Commit bd98bb4

Browse files
author
tb
committed
Merge remainder of rsa_crpt.c into rsa_eay.c
Most of these are one line wrappers around methods implemented in rsa_eay.c by default.
1 parent c7d7d37 commit bd98bb4

File tree

3 files changed

+55
-130
lines changed

3 files changed

+55
-130
lines changed

src/lib/libcrypto/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $OpenBSD: Makefile,v 1.154 2023/08/09 09:23:03 tb Exp $
1+
# $OpenBSD: Makefile,v 1.155 2023/08/09 09:32:22 tb Exp $
22

33
LIB= crypto
44
LIBREBUILD=y
@@ -535,7 +535,6 @@ SRCS+= rsa_ameth.c
535535
SRCS+= rsa_asn1.c
536536
SRCS+= rsa_blinding.c
537537
SRCS+= rsa_chk.c
538-
SRCS+= rsa_crpt.c
539538
SRCS+= rsa_eay.c
540539
SRCS+= rsa_err.c
541540
SRCS+= rsa_gen.c

src/lib/libcrypto/rsa/rsa_crpt.c

Lines changed: 0 additions & 127 deletions
This file was deleted.

src/lib/libcrypto/rsa/rsa_eay.c

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: rsa_eay.c,v 1.63 2023/08/02 08:44:38 tb Exp $ */
1+
/* $OpenBSD: rsa_eay.c,v 1.64 2023/08/09 09:32:23 tb Exp $ */
22
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
33
* All rights reserved.
44
*
@@ -857,3 +857,56 @@ RSA_PKCS1_SSLeay(void)
857857
return RSA_PKCS1_OpenSSL();
858858
}
859859
LCRYPTO_ALIAS(RSA_PKCS1_SSLeay);
860+
861+
int
862+
RSA_bits(const RSA *r)
863+
{
864+
return BN_num_bits(r->n);
865+
}
866+
LCRYPTO_ALIAS(RSA_bits);
867+
868+
int
869+
RSA_size(const RSA *r)
870+
{
871+
return BN_num_bytes(r->n);
872+
}
873+
LCRYPTO_ALIAS(RSA_size);
874+
875+
int
876+
RSA_public_encrypt(int flen, const unsigned char *from, unsigned char *to,
877+
RSA *rsa, int padding)
878+
{
879+
return rsa->meth->rsa_pub_enc(flen, from, to, rsa, padding);
880+
}
881+
LCRYPTO_ALIAS(RSA_public_encrypt);
882+
883+
int
884+
RSA_private_encrypt(int flen, const unsigned char *from, unsigned char *to,
885+
RSA *rsa, int padding)
886+
{
887+
return rsa->meth->rsa_priv_enc(flen, from, to, rsa, padding);
888+
}
889+
LCRYPTO_ALIAS(RSA_private_encrypt);
890+
891+
int
892+
RSA_private_decrypt(int flen, const unsigned char *from, unsigned char *to,
893+
RSA *rsa, int padding)
894+
{
895+
return rsa->meth->rsa_priv_dec(flen, from, to, rsa, padding);
896+
}
897+
LCRYPTO_ALIAS(RSA_private_decrypt);
898+
899+
int
900+
RSA_public_decrypt(int flen, const unsigned char *from, unsigned char *to,
901+
RSA *rsa, int padding)
902+
{
903+
return rsa->meth->rsa_pub_dec(flen, from, to, rsa, padding);
904+
}
905+
LCRYPTO_ALIAS(RSA_public_decrypt);
906+
907+
int
908+
RSA_flags(const RSA *r)
909+
{
910+
return r == NULL ? 0 : r->meth->flags;
911+
}
912+
LCRYPTO_ALIAS(RSA_flags);

0 commit comments

Comments
 (0)