aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-09-26 11:20:03 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-10-24 09:48:35 +0200
commit7e5291668ca52fdb97cea8751b3607408935da61 (patch)
treea83f94a0821c869fd1fe805cd3dd8302f531e7a6 /src
parentbb081f66818a9ee92090f55a904830e38521c2a6 (diff)
downloadlibssh-7e5291668ca52fdb97cea8751b3607408935da61.tar.gz
libssh-7e5291668ca52fdb97cea8751b3607408935da61.tar.xz
libssh-7e5291668ca52fdb97cea8751b3607408935da61.zip
gssapi: Check return code of gss_indicate_mechs()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src')
-rw-r--r--src/gssapi.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gssapi.c b/src/gssapi.c
index 18b2bfac..c7c8b2f0 100644
--- a/src/gssapi.c
+++ b/src/gssapi.c
@@ -216,6 +216,15 @@ int ssh_gssapi_handle_userauth(ssh_session session, const char *user, uint32_t n
gss_create_empty_oid_set(&min_stat, &both_supported);
maj_stat = gss_indicate_mechs(&min_stat, &supported);
+ if (maj_stat != GSS_S_COMPLETE) {
+ SSH_LOG(SSH_LOG_WARNING, "indicate mecks %d, %d", maj_stat, min_stat);
+ ssh_gssapi_log_error(SSH_LOG_WARNING,
+ "indicate mechs",
+ maj_stat,
+ min_stat);
+ return SSH_ERROR;
+ }
+
for (i=0; i < supported->count; ++i){
ptr = ssh_get_hexa(supported->elements[i].elements, supported->elements[i].length);
SSH_LOG(SSH_LOG_DEBUG, "Supported mech %zu: %s", i, ptr);