aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2011-08-22 18:17:41 +0200
committerAndreas Schneider <asn@cryptomilk.org>2011-08-22 18:41:47 +0200
commitbf2f553fc30b4d4f6476856a6c7d9e6a409e2842 (patch)
tree8afc00005294c22b91627416bbb88d3f73bddeb6
parent82ca6a6c532c3da9bb6c7d932a2d7447d6a4a17e (diff)
downloadlibssh-bf2f553fc30b4d4f6476856a6c7d9e6a409e2842.tar.gz
libssh-bf2f553fc30b4d4f6476856a6c7d9e6a409e2842.tar.xz
libssh-bf2f553fc30b4d4f6476856a6c7d9e6a409e2842.zip
pki: Improve pki gcrypt error reports.
-rw-r--r--src/pki_gcrypt.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/pki_gcrypt.c b/src/pki_gcrypt.c
index 116e5b0..ab83228 100644
--- a/src/pki_gcrypt.c
+++ b/src/pki_gcrypt.c
@@ -1298,8 +1298,12 @@ ssh_signature pki_signature_from_blob(const ssh_key pubkey,
ssh_print_hexa("RSA signature", ssh_string_data(sig_blob), len);
#endif
- if (gcry_sexp_build(&sig->rsa_sig, NULL, "(sig-val(rsa(s %b)))",
- ssh_string_len(sig_blob), ssh_string_data(sig_blob))) {
+ err = gcry_sexp_build(&sig->rsa_sig,
+ NULL,
+ "(sig-val(rsa(s %b)))",
+ ssh_string_len(sig_blob),
+ ssh_string_data(sig_blob));
+ if (err) {
ssh_signature_free(sig);
return NULL;
}
@@ -1328,7 +1332,7 @@ int pki_signature_verify(ssh_session session,
if (err) {
ssh_set_error(session,
SSH_FATAL,
- "DSA error: %s", gcry_strerror(err));
+ "DSA hash error: %s", gcry_strerror(err));
return SSH_ERROR;
}
err = gcry_pk_verify(sig->dsa_sig, sexp, key->dsa);
@@ -1353,7 +1357,7 @@ int pki_signature_verify(ssh_session session,
if (err) {
ssh_set_error(session,
SSH_FATAL,
- "RSA error: %s",
+ "RSA hash error: %s",
gcry_strerror(err));
return SSH_ERROR;
}