Backout changesets af1b36497559 and 1d52ab626597 (bug 1189891) for pkix bustage
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 21 Aug 2015 15:05:32 +0900
changeset 291413 eaa9d14c60afa665387eaf33c2df44ebe23da996
parent 291412 590916330ceea9bcc144f80450814efeb7628486
child 291414 c5afa29ea85a8853e68f5a7a7baa1654f23d4cdc
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1189891
milestone43.0a1
backs outaf1b36497559922286709420122075bee68870a1
1d52ab626597cd4e4364c84e06fdf661e7b5fe28
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
Backout changesets af1b36497559 and 1d52ab626597 (bug 1189891) for pkix bustage
config/msvc-stl-wrapper.template.h
security/pkix/include/pkix/Input.h
security/pkix/test/lib/pkixtestutil.h
--- a/config/msvc-stl-wrapper.template.h
+++ b/config/msvc-stl-wrapper.template.h
@@ -3,19 +3,16 @@
  */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_${HEADER}_h
 #define mozilla_${HEADER}_h
 
-#ifndef MOZ_HAVE_INCLUDED_ALLOC
-#define MOZ_HAVE_INCLUDED_ALLOC
-
 #if _HAS_EXCEPTIONS
 #  error "STL code can only be used with -fno-exceptions"
 #endif
 
 // Code built with !_HAS_EXCEPTIONS calls std::_Throw(), but the win2k
 // CRT doesn't export std::_Throw().  So we define it.
 #ifndef mozilla_Throw_h
 #  include "mozilla/throw_msvc.h"
@@ -30,17 +27,16 @@
 // See if we're in code that can use mozalloc.  NB: this duplicates
 // code in nscore.h because nscore.h pulls in prtypes.h, and chromium
 // can't build with that being included before base/basictypes.h.
 #if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC)
 #  include "mozilla/mozalloc.h"
 #else
 #  error "STL code can only be used with infallible ::operator new()"
 #endif
-#endif /* MOZ_HAVE_INCLUDED_ALLOC */
 
 #ifdef _DEBUG
 // From
 //   http://msdn.microsoft.com/en-us/library/aa985982%28VS.80%29.aspx
 // and
 //   http://msdn.microsoft.com/en-us/library/aa985965%28VS.80%29.aspx
 // there appear to be two types of STL container checking.  The
 // former is enabled by -D_DEBUG (which is implied by -MDd or -MTd), and
--- a/security/pkix/include/pkix/Input.h
+++ b/security/pkix/include/pkix/Input.h
@@ -20,17 +20,17 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 #ifndef mozilla_pkix_Input_h
 #define mozilla_pkix_Input_h
 
-#include <algorithm>
+#include <cstring>
 
 #include "pkix/Result.h"
 #include "stdint.h"
 
 namespace mozilla { namespace pkix {
 
 class Reader;
 
@@ -128,17 +128,17 @@ private:
 
   void operator=(const Input&) = delete; // Use Init instead.
 };
 
 inline bool
 InputsAreEqual(const Input& a, const Input& b)
 {
   return a.GetLength() == b.GetLength() &&
-         !std::equal(a.UnsafeGetData(), a.UnsafeGetData() + a.GetLength(), b.UnsafeGetData());
+         !std::memcmp(a.UnsafeGetData(), b.UnsafeGetData(), a.GetLength());
 }
 
 // An Reader is a cursor/iterator through the contents of an Input, designed to
 // maximize safety during parsing while minimizing the performance cost of that
 // safety. In particular, all methods do strict bounds checking to ensure
 // buffer overflows are impossible, and they are all inline so that the
 // compiler can coalesce as many of those checks together as possible.
 //
@@ -200,33 +200,33 @@ public:
   bool MatchRest(const uint8_t (&toMatch)[N])
   {
     // Normally we use EnsureLength which compares (input + len < end), but
     // here we want to be sure that there is nothing following the matched
     // bytes
     if (static_cast<size_t>(end - input) != N) {
       return false;
     }
-    if (std::equal(input, end, toMatch)) {
+    if (memcmp(input, toMatch, N)) {
       return false;
     }
     input = end;
     return true;
   }
 
   bool MatchRest(Input toMatch)
   {
     // Normally we use EnsureLength which compares (input + len < end), but
     // here we want to be sure that there is nothing following the matched
     // bytes
     size_t remaining = static_cast<size_t>(end - input);
     if (toMatch.GetLength() != remaining) {
       return false;
     }
-    if (std::equal(input, end, toMatch.UnsafeGetData())) {
+    if (std::memcmp(input, toMatch.UnsafeGetData(), remaining)) {
       return false;
     }
     input = end;
     return true;
   }
 
   Result Skip(Input::size_type len)
   {
--- a/security/pkix/test/lib/pkixtestutil.h
+++ b/security/pkix/test/lib/pkixtestutil.h
@@ -23,17 +23,16 @@
  */
 
 #ifndef mozilla_pkix_test_pkixtestutils_h
 #define mozilla_pkix_test_pkixtestutils_h
 
 #include <ctime>
 #include <stdint.h> // Some Mozilla-supported compilers lack <cstdint>
 #include <string>
-#include <cstring>
 
 #include "pkix/pkixtypes.h"
 #include "../../lib/ScopedPtr.h"
 
 namespace mozilla { namespace pkix { namespace test {
 
 typedef std::basic_string<uint8_t> ByteString;