bug 997843 - mozilla::pkix::der::Input::Expect should take a uint16_t as its length argument r=briansmith
authorDavid Keeler <dkeeler@mozilla.com>
Thu, 17 Apr 2014 09:50:06 -0700
changeset 179155 f854b5d978b59d65eb1b21f379b38338de5b270e
parent 179154 abda9ad7e8897c4cda4f5f3749cef767c348f26e
child 179156 2604efa5ae36d465301843fe9714863ede45dede
push id26607
push userryanvm@gmail.com
push dateFri, 18 Apr 2014 02:31:26 +0000
treeherdermozilla-central@7fe3ee0cf8be [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbriansmith
bugs997843
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 997843 - mozilla::pkix::der::Input::Expect should take a uint16_t as its length argument r=briansmith
security/pkix/lib/pkixder.h
--- a/security/pkix/lib/pkixder.h
+++ b/security/pkix/lib/pkixder.h
@@ -88,17 +88,17 @@ public:
     // XXX: this->input = input bug was not caught by tests! Why not?
     //      this->end = end bug was not caught by tests! Why not?
     this->input = data;
     this->end = data + len;
 
     return Success;
   }
 
-  Result Expect(const uint8_t* expected, size_t expectedLen)
+  Result Expect(const uint8_t* expected, uint16_t expectedLen)
   {
     if (EnsureLength(expectedLen) != Success) {
       return Fail(SEC_ERROR_BAD_DER);
     }
     if (memcmp(input, expected, expectedLen)) {
       return Fail(SEC_ERROR_BAD_DER);
     }
     input += expectedLen;
@@ -459,17 +459,17 @@ Integer(Input& input, /*out*/ SECItem& v
 }
 
 inline Result
 Null(Input& input)
 {
   return ExpectTagAndLength(input, NULLTag, 0);
 }
 
-template <size_t Len>
+template <uint16_t Len>
 Result
 OID(Input& input, const uint8_t (&expectedOid)[Len])
 {
   if (ExpectTagAndLength(input, OIDTag, Len) != Success) {
     return Failure;
   }
 
   return input.Expect(expectedOid, Len);