From 9dfb7bd7d44ac99bc4d7233cef00e0e6e0743905 Mon Sep 17 00:00:00 2001 From: Theo Buehler Date: Fri, 5 Dec 2025 13:14:45 +0100 Subject: [PATCH] [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 --- ext/openssl/ossl.c | 2 +- ext/openssl/ossl.h | 2 +- 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