From 69f70038171862daedcbbccf0eaba3d1f8d885f5 Mon Sep 17 00:00:00 2001 From: Kaleb KEITHLEY Date: Tue, 27 Mar 2012 11:14:23 -0400 Subject: Replace GPLV3 MD5 with OpenSSL MD5 Ric asked me to look at replacing the GPL licensed MD5 code with something better, i.e. perhaps faster, and with a less restrictive license, etc. So I took a couple hour holiday from working on wrapping up the client_t and did this. OpenSSL (nee SSLeay) is released under the OpenSSL license, a BSD/MIT style license. OpenSSL (libcrypto.so) is used on Linux, OS X and *BSD, Open Solaris, etc. IOW it's universally available on the platforms we care about. It's written by Eric Young (eay), now at EMC/RSA, and I can say from experience that the OpenSSL implementation of MD5 (at least) is every bit as fast as RSA's proprietary implementation (primarily because the implementations are very, very similar.) The last time I surveyed MD5 implementations I found they're all pretty much the same speed. I changed the APIs (and ABIs) for the strong and weak checksums. Strictly speaking I didn't need to do that. They're only called on short strings of data, i.e. pathnames, so using int32_t and uint32_t is ostensibly okay. My change is arguably a better, more general API for this sort of thing. It's also what bit me when gerrit/jenkins validation failed due to glusterfs segv-ing. (I didn't pay close enough attention to the implementation of the weak checksum. But it forced me to learn what gerrit/jenkins are doing and going forward I can do better testing before submitting to gerrit.) Now resubmitting with a BZ Change-Id: I545fade1604e74fc68399894550229bd57a5e0df BUG: 807718 Signed-off-by: Kaleb KEITHLEY Reviewed-on: http://review.gluster.com/3019 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy --- libglusterfs/src/call-stub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libglusterfs/src/call-stub.c') diff --git a/libglusterfs/src/call-stub.c b/libglusterfs/src/call-stub.c index 01e919d69..308a9ad1f 100644 --- a/libglusterfs/src/call-stub.c +++ b/libglusterfs/src/call-stub.c @@ -22,9 +22,9 @@ #include "config.h" #endif +#include #include -#include "md5.h" #include "call-stub.h" #include "mem-types.h" @@ -2124,7 +2124,7 @@ fop_rchecksum_cbk_stub (call_frame_t *frame, weak_checksum; stub->args.rchecksum_cbk.strong_checksum = - memdup (strong_checksum, MD5_DIGEST_LEN); + memdup (strong_checksum, MD5_DIGEST_LENGTH); } if (xdata) stub->xdata = dict_ref (xdata); -- cgit