mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 10:40:27 +09:00
pki: Verify the provided public key has expected type
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 783e5fd206)
This commit is contained in:
committed by
Andreas Schneider
parent
5ffe695c3c
commit
ad4f1dbea0
@@ -1600,6 +1600,14 @@ ssh_signature pki_signature_from_blob(const ssh_key pubkey,
|
|||||||
int rc;
|
int rc;
|
||||||
BIGNUM *pr = NULL, *ps = NULL;
|
BIGNUM *pr = NULL, *ps = NULL;
|
||||||
|
|
||||||
|
if (type != pubkey->type) {
|
||||||
|
SSH_LOG(SSH_LOG_WARN,
|
||||||
|
"Incompatible public key provided (%d) expecting (%d)",
|
||||||
|
type,
|
||||||
|
pubkey->type);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
sig = ssh_signature_new();
|
sig = ssh_signature_new();
|
||||||
if (sig == NULL) {
|
if (sig == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -1848,6 +1848,14 @@ ssh_signature pki_signature_from_blob(const ssh_key pubkey,
|
|||||||
size_t rsalen;
|
size_t rsalen;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
if (type != pubkey->type) {
|
||||||
|
SSH_LOG(SSH_LOG_WARN,
|
||||||
|
"Incompatible public key provided (%d) expecting (%d)",
|
||||||
|
type,
|
||||||
|
pubkey->type);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
sig = ssh_signature_new();
|
sig = ssh_signature_new();
|
||||||
if (sig == NULL) {
|
if (sig == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -897,6 +897,14 @@ ssh_signature pki_signature_from_blob(const ssh_key pubkey,
|
|||||||
ssh_signature sig = NULL;
|
ssh_signature sig = NULL;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
if (type != pubkey->type) {
|
||||||
|
SSH_LOG(SSH_LOG_WARN,
|
||||||
|
"Incompatible public key provided (%d) expecting (%d)",
|
||||||
|
type,
|
||||||
|
pubkey->type);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
sig = ssh_signature_new();
|
sig = ssh_signature_new();
|
||||||
if (sig == NULL) {
|
if (sig == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user