MCPcopy Create free account
hub / github.com/AGWA/git-crypt / random_bytes

Function random_bytes

crypto-openssl-11.cpp:104–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102
103
104void random_bytes (unsigned char* buffer, size_t len)
105{
106 if (RAND_bytes(buffer, len) != 1) {
107 std::ostringstream message;
108 while (unsigned long code = ERR_get_error()) {
109 char error_string[120];
110 ERR_error_string_n(code, error_string, sizeof(error_string));
111 message << "OpenSSL Error: " << error_string << "; ";
112 }
113 throw Crypto_error("random_bytes", message.str());
114 }
115}

Callers 1

generateMethod · 0.85

Calls 1

Crypto_errorClass · 0.85

Tested by

no test coverage detected