From: Dan Mick Date: Thu, 3 Apr 2014 20:59:59 +0000 (-0700) Subject: Fix byte-order dependency in calculation of initial challenge X-Git-Tag: v0.67.8~20 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1dd42e0f75fe1f5363f92bd5a4506812e54b8fb5;p=ceph.git Fix byte-order dependency in calculation of initial challenge Fixes: #7977 Signed-off-by: Dan Mick Reviewed-by: Sage Weil (cherry picked from commit 4dc62669ecd679bc4d0ef2b996b2f0b45b8b4dc7) --- diff --git a/src/auth/cephx/CephxProtocol.cc b/src/auth/cephx/CephxProtocol.cc index 5c17dea712a..6956f453fb7 100644 --- a/src/auth/cephx/CephxProtocol.cc +++ b/src/auth/cephx/CephxProtocol.cc @@ -39,7 +39,7 @@ void cephx_calc_client_server_challenge(CephContext *cct, CryptoKey& secret, uin uint64_t k = 0; const uint64_t *p = (const uint64_t *)enc.c_str(); for (int pos = 0; pos + sizeof(k) <= enc.length(); pos+=sizeof(k), p++) - k ^= *p; + k ^= mswab64(*p); *key = k; }