aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2011-11-09 10:19:22 +0100
committerAndreas Schneider <asn@cryptomilk.org>2011-11-09 10:21:51 +0100
commitbc2ab9b41449dee287beeb1417dbd08e119b0536 (patch)
tree71d5927e912d348136a11931a15cba9fff6e5cdd
parentce26b8d7779f2023fd2aedeb96789bae407f88fd (diff)
downloadlibssh-bc2ab9b41449dee287beeb1417dbd08e119b0536.tar.gz
libssh-bc2ab9b41449dee287beeb1417dbd08e119b0536.tar.xz
libssh-bc2ab9b41449dee287beeb1417dbd08e119b0536.zip
bind: Add more error messages.
-rw-r--r--src/bind.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/bind.c b/src/bind.c
index e86f8210..5097801c 100644
--- a/src/bind.c
+++ b/src/bind.c
@@ -178,10 +178,14 @@ int ssh_bind_listen(ssh_bind sshbind) {
NULL,
&sshbind->dsa);
if (rc == SSH_ERROR) {
+ ssh_set_error(sshbind, SSH_FATAL,
+ "Failed to import private DSA host key");
return SSH_ERROR;
}
if (ssh_key_type(sshbind->dsa) != SSH_KEYTYPE_DSS) {
+ ssh_set_error(sshbind, SSH_FATAL,
+ "The DSA host key has the wrong type");
ssh_key_free(sshbind->dsa);
return SSH_ERROR;
}
@@ -194,12 +198,16 @@ int ssh_bind_listen(ssh_bind sshbind) {
NULL,
&sshbind->rsa);
if (rc == SSH_ERROR) {
+ ssh_set_error(sshbind, SSH_FATAL,
+ "Failed to import private RSA host key");
return SSH_ERROR;
}
if (ssh_key_type(sshbind->rsa) != SSH_KEYTYPE_RSA &&
ssh_key_type(sshbind->rsa) != SSH_KEYTYPE_RSA1) {
- ssh_key_free(sshbind->dsa);
+ ssh_set_error(sshbind, SSH_FATAL,
+ "The RSA host key has the wrong type");
+ ssh_key_free(sshbind->rsa);
return SSH_ERROR;
}
}