From: Sage Weil Date: Fri, 25 May 2018 01:40:48 +0000 (-0500) Subject: auth/cephx/CephxProtocol: better random X-Git-Tag: v14.0.1~913^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=721d7e622bb4b301f0a69a6e236d25c49bd621ad;p=ceph.git auth/cephx/CephxProtocol: better random Signed-off-by: Sage Weil --- diff --git a/src/auth/cephx/CephxProtocol.cc b/src/auth/cephx/CephxProtocol.cc index b8a62dbb732..59254680635 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(); + cct->random()->get_bytes((char*)&a->nonce, sizeof(a->nonce)); __u8 authorizer_v = 1; encode(authorizer_v, a->bl);