diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2011-08-15 18:44:45 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-08-15 18:48:08 +0200 |
commit | a983512678de0bce96218b75a1cfc6663e65f280 (patch) | |
tree | f79eba4d44596befd3ed884535ec900050f79dbb | |
parent | c77b23b32a550a3dd52b8d2c5b3d1b177126dc54 (diff) | |
download | libssh-a983512678de0bce96218b75a1cfc6663e65f280.tar.gz libssh-a983512678de0bce96218b75a1cfc6663e65f280.tar.xz libssh-a983512678de0bce96218b75a1cfc6663e65f280.zip |
pki: Fix ssh_key_dup().
-rw-r--r-- | src/pki_crypto.c | 4 | ||||
-rw-r--r-- | src/pki_gcrypt.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/pki_crypto.c b/src/pki_crypto.c index 763cb46..68d46b3 100644 --- a/src/pki_crypto.c +++ b/src/pki_crypto.c @@ -114,7 +114,7 @@ ssh_key pki_key_dup(const ssh_key key, int demote) goto fail; } - if (!demote && (key->flags == SSH_KEY_FLAG_PRIVATE)) { + if (!demote && (key->flags & SSH_KEY_FLAG_PRIVATE)) { new->dsa->priv_key = BN_dup(key->dsa->priv_key); if (new->dsa->priv_key == NULL) { goto fail; @@ -149,7 +149,7 @@ ssh_key pki_key_dup(const ssh_key key, int demote) goto fail; } - if (!demote && (key->flags == SSH_KEY_FLAG_PRIVATE)) { + if (!demote && (key->flags & SSH_KEY_FLAG_PRIVATE)) { new->rsa->d = BN_dup(key->rsa->d); if (new->rsa->d == NULL) { goto fail; diff --git a/src/pki_gcrypt.c b/src/pki_gcrypt.c index c266831..28b4bad 100644 --- a/src/pki_gcrypt.c +++ b/src/pki_gcrypt.c @@ -808,7 +808,7 @@ ssh_key pki_key_dup(const ssh_key key, int demote) ssh_string_fill(y, (char *)tmp, size); gcry_sexp_release(sexp); - if (!demote && (key->flags == SSH_KEY_FLAG_PRIVATE)) { + if (!demote && (key->flags & SSH_KEY_FLAG_PRIVATE)) { sexp = gcry_sexp_find_token(key->dsa, "x", 0); if (sexp == NULL) { goto fail; @@ -877,7 +877,7 @@ ssh_key pki_key_dup(const ssh_key key, int demote) ssh_string_fill(e, (char *)tmp, size); gcry_sexp_release(sexp); - if (!demote && (key->flags == SSH_KEY_FLAG_PRIVATE)) { + if (!demote && (key->flags & SSH_KEY_FLAG_PRIVATE)) { sexp = gcry_sexp_find_token(key->rsa, "d", 0); if (sexp == NULL) { goto fail; |