From 9d429eda937cc03bb8f8b806354d6e3469948325 Mon Sep 17 00:00:00 2001 From: Norbert Pocs Date: Sun, 23 Oct 2022 19:40:52 +0200 Subject: [PATCH] pki_ed25519_common.c: Change function parameter name "new" is a c++ keyword which will make the build fail. Signed-off-by: Norbert Pocs Reviewed-by: Jakub Jelen --- include/libssh/pki_priv.h | 2 +- src/pki_ed25519_common.c | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/libssh/pki_priv.h b/include/libssh/pki_priv.h index 854dbad3..9c41303b 100644 --- a/include/libssh/pki_priv.h +++ b/include/libssh/pki_priv.h @@ -153,7 +153,7 @@ int pki_ed25519_verify(const ssh_key pubkey, ssh_signature sig, int pki_ed25519_key_cmp(const ssh_key k1, const ssh_key k2, enum ssh_keycmp_e what); -int pki_ed25519_key_dup(ssh_key new, const ssh_key key); +int pki_ed25519_key_dup(ssh_key new_key, const ssh_key key); int pki_ed25519_public_key_to_blob(ssh_buffer buffer, ssh_key key); ssh_string pki_ed25519_signature_to_blob(ssh_signature sig); int pki_signature_from_ed25519_blob(ssh_signature sig, ssh_string sig_blob); diff --git a/src/pki_ed25519_common.c b/src/pki_ed25519_common.c index af8d0fbd..f9f69649 100644 --- a/src/pki_ed25519_common.c +++ b/src/pki_ed25519_common.c @@ -137,7 +137,7 @@ int pki_ed25519_key_cmp(const ssh_key k1, * * @return SSH_ERROR on error, SSH_OK on success */ -int pki_ed25519_key_dup(ssh_key new, const ssh_key key) +int pki_ed25519_key_dup(ssh_key new_key, const ssh_key key) { if (key->ed25519_privkey == NULL && key->ed25519_pubkey == NULL) { return SSH_ERROR; @@ -147,29 +147,29 @@ int pki_ed25519_key_dup(ssh_key new, const ssh_key key) #ifdef HAVE_LIBCRYPTO /* In OpenSSL implementation, the private key is the original private * seed, without the public key. */ - new->ed25519_privkey = malloc(ED25519_KEY_LEN); + new_key->ed25519_privkey = malloc(ED25519_KEY_LEN); #else /* In the internal implementation, the private key is the concatenation * of the private seed with the public key. */ - new->ed25519_privkey = malloc(2 * ED25519_KEY_LEN); + new_key->ed25519_privkey = malloc(2 * ED25519_KEY_LEN); #endif - if (new->ed25519_privkey == NULL) { + if (new_key->ed25519_privkey == NULL) { return SSH_ERROR; } #ifdef HAVE_LIBCRYPTO - memcpy(new->ed25519_privkey, key->ed25519_privkey, ED25519_KEY_LEN); + memcpy(new_key->ed25519_privkey, key->ed25519_privkey, ED25519_KEY_LEN); #else - memcpy(new->ed25519_privkey, key->ed25519_privkey, 2 * ED25519_KEY_LEN); + memcpy(new_key->ed25519_privkey, key->ed25519_privkey, 2 * ED25519_KEY_LEN); #endif } if (key->ed25519_pubkey != NULL) { - new->ed25519_pubkey = malloc(ED25519_KEY_LEN); - if (new->ed25519_pubkey == NULL) { - SAFE_FREE(new->ed25519_privkey); + new_key->ed25519_pubkey = malloc(ED25519_KEY_LEN); + if (new_key->ed25519_pubkey == NULL) { + SAFE_FREE(new_key->ed25519_privkey); return SSH_ERROR; } - memcpy(new->ed25519_pubkey, key->ed25519_pubkey, ED25519_KEY_LEN); + memcpy(new_key->ed25519_pubkey, key->ed25519_pubkey, ED25519_KEY_LEN); } return SSH_OK;