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 167969 022a1f0ec3fd73b58d23dd894d96ab3c4aa60368
parent 167968 6d4df8edfaaa25d9d9cfb051a72a4ec5b7793ed4
child 167970 95fd8e21ee4947e727c978216fa62ded2918c5df
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskeeler, bajaj
bugs952874
milestone27.0
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
@@ -1025,17 +1025,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);
@@ -1043,17 +1043,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);
 }
 
@@ -1254,18 +1254,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);
@@ -1277,18 +1277,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;
           }
         }
       }