From: Ken Hornstein Date: Wed, 21 Sep 2016 20:51:21 +0000 (-0400) Subject: Okay! Squashed a few bugs, now have POP OAuth tests working. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/64a5aa136edfe27f5158a65d8a8663c3ed5073f9?ds=inline;hp=--cc Okay! Squashed a few bugs, now have POP OAuth tests working. --- 64a5aa136edfe27f5158a65d8a8663c3ed5073f9 diff --git a/sbr/netsec.c b/sbr/netsec.c index 4d0d672f..a5110f0c 100644 --- a/sbr/netsec.c +++ b/sbr/netsec.c @@ -281,6 +281,7 @@ netsec_b64_snoop_decoder(netsec_context *nsc, const char *string, size_t len, { const char *decoded; size_t decodedlen; + NMH_UNUSED(nsc); int offset = context ? *((int *) context) : 0; @@ -797,7 +798,7 @@ retry: #endif /* TLS_SUPPORT */ fprintf(stderr, "=> "); if (nsc->ns_snoop_cb) - nsc->ns_snoop_cb(nsc, nsc->ns_outptr, outlen, + nsc->ns_snoop_cb(nsc, (char *) nsc->ns_outptr, outlen, nsc->ns_snoop_context); else fprintf(stderr, "%.*s\n", outlen, nsc->ns_outptr); @@ -1093,7 +1094,6 @@ netsec_negotiate_sasl(netsec_context *nsc, const char *mechlist, char **errstr) i = (str[i] == NULL); - free(str); free(mlist); if (i) { @@ -1150,7 +1150,7 @@ netsec_negotiate_sasl(netsec_context *nsc, const char *mechlist, char **errstr) * we ignore it and send a blank message in response. We should * then get either an +OK or -ERR */ - free(errstr); + free(*errstr); nsc->sasl_proto_cb(NETSEC_SASL_WRITE, NULL, 0, NULL, 0, NULL); rc = nsc->sasl_proto_cb(NETSEC_SASL_FINISH, NULL, 0, NULL, 0, errstr); diff --git a/test/oauth/common.sh b/test/oauth/common.sh index ab0bad53..932c7051 100644 --- a/test/oauth/common.sh +++ b/test/oauth/common.sh @@ -131,7 +131,7 @@ expect_creds() { } test_inc() { - run_test "inc -host 127.0.0.1 -port ${pop_port} -saslmech xoauth2 -authservice test -user nobody@example.com -width 80" "$@" + run_test "inc -host 127.0.0.1 -port ${pop_port} -sasl -saslmech xoauth2 -authservice test -user nobody@example.com -width 80" "$@" } test_inc_success() { diff --git a/test/oauth/test-inc b/test/oauth/test-inc index c7456928..96a2af04 100755 --- a/test/oauth/test-inc +++ b/test/oauth/test-inc @@ -77,6 +77,7 @@ Content-Type: application/json EOF start_fakehttp +start_pop_xoauth test_inc 'inc: error refreshing OAuth2 token inc: bad OAuth request; re-run with -snoop and send REDACTED output to nmh-workers' @@ -93,7 +94,7 @@ EOF start_pop_xoauth -test_inc 'inc: -ERR [AUTH] Invalid credentials.' +test_inc 'inc: Authentication failed: -ERR [AUTH] Invalid credentials.' # TEST start_test "pop server doesn't support oauth"