You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by sc...@apache.org on 2018/03/23 01:05:10 UTC

[trafficserver] branch master updated: Fix the compiler error with fips

This is an automated email from the ASF dual-hosted git repository.

scw00 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 53f730b  Fix the compiler error with fips
53f730b is described below

commit 53f730b18b6c4b7bba08d4d2eed7148425329b6c
Author: scw00 <sc...@apache.org>
AuthorDate: Sun Mar 18 10:40:55 2018 +0800

    Fix the compiler error with fips
---
 lib/ts/ink_code.cc   | 3 ++-
 tools/jtest/jtest.cc | 9 +++------
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/lib/ts/ink_code.cc b/lib/ts/ink_code.cc
index 11d16fa..82ae10b 100644
--- a/lib/ts/ink_code.cc
+++ b/lib/ts/ink_code.cc
@@ -24,11 +24,12 @@
 #include <cstring>
 #include <cstdio>
 #include "ts/ink_code.h"
-#include "ts/INK_MD5.h"
 #include "ts/ink_assert.h"
+#include "ts/CryptoHash.h"
 
 ats::CryptoHash const ats::CRYPTO_HASH_ZERO; // default constructed is correct.
 #if TS_ENABLE_FIPS == 0
+#include "ts/INK_MD5.h"
 
 MD5Context::MD5Context()
 {
diff --git a/tools/jtest/jtest.cc b/tools/jtest/jtest.cc
index 0422e4a..ceb9194 100644
--- a/tools/jtest/jtest.cc
+++ b/tools/jtest/jtest.cc
@@ -3443,10 +3443,6 @@ seen_it(char *url)
   if (!url_hash_entries) {
     return 0;
   }
-  union {
-    unsigned char md5[16];
-    uint64_t i[2];
-  } u;
   int l      = 0;
   char *para = strrchr(url, '#');
   if (para) {
@@ -3454,8 +3450,9 @@ seen_it(char *url)
   } else {
     l = strlen(url);
   }
-  ink_code_md5((unsigned char *)url, l, u.md5);
-  uint64_t x = u.i[0] + u.i[1];
+  CryptoHash hash;
+  CryptoContext().hash_immediate(hash, reinterpret_cast<void *>(url), l);
+  uint64_t x = hash.fold();
   if (uniq_urls->is_set(x)) {
     if (verbose) {
       printf("YES: seen it '%s'\n", url);

-- 
To stop receiving notification emails like this one, please contact
scw00@apache.org.