summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/p_legacy.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/evp/p_legacy.c (renamed from src/lib/libcrypto/evp/p_dec.c)15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/lib/libcrypto/evp/p_dec.c b/src/lib/libcrypto/evp/p_legacy.c
index 78a5ab4823..a88393a849 100644
--- a/src/lib/libcrypto/evp/p_dec.c
+++ b/src/lib/libcrypto/evp/p_legacy.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_dec.c,v 1.17 2023/12/20 13:34:47 tb Exp $ */ 1/* $OpenBSD: p_legacy.c,v 1.1 2023/12/20 13:46:05 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -75,3 +75,16 @@ EVP_PKEY_decrypt_old(unsigned char *to, const unsigned char *from, int from_len,
75 return RSA_private_decrypt(from_len, from, to, pkey->pkey.rsa, 75 return RSA_private_decrypt(from_len, from, to, pkey->pkey.rsa,
76 RSA_PKCS1_PADDING); 76 RSA_PKCS1_PADDING);
77} 77}
78
79int
80EVP_PKEY_encrypt_old(unsigned char *to, const unsigned char *from, int from_len,
81 EVP_PKEY *pkey)
82{
83 if (pkey->type != EVP_PKEY_RSA) {
84 EVPerror(EVP_R_PUBLIC_KEY_NOT_RSA);
85 return 0;
86 }
87
88 return RSA_public_encrypt(from_len, from, to, pkey->pkey.rsa,
89 RSA_PKCS1_PADDING);
90}