mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 18:50:28 +09:00
pki_crypto: Make pki_signature_from_rsa_blob() to return int
The goal of this change is to make pki_signature_from_*_blob() consistent. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
01e98a6df7
commit
c3b8f9c0ec
@@ -1548,7 +1548,7 @@ ssh_string pki_signature_to_blob(const ssh_signature sig)
|
|||||||
return sig_blob;
|
return sig_blob;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssh_signature pki_signature_from_rsa_blob(const ssh_key pubkey,
|
static int pki_signature_from_rsa_blob(const ssh_key pubkey,
|
||||||
const ssh_string sig_blob,
|
const ssh_string sig_blob,
|
||||||
ssh_signature sig)
|
ssh_signature sig)
|
||||||
{
|
{
|
||||||
@@ -1606,11 +1606,10 @@ static ssh_signature pki_signature_from_rsa_blob(const ssh_key pubkey,
|
|||||||
sig->rsa_sig = sig_blob_padded;
|
sig->rsa_sig = sig_blob_padded;
|
||||||
}
|
}
|
||||||
|
|
||||||
return sig;
|
return SSH_OK;
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
ssh_signature_free(sig);
|
return SSH_ERROR;
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ssh_signature pki_signature_from_blob(const ssh_key pubkey,
|
ssh_signature pki_signature_from_blob(const ssh_key pubkey,
|
||||||
@@ -1709,8 +1708,9 @@ ssh_signature pki_signature_from_blob(const ssh_key pubkey,
|
|||||||
break;
|
break;
|
||||||
case SSH_KEYTYPE_RSA:
|
case SSH_KEYTYPE_RSA:
|
||||||
case SSH_KEYTYPE_RSA1:
|
case SSH_KEYTYPE_RSA1:
|
||||||
sig = pki_signature_from_rsa_blob(pubkey, sig_blob, sig);
|
rc = pki_signature_from_rsa_blob(pubkey, sig_blob, sig);
|
||||||
if (sig == NULL) {
|
if (rc != SSH_OK) {
|
||||||
|
ssh_signature_free(sig);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user