]> diplodocus.org Git - nmh/commitdiff
Merge branch 'pop-tls' of git.sv.gnu.org:/srv/git/nmh into pop-tls
authorKen Hornstein <kenh@pobox.com>
Thu, 22 Sep 2016 03:33:29 +0000 (23:33 -0400)
committerKen Hornstein <kenh@pobox.com>
Thu, 22 Sep 2016 03:33:29 +0000 (23:33 -0400)
sbr/netsec.c
test/oauth/common.sh
test/oauth/test-inc

index 0333bf20f0ed317986955af1afd012e9f4bf49be..9fc6f46513b9b48abf22ecdf2f809a48514e42aa 100644 (file)
@@ -288,6 +288,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;
 
@@ -804,7 +805,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); 
@@ -1100,7 +1101,6 @@ netsec_negotiate_sasl(netsec_context *nsc, const char *mechlist, char **errstr)
 
        i = (str[i] == NULL);
 
-       free(str);
        free(mlist);
 
        if (i) {
@@ -1157,7 +1157,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);
index ab0bad5373c0e9aa39583145004afc2d8c8f9b05..932c705144e26e94bf1eacf50e39ab4998ec20f7 100644 (file)
@@ -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() {
index c745692892018d78fd2a541295871c5d7a31bca3..96a2af04ede8441c83fdacc394ce5a05204e0c3c 100755 (executable)
@@ -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"