MCPcopy Create free account
hub / github.com/apache/trafficserver / cryptoErrStr

Function cryptoErrStr

plugins/experimental/access_control/utils.cc:173–187  ·  view source on GitHub ↗

* @brief a helper function to get a human-readable error message in a buffer. * * @param buffer pointer to a char buffer * @param bufferLen - max buffer length (length should be >= 256) * @return buffer, filled with the error message (null-terminated) */

Source from the content-addressed store, hash-verified

171 * @return buffer, filled with the error message (null-terminated)
172 */
173static char *
174cryptoErrStr(char *buffer, size_t bufferLen)
175{
176 /* man ERR_error_string expects 256-byte buffer */
177 if (nullptr == buffer || 256 > bufferLen) {
178 return nullptr;
179 }
180 unsigned long err = ERR_get_error();
181 if (0 == err) {
182 buffer[0] = 0;
183 return buffer;
184 }
185 ERR_error_string_n(err, buffer, bufferLen);
186 return buffer;
187}
188
189/**
190 * @brief Calculate message digest

Callers 1

cryptoMessageDigestGetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected