From 1dd42e0f75fe1f5363f92bd5a4506812e54b8fb5 Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Thu, 3 Apr 2014 13:59:59 -0700 Subject: [PATCH] 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) --- src/auth/cephx/CephxProtocol.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/auth/cephx/CephxProtocol.cc b/src/auth/cephx/CephxProtocol.cc index 5c17dea712ac2..6956f453fb747 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; } -- 2.39.5