aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2011-02-07 13:31:31 +0100
committerAndreas Schneider <asn@cryptomilk.org>2011-02-07 13:31:31 +0100
commit057704c097b69c982fc342fdb5b3566198cf3372 (patch)
tree3f08ba6001698f017b88153ee08158571776b0ae /tests
parent92f20ec85a27cb5634f476ce2e42ec8a973d5215 (diff)
downloadlibssh-057704c097b69c982fc342fdb5b3566198cf3372.tar.gz
libssh-057704c097b69c982fc342fdb5b3566198cf3372.tar.xz
libssh-057704c097b69c982fc342fdb5b3566198cf3372.zip
torture: Added more test for correct auth.
Diffstat (limited to 'tests')
-rw-r--r--tests/torture.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/torture.c b/tests/torture.c
index b1d5bf61..9c61ed2f 100644
--- a/tests/torture.c
+++ b/tests/torture.c
@@ -154,6 +154,7 @@ ssh_session torture_ssh_session(const char *host,
const char *user,
const char *password) {
ssh_session session;
+ int rc;
if (host == NULL) {
return NULL;
@@ -184,6 +185,15 @@ ssh_session torture_ssh_session(const char *host,
/* We are in testing mode, so consinder the hostkey as verified ;) */
+ /* This request should return a SSH_REQUEST_DENIED error */
+ rc = ssh_userauth_none(session, NULL);
+ if (rc == SSH_ERROR) {
+ goto failed;
+ }
+ if (!(ssh_auth_list(session) & SSH_AUTH_METHOD_INTERACTIVE)) {
+ goto failed;
+ }
+
if (password != NULL) {
rc = _torture_auth_kbdint(session, password);
} else {