]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/dpdk: use ceph::crypto::MD5 instead of cryptopp
authorCasey Bodley <cbodley@redhat.com>
Mon, 20 Aug 2018 15:28:54 +0000 (11:28 -0400)
committerKefu Chai <kchai@redhat.com>
Wed, 5 Sep 2018 05:53:57 +0000 (13:53 +0800)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/msg/async/dpdk/TCP.h

index 9445dbce536de441541b7bd2321ee323931c627d..8005e783c2a62fc3a3b78fbf69030e71d3912fe0 100644 (file)
 #include <stdexcept>
 #include <system_error>
 
-#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1
-#include <cryptopp/md5.h>
-
 #include "msg/async/dpdk/EventDPDK.h"
 
 #include "include/utime.h"
 #include "common/Throttle.h"
 #include "common/ceph_time.h"
+#include "common/ceph_crypto.h"
 #include "msg/async/Event.h"
 #include "IPChecksum.h"
 #include "IP.h"
@@ -1441,7 +1439,9 @@ tcp_sequence tcp<InetTraits>::tcb::get_isn() {
   hash[1] = _foreign_ip.ip;
   hash[2] = (_local_port << 16) + _foreign_port;
   hash[3] = _isn_secret.key[15];
-  CryptoPP::Weak::MD5::Transform(hash, _isn_secret.key);
+  ceph::crypto::MD5 md5;
+  md5.Update((const unsigned char*)_isn_secret.key, sizeof(_isn_secret.key));
+  md5.Final((unsigned char*)hash);
   auto seq = hash[0];
   auto m = duration_cast<microseconds>(clock_type::now().time_since_epoch());
   seq += m.count() / 4;