MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / generate_random_bytes

Method generate_random_bytes

dds/DCPS/security/UtilityImpl.cpp:14–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12UtilityImpl::~UtilityImpl() {}
13
14void UtilityImpl::generate_random_bytes(void* ptr, size_t size)
15{
16 int rc = RAND_bytes(static_cast<unsigned char*>(ptr),
17 static_cast<int>(size));
18
19 if (rc != 1) {
20 unsigned long err = ERR_get_error();
21 char msg[256] = { 0 };
22 ERR_error_string_n(err, msg, sizeof(msg));
23 ACE_ERROR((LM_ERROR,
24 ACE_TEXT("(%P|%t) UtilityImpl::generate_random_bytes: ERROR '%C' returned by RAND_bytes(...)\n"),
25 msg));
26 }
27}
28
29void UtilityImpl::hmac(void* out, const void* in, size_t size, const std::string& password) const
30{

Callers 4

EndpointManagerMethod · 0.80
change_usernameMethod · 0.80
change_passwordMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected