summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Buehler <tb@openbsd.org>2025-12-05 13:14:45 +0100
committergit <svn-admin@ruby-lang.org>2025-12-06 16:50:16 +0000
commit9dfb7bd7d44ac99bc4d7233cef00e0e6e0743905 (patch)
tree234716ae50043f9b66523262ef685575132afd77
parent2e828dd98feeec5bab5ea85f0661638524004a01 (diff)
[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
-rw-r--r--ext/openssl/ossl.c2
-rw-r--r--ext/openssl/ossl.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c
index a19ff23b10..5fd6bff98b 100644
--- a/ext/openssl/ossl.c
+++ b/ext/openssl/ossl.c
@@ -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;
diff --git a/ext/openssl/ossl.h b/ext/openssl/ossl.h
index 93deafb4b6..0b479a7200 100644
--- a/ext/openssl/ossl.h
+++ b/ext/openssl/ossl.h
@@ -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