From: Sage Weil Date: Fri, 25 May 2018 01:40:48 +0000 (-0500) Subject: auth/cephx/CephxProtocol: better random X-Git-Tag: v12.2.6~3^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b98db30e41bb623e2d03636aedabb6a5a59af596;p=ceph.git auth/cephx/CephxProtocol: better random Signed-off-by: Sage Weil (cherry picked from commit 721d7e622bb4b301f0a69a6e236d25c49bd621ad) - get_random_bytes(), not cct->random() --- diff --git a/src/auth/cephx/CephxProtocol.cc b/src/auth/cephx/CephxProtocol.cc index 98a0511eeb0c..cc5f44964c2a 100644 --- a/src/auth/cephx/CephxProtocol.cc +++ b/src/auth/cephx/CephxProtocol.cc @@ -296,7 +296,7 @@ CephXAuthorizer *CephXTicketHandler::build_authorizer(uint64_t global_id) const { CephXAuthorizer *a = new CephXAuthorizer(cct); a->session_key = session_key; - a->nonce = ((uint64_t)rand() << 32) + rand(); + get_random_bytes((char*)&a->nonce, sizeof(a->nonce)); __u8 authorizer_v = 1; ::encode(authorizer_v, a->bl);