[ruby/openssl] const correct ossl_bin2hex()

This helper only reads from its in parameter. Making that const
avoids a couple of casts in an upcoming change.

https://github.com/ruby/openssl/commit/970d5764e3
This commit is contained in:
Theo Buehler 2025-12-05 13:14:45 +01:00 committed by git
parent 2e828dd98f
commit 9dfb7bd7d4
2 changed files with 2 additions and 2 deletions

View File

@ -122,7 +122,7 @@ ossl_buf2str(char *buf, int len)
}
void
ossl_bin2hex(unsigned char *in, char *out, size_t inlen)
ossl_bin2hex(const unsigned char *in, char *out, size_t inlen)
{
const char *hex = "0123456789abcdef";
size_t i;

View File

@ -131,7 +131,7 @@ do{\
* Convert binary string to hex string. The caller is responsible for
* ensuring out has (2 * len) bytes of capacity.
*/
void ossl_bin2hex(unsigned char *in, char *out, size_t len);
void ossl_bin2hex(const unsigned char *in, char *out, size_t len);
/*
* Our default PEM callback