mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
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>
(cherry picked from commit 9d429eda93)
This commit is contained in:
committed by
Andreas Schneider
parent
24c44e2c7a
commit
e218745d0e
@@ -153,7 +153,7 @@ int pki_ed25519_verify(const ssh_key pubkey, ssh_signature sig,
|
|||||||
int pki_ed25519_key_cmp(const ssh_key k1,
|
int pki_ed25519_key_cmp(const ssh_key k1,
|
||||||
const ssh_key k2,
|
const ssh_key k2,
|
||||||
enum ssh_keycmp_e what);
|
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);
|
int pki_ed25519_public_key_to_blob(ssh_buffer buffer, ssh_key key);
|
||||||
ssh_string pki_ed25519_signature_to_blob(ssh_signature sig);
|
ssh_string pki_ed25519_signature_to_blob(ssh_signature sig);
|
||||||
int pki_signature_from_ed25519_blob(ssh_signature sig, ssh_string sig_blob);
|
int pki_signature_from_ed25519_blob(ssh_signature sig, ssh_string sig_blob);
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ int pki_ed25519_key_cmp(const ssh_key k1,
|
|||||||
*
|
*
|
||||||
* @return SSH_ERROR on error, SSH_OK on success
|
* @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) {
|
if (key->ed25519_privkey == NULL && key->ed25519_pubkey == NULL) {
|
||||||
return SSH_ERROR;
|
return SSH_ERROR;
|
||||||
@@ -147,29 +147,29 @@ int pki_ed25519_key_dup(ssh_key new, const ssh_key key)
|
|||||||
#ifdef HAVE_OPENSSL_ED25519
|
#ifdef HAVE_OPENSSL_ED25519
|
||||||
/* In OpenSSL implementation, the private key is the original private
|
/* In OpenSSL implementation, the private key is the original private
|
||||||
* seed, without the public key. */
|
* seed, without the public key. */
|
||||||
new->ed25519_privkey = malloc(ED25519_KEY_LEN);
|
new_key->ed25519_privkey = malloc(ED25519_KEY_LEN);
|
||||||
#else
|
#else
|
||||||
/* In the internal implementation, the private key is the concatenation
|
/* In the internal implementation, the private key is the concatenation
|
||||||
* of the private seed with the public key. */
|
* 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
|
#endif
|
||||||
if (new->ed25519_privkey == NULL) {
|
if (new_key->ed25519_privkey == NULL) {
|
||||||
return SSH_ERROR;
|
return SSH_ERROR;
|
||||||
}
|
}
|
||||||
#ifdef HAVE_OPENSSL_ED25519
|
#ifdef HAVE_OPENSSL_ED25519
|
||||||
memcpy(new->ed25519_privkey, key->ed25519_privkey, ED25519_KEY_LEN);
|
memcpy(new_key->ed25519_privkey, key->ed25519_privkey, ED25519_KEY_LEN);
|
||||||
#else
|
#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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key->ed25519_pubkey != NULL) {
|
if (key->ed25519_pubkey != NULL) {
|
||||||
new->ed25519_pubkey = malloc(ED25519_KEY_LEN);
|
new_key->ed25519_pubkey = malloc(ED25519_KEY_LEN);
|
||||||
if (new->ed25519_pubkey == NULL) {
|
if (new_key->ed25519_pubkey == NULL) {
|
||||||
SAFE_FREE(new->ed25519_privkey);
|
SAFE_FREE(new_key->ed25519_privkey);
|
||||||
return SSH_ERROR;
|
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;
|
return SSH_OK;
|
||||||
|
|||||||
Reference in New Issue
Block a user