pki_ed25519_common.c: Change function parameter name

"new" is a c++ keyword which will make the build fail.

Signed-off-by: Norbert Pocs <npocs@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
Norbert Pocs
2022-10-23 19:40:52 +02:00
committed by Jakub Jelen
parent 34baecf49a
commit 9d429eda93
2 changed files with 11 additions and 11 deletions

View File

@@ -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);

View File

@@ -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;