]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
auth/cephx/CephxProtocol: better random
authorSage Weil <sage@redhat.com>
Fri, 25 May 2018 01:40:48 +0000 (20:40 -0500)
committerSage Weil <sage@redhat.com>
Fri, 25 May 2018 01:40:48 +0000 (20:40 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/auth/cephx/CephxProtocol.cc

index b8a62dbb732cfb577f4978f86ce9c8db72604875..59254680635e121776c3ce2dcfd8dda1899e0d4a 100644 (file)
@@ -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);