bug 908617, address review comments, r=wtc
authorKai Engert <kaie@kuix.de>
Fri, 23 Aug 2013 21:53:07 +0200
changeset 10844 82e7c0ea436407520e9da89f38a1e121167b862a
parent 10843 9f74c0a3e44d956a64335c98736b307965d3ae58
child 10845 78ad4e01463d89b174c36096b9306bd6313e24fd
push id150
push userkaie@kuix.de
push dateFri, 23 Aug 2013 19:53:13 +0000
reviewerswtc
bugs908617
bug 908617, address review comments, r=wtc
cmd/tstclnt/tstclnt.c
tests/ocsp/ocsp.sh
--- a/cmd/tstclnt/tstclnt.c
+++ b/cmd/tstclnt/tstclnt.c
@@ -232,16 +232,17 @@ static void PrintParameterUsage(void)
                     "%-20s 2: missing, old or invalid revocation data\n"
                     "%-20s 3: have fresh and valid revocation data, status revoked\n",
                     "-F", "", "", "", "", "", "", "", "", "");
     fprintf(stderr, "%-20s Test -F allows 0=any (default), 1=only OCSP, 2=only CRL\n", "-M");
     fprintf(stderr, "%-20s Restrict ciphers\n", "-c ciphers");
     fprintf(stderr, "%-20s Print cipher values allowed for parameter -c and exit\n", "-Y");
     fprintf(stderr, "%-20s Enforce using an IPv4 destination address\n", "-4");
     fprintf(stderr, "%-20s Enforce using an IPv6 destination address\n", "-6");
+    fprintf(stderr, "%-20s (Options -4 and -6 cannot be combined.)\n", "");
 }
 
 static void Usage(const char *progName)
 {
     PrintUsageHeader(progName);
     PrintParameterUsage();
     exit(1);
 }
@@ -988,25 +989,25 @@ int main(int argc, char **argv)
 	void       *enumPtr   = NULL;
 
 	addrInfo = PR_GetAddrInfoByName(host, PR_AF_UNSPEC, 
 	                                PR_AI_ADDRCONFIG | PR_AI_NOCANONNAME);
 	if (!addrInfo) {
 	    SECU_PrintError(progName, "error looking up host");
 	    return 1;
 	}
-	do {
+	for (;;) {
 	    enumPtr = PR_EnumerateAddrInfo(enumPtr, addrInfo, portno, &addr);
-	    if (enumPtr) {
-		if (addr.raw.family == PR_AF_INET && allowIPv4)
-		    break;
-		if (addr.raw.family == PR_AF_INET6 && allowIPv6)
-		    break;
-	    }
-	} while (enumPtr);
+	    if (enumPtr == NULL)
+		break;
+	    if (addr.raw.family == PR_AF_INET && allowIPv4)
+		break;
+	    if (addr.raw.family == PR_AF_INET6 && allowIPv6)
+		break;
+	}
 	PR_FreeAddrInfo(addrInfo);
 	if (enumPtr == NULL) {
 	    SECU_PrintError(progName, "error looking up host address");
 	    return 1;
 	}
     }
 
     printHostNameAndAddr(host, &addr);
--- a/tests/ocsp/ocsp.sh
+++ b/tests/ocsp/ocsp.sh
@@ -46,16 +46,19 @@ ocsp_init()
 
   REQF=${QADIR}/ssl/sslreq.dat
 
   cd ${CLIENTDIR}
 }
 
 ocsp_stapling()
 {
+  # Parameter -4 is used as a temporary workaround for lack of IPv6 connectivity
+  # on some build bot slaves.
+
   TESTNAME="startssl valid, supports OCSP stapling"
   echo "$SCRIPTNAME: $TESTNAME"
   echo "tstclnt -4 -V tls1.0: -T -v -F -M 1 -O -h kuix.de -p 5143 -d . < ${REQF}"
   ${BINDIR}/tstclnt -4 -V tls1.0: -T -v -F -M 1 -O -h kuix.de -p 5143 -d . < ${REQF}
   html_msg $? 0 "$TESTNAME"
 
   TESTNAME="startssl revoked, supports OCSP stapling"
   echo "$SCRIPTNAME: $TESTNAME"