[SCM] transportation simulator branch, master, updated. debian/111.0-1-20-gbc5954f

Ansgar Burchardt ansgar at debian.org
Sun Apr 29 12:48:46 UTC 2012


The following commit has been merged in the master branch:
commit 505aff0187783533ba730781d16ce4993bd1bb2b
Author: Ansgar Burchardt <ansgar at debian.org>
Date:   Sun Apr 29 13:57:52 2012 +0200

    Fix Endianness issue with SHA1 replacement.
    
    Bug-Ubuntu: https://bugs.launchpad.net/bugs/931181

diff --git a/debian/patches/sha1-replacement.diff b/debian/patches/sha1-replacement.diff
index e17a315..09bf395 100644
--- a/debian/patches/sha1-replacement.diff
+++ b/debian/patches/sha1-replacement.diff
@@ -15,7 +15,7 @@ Subject: Provide replacement for non-free SHA-1 implementation
    CFLAGS += -mcrt=newlib -DUSE_C -DBIG_ENDIAN -gstabs+
 --- /dev/null
 +++ b/utils/sha1.cc
-@@ -0,0 +1,43 @@
+@@ -0,0 +1,54 @@
 +/*
 + * sha1.cc
 + *
@@ -25,6 +25,7 @@ Subject: Provide replacement for non-free SHA-1 implementation
 + */
 +
 +#include "sha1.h"
++#include "../simtypes.h"
 +#include <stdexcept>
 +
 +SHA1::SHA1()
@@ -46,7 +47,17 @@ Subject: Provide replacement for non-free SHA-1 implementation
 +
 +bool SHA1::Result(unsigned char *md_value)
 +{
-+  return EVP_DigestFinal_ex(&m_md_ctx, md_value, 0);
++  bool ret = EVP_DigestFinal_ex(&m_md_ctx, md_value, 0);
++
++#ifndef SIM_BIG_ENDIAN
++  uint32 *hash = reinterpret_cast<uint32*>(md_value);
++  for (size_t o = 0; o < 5; ++o) {
++    hash[o] = hash[o] << 16 | hash[o] >> 16;
++    hash[o] = (hash[o] << 8 & 0xff00ff00) | (hash[o] >> 8 & 0x00ff00ff);
++  }
++#endif
++
++  return ret;
 +}
 +
 +void SHA1::Input(const char *mess, unsigned int length)

-- 
transportation simulator



More information about the Pkg-games-commits mailing list