Follow up to bug 5209 and rev 34115:
authorJeff Morriss <jeff.morriss@ulticom.com>
Wed, 15 Sep 2010 14:10:25 +0000 (14:10 -0000)
committerJeff Morriss <jeff.morriss@ulticom.com>
Wed, 15 Sep 2010 14:10:25 +0000 (14:10 -0000)
%hh is C99 so remove it from packet-ssl-utils and add it to the banned list
(similar to %ll) in checkAPIs.pl .

svn path=/trunk/; revision=34120

epan/dissectors/packet-ssl-utils.c
tools/checkAPIs.pl

index 3cf2eb76c93e1fac434582273df7997ca2f172ac..d121738d4e5d500eb0adb609a609c07496d919bf 100644 (file)
@@ -311,10 +311,10 @@ const value_string ssl_20_cipher_suites[] = {
     { 0x00C039, "TLS_ECDHE_PSK_WITH_NULL_SHA" },
     { 0x00C03A, "TLS_ECDHE_PSK_WITH_NULL_SHA256" },
     { 0x00C03B, "TLS_ECDHE_PSK_WITH_NULL_SHA384" },
-       /*      0xC0,0x3C-FF Unassigned  
-               0xC1-FD,* Unassigned  
-               0xFE,0x00-FD Unassigned  
-               0xFE,0xFE-FF Reserved to avoid conflicts with widely deployed implementations [Pasi_Eronen] 
+       /*      0xC0,0x3C-FF Unassigned
+               0xC1-FD,* Unassigned
+               0xFE,0x00-FD Unassigned
+               0xFE,0xFE-FF Reserved to avoid conflicts with widely deployed implementations [Pasi_Eronen]
                0xFF,0x00-FF Reserved for Private Use [RFC5246]
                */
 
@@ -699,7 +699,7 @@ const value_string ssl_31_ciphersuite[] = {
     { 0x00C5, "TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256" },
        /* 0x00,0xC6-FE Unassigned  */
     /* From RFC 5746 */
-    { 0x0000FF, "TLS_EMPTY_RENEGOTIATION_INFO_SCSV" },  
+    { 0x0000FF, "TLS_EMPTY_RENEGOTIATION_INFO_SCSV" },
        /* 0x01-BF,* Unassigned */
     /* From RFC 4492 */
     { 0xc001, "TLS_ECDH_ECDSA_WITH_NULL_SHA" },
@@ -768,11 +768,11 @@ const value_string ssl_31_ciphersuite[] = {
     { 0xC03A, "TLS_ECDHE_PSK_WITH_NULL_SHA256" },
     { 0xC03B, "TLS_ECDHE_PSK_WITH_NULL_SHA384" },
 /*
-0xC0,0x3C-FF Unassigned  
-0xC1-FD,* Unassigned  
-0xFE,0x00-FD Unassigned  
-0xFE,0xFE-FF Reserved to avoid conflicts with widely deployed implementations [Pasi_Eronen] 
-0xFF,0x00-FF Reserved for Private Use [RFC5246] 
+0xC0,0x3C-FF Unassigned
+0xC1-FD,* Unassigned
+0xFE,0x00-FD Unassigned
+0xFE,0xFE-FF Reserved to avoid conflicts with widely deployed implementations [Pasi_Eronen]
+0xFF,0x00-FF Reserved for Private Use [RFC5246]
 */
     /* these from http://www.mozilla.org/projects/
          security/pki/nss/ssl/fips-ssl-ciphersuites.html */
@@ -3182,7 +3182,13 @@ ssl_parse_key_list(const gchar * keys_list, GHashTable *key_hash, GTree* associa
             ip[2] = 0;
             ip[3] = 0;
         } else {
-            sscanf(addr, "%hhu.%hhu.%hhu.%hhu", &ip[0], &ip[1], &ip[2], &ip[3]);
+           guint tmp0, tmp1, tmp2, tmp3;
+
+            sscanf(addr, "%u.%u.%u.%u", &tmp0, &tmp1, &tmp2, &tmp3);
+           ip[0] = (guchar)tmp0;
+           ip[1] = (guchar)tmp1;
+           ip[2] = (guchar)tmp2;
+           ip[3] = (guchar)tmp3;
         }
 
         if(!strcmp("start_tls", port)) {
@@ -3190,7 +3196,7 @@ ssl_parse_key_list(const gchar * keys_list, GHashTable *key_hash, GTree* associa
         } else {
             service->port = atoi(port);
         }
-        ssl_debug_printf("ssl_init addr '%hhu.%hhu.%hhu.%hhu' port '%d' filename '%s' password(only for p12 file) '%s'\n",
+        ssl_debug_printf("ssl_init addr '%u.%u.%u.%u' port '%d' filename '%s' password(only for p12 file) '%s'\n",
                          ip[0], ip[1], ip[2], ip[3], service->port, filename, cert_passwd);
 
         /* try to load pen or p12 file*/
index 284a1fece1f4e3f6baaaff191f6363cbfdbf83f9..8fa4daee3ae98b8022f98eb707c4132d2093698c 100755 (executable)
@@ -1055,6 +1055,14 @@ while ($_ = $ARGV[0])
                 print STDERR "Error: Found %ll in " .$filename."\n";
                 $errorCount++;
         }
+        if ($fileContents =~ m{ %hh }xo)
+        {
+                # %hh is C99 and Windows doesn't like it:
+               # http://connect.microsoft.com/VisualStudio/feedback/details/416843/sscanf-cannot-not-handle-hhd-format
+               # Need to use temporary variables instead.
+                print STDERR "Error: Found %hh in " .$filename."\n";
+                $errorCount++;
+       }
 
         if (! ($fileContents =~ m{ \$Id .* \$ }xo))
         {