| 12 | UtilityImpl::~UtilityImpl() {} |
| 13 | |
| 14 | void 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 | |
| 29 | void UtilityImpl::hmac(void* out, const void* in, size_t size, const std::string& password) const |
| 30 | { |
no outgoing calls
no test coverage detected