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 <tommi.virtanen@dreamhost.com>
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 {
extern CryptoManager ceph_crypto_mgr;
extern int get_random_bytes(char *buf, int len);
-extern void generate_random_string(string& s, int len);
#endif