Less confusing variable names in EVP_PKEY_{de,en}crypt_old()
authortb <tb@openbsd.org>
Wed, 20 Dec 2023 13:34:47 +0000 (13:34 +0000)
committertb <tb@openbsd.org>
Wed, 20 Dec 2023 13:34:47 +0000 (13:34 +0000)
ok jsing

lib/libcrypto/evp/p_dec.c
lib/libcrypto/evp/p_enc.c

index 2c63fe0..78a5ab4 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: p_dec.c,v 1.16 2023/12/20 10:14:14 tb Exp $ */
+/* $OpenBSD: p_dec.c,v 1.17 2023/12/20 13:34:47 tb Exp $ */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
 #include "evp_local.h"
 
 int
-EVP_PKEY_decrypt_old(unsigned char *key, const unsigned char *ek, int ekl,
-    EVP_PKEY *priv)
+EVP_PKEY_decrypt_old(unsigned char *to, const unsigned char *from, int from_len,
+    EVP_PKEY *pkey)
 {
-       if (priv->type != EVP_PKEY_RSA) {
+       if (pkey->type != EVP_PKEY_RSA) {
                EVPerror(EVP_R_PUBLIC_KEY_NOT_RSA);
                return -1;
        }
 
-       return RSA_private_decrypt(ekl, ek, key, priv->pkey.rsa,
+       return RSA_private_decrypt(from_len, from, to, pkey->pkey.rsa,
            RSA_PKCS1_PADDING);
 }
index b634626..549ac89 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: p_enc.c,v 1.16 2023/12/20 10:14:14 tb Exp $ */
+/* $OpenBSD: p_enc.c,v 1.17 2023/12/20 13:34:47 tb Exp $ */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
 #include "evp_local.h"
 
 int
-EVP_PKEY_encrypt_old(unsigned char *ek, const unsigned char *key, int key_len,
-    EVP_PKEY *pubk)
+EVP_PKEY_encrypt_old(unsigned char *to, const unsigned char *from, int from_len,
+    EVP_PKEY *pkey)
 {
-       if (pubk->type != EVP_PKEY_RSA) {
+       if (pkey->type != EVP_PKEY_RSA) {
                EVPerror(EVP_R_PUBLIC_KEY_NOT_RSA);
                return 0;
        }
 
-       return RSA_public_encrypt(key_len, key, ek, pubk->pkey.rsa,
+       return RSA_public_encrypt(from_len, from, to, pkey->pkey.rsa,
            RSA_PKCS1_PADDING);
 }