]> git-server-git.apps.pok.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:41:03 +0000 (20:41 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 721d7e622bb4b301f0a69a6e236d25c49bd621ad)

src/auth/cephx/CephxProtocol.cc

index 7142a99900e4cbfe119c8d38c63dbda68b5e0f60..286d5336c0dafa795a3faf5416e037e99413e48f 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);