1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

bind: Add more error messages.

This commit is contained in:
Andreas Schneider
2011-11-09 10:19:22 +01:00
parent ce26b8d777
commit bc2ab9b414

View File

@@ -178,10 +178,14 @@ int ssh_bind_listen(ssh_bind sshbind) {
NULL, NULL,
&sshbind->dsa); &sshbind->dsa);
if (rc == SSH_ERROR) { if (rc == SSH_ERROR) {
ssh_set_error(sshbind, SSH_FATAL,
"Failed to import private DSA host key");
return SSH_ERROR; return SSH_ERROR;
} }
if (ssh_key_type(sshbind->dsa) != SSH_KEYTYPE_DSS) { 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); ssh_key_free(sshbind->dsa);
return SSH_ERROR; return SSH_ERROR;
} }
@@ -194,12 +198,16 @@ int ssh_bind_listen(ssh_bind sshbind) {
NULL, NULL,
&sshbind->rsa); &sshbind->rsa);
if (rc == SSH_ERROR) { if (rc == SSH_ERROR) {
ssh_set_error(sshbind, SSH_FATAL,
"Failed to import private RSA host key");
return SSH_ERROR; return SSH_ERROR;
} }
if (ssh_key_type(sshbind->rsa) != SSH_KEYTYPE_RSA && if (ssh_key_type(sshbind->rsa) != SSH_KEYTYPE_RSA &&
ssh_key_type(sshbind->rsa) != SSH_KEYTYPE_RSA1) { 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; return SSH_ERROR;
} }
} }