mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
Remove support for DSA Keys
Solving issue #110. The original work is at !231 Some changes were needed because the newly added features in master through time Signed-off-by: Mohammad Shehar Yaar Tausif <sheharyaar48@gmail.com> Signed-off-by: Norbert Pocs <npocs@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
committed by
Jakub Jelen
parent
486df37a84
commit
a3a13eb3a8
18
src/legacy.c
18
src/legacy.c
@@ -84,7 +84,6 @@ int ssh_userauth_pubkey(ssh_session session,
|
||||
key->type_c = ssh_key_type_to_char(key->type);
|
||||
key->flags = SSH_KEY_FLAG_PRIVATE|SSH_KEY_FLAG_PUBLIC;
|
||||
#ifndef HAVE_LIBCRYPTO
|
||||
key->dsa = privatekey->dsa_priv;
|
||||
key->rsa = privatekey->rsa_priv;
|
||||
#else
|
||||
key->key = privatekey->key_priv;
|
||||
@@ -92,7 +91,6 @@ int ssh_userauth_pubkey(ssh_session session,
|
||||
|
||||
rc = ssh_userauth_publickey(session, username, key);
|
||||
#ifndef HAVE_LIBCRYPTO
|
||||
key->dsa = NULL;
|
||||
key->rsa = NULL;
|
||||
#else
|
||||
key->key = NULL;
|
||||
@@ -358,13 +356,6 @@ void publickey_free(ssh_public_key key) {
|
||||
}
|
||||
|
||||
switch(key->type) {
|
||||
case SSH_KEYTYPE_DSS:
|
||||
#ifdef HAVE_LIBGCRYPT
|
||||
gcry_sexp_release(key->dsa_pub);
|
||||
#elif defined HAVE_LIBCRYPTO
|
||||
EVP_PKEY_free(key->key_pub);
|
||||
#endif /* HAVE_LIBGCRYPT */
|
||||
break;
|
||||
case SSH_KEYTYPE_RSA:
|
||||
#ifdef HAVE_LIBGCRYPT
|
||||
gcry_sexp_release(key->rsa_pub);
|
||||
@@ -396,7 +387,6 @@ ssh_public_key publickey_from_privatekey(ssh_private_key prv) {
|
||||
privkey->type_c = ssh_key_type_to_char(privkey->type);
|
||||
privkey->flags = SSH_KEY_FLAG_PRIVATE | SSH_KEY_FLAG_PUBLIC;
|
||||
#ifndef HAVE_LIBCRYPTO
|
||||
privkey->dsa = prv->dsa_priv;
|
||||
privkey->rsa = prv->rsa_priv;
|
||||
#else
|
||||
privkey->key = prv->key_priv;
|
||||
@@ -404,7 +394,6 @@ ssh_public_key publickey_from_privatekey(ssh_private_key prv) {
|
||||
|
||||
rc = ssh_pki_export_privkey_to_pubkey(privkey, &pubkey);
|
||||
#ifndef HAVE_LIBCRYPTO
|
||||
privkey->dsa = NULL;
|
||||
privkey->rsa = NULL;
|
||||
#else
|
||||
privkey->key = NULL;
|
||||
@@ -455,10 +444,8 @@ ssh_private_key privatekey_from_file(ssh_session session,
|
||||
|
||||
privkey->type = key->type;
|
||||
#ifndef HAVE_LIBCRYPTO
|
||||
privkey->dsa_priv = key->dsa;
|
||||
privkey->rsa_priv = key->rsa;
|
||||
|
||||
key->dsa = NULL;
|
||||
key->rsa = NULL;
|
||||
#else
|
||||
privkey->key_priv = key->key;
|
||||
@@ -483,7 +470,6 @@ void privatekey_free(ssh_private_key prv) {
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBGCRYPT
|
||||
gcry_sexp_release(prv->dsa_priv);
|
||||
gcry_sexp_release(prv->rsa_priv);
|
||||
#elif defined HAVE_LIBCRYPTO
|
||||
EVP_PKEY_free(prv->key_priv);
|
||||
@@ -552,8 +538,6 @@ ssh_public_key publickey_from_string(ssh_session session, ssh_string pubkey_s) {
|
||||
pubkey->type_c = key->type_c;
|
||||
|
||||
#ifndef HAVE_LIBCRYPTO
|
||||
pubkey->dsa_pub = key->dsa;
|
||||
key->dsa = NULL;
|
||||
pubkey->rsa_pub = key->rsa;
|
||||
key->rsa = NULL;
|
||||
#else
|
||||
@@ -584,7 +568,6 @@ ssh_string publickey_to_string(ssh_public_key pubkey) {
|
||||
key->type_c = pubkey->type_c;
|
||||
|
||||
#ifndef HAVE_LIBCRYPTO
|
||||
key->dsa = pubkey->dsa_pub;
|
||||
key->rsa = pubkey->rsa_pub;
|
||||
#else
|
||||
key->key = pubkey->key_pub;
|
||||
@@ -596,7 +579,6 @@ ssh_string publickey_to_string(ssh_public_key pubkey) {
|
||||
}
|
||||
|
||||
#ifndef HAVE_LIBCRYPTO
|
||||
key->dsa = NULL;
|
||||
key->rsa = NULL;
|
||||
#else
|
||||
key->key = NULL;
|
||||
|
||||
Reference in New Issue
Block a user