From e639a9323b8f2f0400aab86530c79ee875dd8417 Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Wed, 2 Mar 2011 09:11:15 -0800 Subject: [PATCH] auth: Removed unused function generate_random_string. It doesn't sound like a good idea in the first place, with embedded zero bytes terminating the string prematurely. Signed-off-by: Tommi Virtanen --- src/auth/Crypto.cc | 8 -------- src/auth/Crypto.h | 1 - 2 files changed, 9 deletions(-) diff --git a/src/auth/Crypto.cc b/src/auth/Crypto.cc index 1bca73d32e944..7b2c3abcfa2ba 100644 --- a/src/auth/Crypto.cc +++ b/src/auth/Crypto.cc @@ -48,14 +48,6 @@ static int get_random_bytes(int len, bufferlist& bl) return 0; } -void generate_random_string(string& s, int len) -{ - char buf[len+1]; - get_random_bytes(buf, len); - buf[len] = 0; - s = buf; -} - // --------------------------------------------------- class CryptoNone : public CryptoHandler { diff --git a/src/auth/Crypto.h b/src/auth/Crypto.h index 782f3bb0a1c05..565974be9e351 100644 --- a/src/auth/Crypto.h +++ b/src/auth/Crypto.h @@ -106,7 +106,6 @@ public: extern CryptoManager ceph_crypto_mgr; extern int get_random_bytes(char *buf, int len); -extern void generate_random_string(string& s, int len); #endif -- 2.39.5