Bug 952874 - Fix telemetry for RSA/DHE key sizes of 1025-1280 bits and fix misspelling. r=keeler, a=bajaj
authorBrian Smith <brian@briansmith.org>
Sat, 18 Jan 2014 17:59:24 -0800
changeset 175907 29256432e26d62ec66d7ba709d2aa568c34cd2b5
parent 175906 62d21984ab23664465dd0f834d93cc2bfa017572
child 175908 8a16fb683b1bbce09ae506aac1e69b74ad538525
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskeeler, bajaj
bugs952874
milestone28.0a2
Bug 952874 - Fix telemetry for RSA/DHE key sizes of 1025-1280 bits and fix misspelling. r=keeler, a=bajaj
security/manager/ssl/src/nsNSSCallbacks.cpp
--- a/security/manager/ssl/src/nsNSSCallbacks.cpp
+++ b/security/manager/ssl/src/nsNSSCallbacks.cpp
@@ -1038,17 +1038,17 @@ CanFalseStartCallback(PRFileDesc* fd, vo
 }
 
 static void
 AccumulateNonECCKeySize(Telemetry::ID probe, uint32_t bits)
 {
   unsigned int value = bits <   512 ?  1 : bits ==   512 ?  2
                      : bits <   768 ?  3 : bits ==   768 ?  4
                      : bits <  1024 ?  5 : bits ==  1024 ?  6
-                     : bits <  1024 ?  7 : bits ==  1024 ?  8
+                     : bits <  1280 ?  7 : bits ==  1280 ?  8
                      : bits <  1536 ?  9 : bits ==  1536 ? 10
                      : bits <  2048 ? 11 : bits ==  2048 ? 12
                      : bits <  3072 ? 13 : bits ==  3072 ? 14
                      : bits <  4096 ? 15 : bits ==  4096 ? 16
                      : bits <  8192 ? 17 : bits ==  8192 ? 18
                      : bits < 16384 ? 19 : bits == 16384 ? 20
                      : 0;
   Telemetry::Accumulate(probe, value);
@@ -1056,17 +1056,17 @@ AccumulateNonECCKeySize(Telemetry::ID pr
 
 // XXX: This attempts to map a bit count to an ECC named curve identifier. In
 // the vast majority of situations, we only have the Suite B curves available.
 // In that case, this mapping works fine. If we were to have more curves
 // available, the mapping would be ambiguous since there could be multiple
 // named curves for a given size (e.g. secp256k1 vs. secp256r1). We punt on
 // that for now. See also NSS bug 323674.
 static void
-AccummulateECCCurve(Telemetry::ID probe, uint32_t bits)
+AccumulateECCCurve(Telemetry::ID probe, uint32_t bits)
 {
   unsigned int value = bits == 256 ? 23 // P-256
                      : bits == 384 ? 24 // P-384
                      : bits == 521 ? 25 // P-521
                      : 0; // Unknown
   Telemetry::Accumulate(probe, value);
 }
 
@@ -1262,18 +1262,18 @@ void HandshakeCallback(PRFileDesc* fd, v
             AccumulateNonECCKeySize(Telemetry::SSL_KEA_RSA_KEY_SIZE_FULL,
                                     channelInfo.keaKeyBits);
             break;
           case ssl_kea_dh:
             AccumulateNonECCKeySize(Telemetry::SSL_KEA_DHE_KEY_SIZE_FULL,
                                     channelInfo.keaKeyBits);
             break;
           case ssl_kea_ecdh:
-            AccummulateECCCurve(Telemetry::SSL_KEA_ECDHE_CURVE_FULL,
-                                channelInfo.keaKeyBits);
+            AccumulateECCCurve(Telemetry::SSL_KEA_ECDHE_CURVE_FULL,
+                               channelInfo.keaKeyBits);
             break;
           default:
             MOZ_CRASH("impossible KEA");
             break;
         }
 
         Telemetry::Accumulate(Telemetry::SSL_AUTH_ALGORITHM_FULL,
                               cipherInfo.authAlgorithm);
@@ -1285,18 +1285,18 @@ void HandshakeCallback(PRFileDesc* fd, v
               AccumulateNonECCKeySize(Telemetry::SSL_AUTH_RSA_KEY_SIZE_FULL,
                                       channelInfo.authKeyBits);
               break;
             case ssl_auth_dsa:
               AccumulateNonECCKeySize(Telemetry::SSL_AUTH_DSA_KEY_SIZE_FULL,
                                       channelInfo.authKeyBits);
               break;
             case ssl_auth_ecdsa:
-              AccummulateECCCurve(Telemetry::SSL_AUTH_ECDSA_CURVE_FULL,
-                                  channelInfo.authKeyBits);
+              AccumulateECCCurve(Telemetry::SSL_AUTH_ECDSA_CURVE_FULL,
+                                 channelInfo.authKeyBits);
               break;
             default:
               MOZ_CRASH("impossible auth algorithm");
               break;
           }
         }
       }