mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
Remove HAVE_OPENSSL_ED25519 ifdefs
ED25519 is implicitly included in new (>1.1.1) openssl version, no need to check it explicitly. Signed-off-by: Norbert Pocs <npocs@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Jakub Jelen
parent
28d27c3ae4
commit
358ce46551
@@ -1189,7 +1189,7 @@ ssh_string pki_private_key_to_pem(const ssh_key key,
|
||||
break;
|
||||
#endif /* OPENSSL_VERSION_NUMBER */
|
||||
case SSH_KEYTYPE_ED25519:
|
||||
#ifdef HAVE_OPENSSL_ED25519
|
||||
#ifdef HAVE_LIBCRYPTO
|
||||
/* In OpenSSL, the input is the private key seed only, which means
|
||||
* the first half of the SSH private key (the second half is the
|
||||
* public key) */
|
||||
@@ -1209,7 +1209,7 @@ ssh_string pki_private_key_to_pem(const ssh_key key,
|
||||
#else
|
||||
SSH_LOG(SSH_LOG_TRACE, "PEM output not supported for key type ssh-ed25519");
|
||||
goto err;
|
||||
#endif /* HAVE_OPENSSL_ED25519 */
|
||||
#endif /* HAVE_LIBCRYPTO */
|
||||
case SSH_KEYTYPE_DSS_CERT01:
|
||||
case SSH_KEYTYPE_RSA_CERT01:
|
||||
case SSH_KEYTYPE_ECDSA_P256_CERT01:
|
||||
@@ -1290,11 +1290,11 @@ ssh_key pki_private_key_from_base64(const char *b64_key,
|
||||
#else
|
||||
void *ecdsa = NULL;
|
||||
#endif /* HAVE_OPENSSL_ECC */
|
||||
#ifdef HAVE_OPENSSL_ED25519
|
||||
#ifdef HAVE_LIBCRYPTO
|
||||
uint8_t *ed25519 = NULL;
|
||||
#else
|
||||
ed25519_privkey *ed25519 = NULL;
|
||||
#endif /* HAVE_OPENSSL_ED25519 */
|
||||
#endif /* HAVE_LIBCRYPTO */
|
||||
ssh_key key = NULL;
|
||||
enum ssh_keytypes_e type = SSH_KEYTYPE_UNKNOWN;
|
||||
EVP_PKEY *pkey = NULL;
|
||||
@@ -1385,7 +1385,7 @@ ssh_key pki_private_key_from_base64(const char *b64_key,
|
||||
*/
|
||||
break;
|
||||
#endif /* HAVE_OPENSSL_ECC */
|
||||
#ifdef HAVE_OPENSSL_ED25519
|
||||
#ifdef HAVE_LIBCRYPTO
|
||||
case EVP_PKEY_ED25519:
|
||||
{
|
||||
size_t key_len;
|
||||
@@ -1422,7 +1422,7 @@ ssh_key pki_private_key_from_base64(const char *b64_key,
|
||||
|
||||
}
|
||||
break;
|
||||
#endif /* HAVE_OPENSSL_ED25519 */
|
||||
#endif /* HAVE_LIBCRYPTO */
|
||||
default:
|
||||
SSH_LOG(SSH_LOG_TRACE, "Unknown or invalid private key type %d",
|
||||
EVP_PKEY_base_id(pkey));
|
||||
@@ -1478,7 +1478,7 @@ fail:
|
||||
#ifdef HAVE_OPENSSL_ECC
|
||||
EC_KEY_free(ecdsa);
|
||||
#endif
|
||||
#ifdef HAVE_OPENSSL_ED25519
|
||||
#ifdef HAVE_LIBCRYPTO
|
||||
SAFE_FREE(ed25519);
|
||||
#endif
|
||||
return NULL;
|
||||
@@ -2945,7 +2945,7 @@ static EVP_PKEY *pki_key_to_pkey(ssh_key key)
|
||||
case SSH_KEYTYPE_ED25519_CERT01:
|
||||
case SSH_KEYTYPE_SK_ED25519:
|
||||
case SSH_KEYTYPE_SK_ED25519_CERT01:
|
||||
# if defined(HAVE_OPENSSL_ED25519)
|
||||
# ifdef HAVE_LIBCRYPTO
|
||||
if (ssh_key_is_private(key)) {
|
||||
if (key->ed25519_privkey == NULL) {
|
||||
SSH_LOG(SSH_LOG_TRACE, "NULL key->ed25519_privkey");
|
||||
@@ -3029,7 +3029,7 @@ ssh_signature pki_sign_data(const ssh_key privkey,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifndef HAVE_OPENSSL_ED25519
|
||||
#ifndef HAVE_LIBCRYPTO
|
||||
if (privkey->type == SSH_KEYTYPE_ED25519 ||
|
||||
privkey->type == SSH_KEYTYPE_ED25519_CERT01)
|
||||
{
|
||||
@@ -3171,7 +3171,7 @@ int pki_verify_data_signature(ssh_signature signature,
|
||||
|
||||
if (pubkey == NULL || ssh_key_is_private(pubkey) || input == NULL ||
|
||||
signature == NULL || (signature->raw_sig == NULL
|
||||
#ifndef HAVE_OPENSSL_ED25519
|
||||
#ifndef HAVE_LIBCRYPTO
|
||||
&& signature->ed25519_sig == NULL
|
||||
#endif
|
||||
))
|
||||
@@ -3187,7 +3187,7 @@ int pki_verify_data_signature(ssh_signature signature,
|
||||
return SSH_ERROR;
|
||||
}
|
||||
|
||||
#ifndef HAVE_OPENSSL_ED25519
|
||||
#ifndef HAVE_LIBCRYPTO
|
||||
if (pubkey->type == SSH_KEYTYPE_ED25519 ||
|
||||
pubkey->type == SSH_KEYTYPE_ED25519_CERT01 ||
|
||||
pubkey->type == SSH_KEYTYPE_SK_ED25519 ||
|
||||
@@ -3305,7 +3305,7 @@ int ssh_key_size(ssh_key key)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_OPENSSL_ED25519
|
||||
#ifdef HAVE_LIBCRYPTO
|
||||
int pki_key_generate_ed25519(ssh_key key)
|
||||
{
|
||||
int evp_rc;
|
||||
@@ -3423,7 +3423,7 @@ ssh_signature pki_do_sign_hash(const ssh_key privkey,
|
||||
|
||||
return sig;
|
||||
}
|
||||
#endif /* HAVE_OPENSSL_ED25519 */
|
||||
#endif /* HAVE_LIBCRYPTO */
|
||||
|
||||
/**
|
||||
* @internal
|
||||
|
||||
Reference in New Issue
Block a user