From: Richard Levitte Date: Tue, 25 Nov 2025 10:26:20 +0000 (+0100) Subject: OSSL_FN: constify some of the internal construction and introspection functions X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=235116c33eb6c9028dc9feeecea71b2f94e4e3a8;p=thirdparty%2Fopenssl.git OSSL_FN: constify some of the internal construction and introspection functions This should have been done when they were added. Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/29203) --- diff --git a/crypto/fn/fn_intern.c b/crypto/fn/fn_intern.c index 3aa3afb3f1b..6113ccd215d 100644 --- a/crypto/fn/fn_intern.c +++ b/crypto/fn/fn_intern.c @@ -30,7 +30,7 @@ int ossl_fn_set_words(OSSL_FN *f, const OSSL_FN_ULONG *words, size_t limbs) return 1; } -const OSSL_FN_ULONG *ossl_fn_get_words(OSSL_FN *f) +const OSSL_FN_ULONG *ossl_fn_get_words(const OSSL_FN *f) { if (ossl_unlikely(f == NULL)) { ERR_raise(ERR_LIB_OSSL_FN, ERR_R_PASSED_NULL_PARAMETER); @@ -40,17 +40,17 @@ const OSSL_FN_ULONG *ossl_fn_get_words(OSSL_FN *f) return f->d; } -size_t ossl_fn_get_dsize(OSSL_FN *f) +size_t ossl_fn_get_dsize(const OSSL_FN *f) { return f->dsize; } -bool ossl_fn_is_dynamically_allocated(OSSL_FN *f) +bool ossl_fn_is_dynamically_allocated(const OSSL_FN *f) { return f->is_dynamically_allocated; } -bool ossl_fn_is_securely_allocated(OSSL_FN *f) +bool ossl_fn_is_securely_allocated(const OSSL_FN *f) { return f->is_securely_allocated; } diff --git a/include/crypto/fn_intern.h b/include/crypto/fn_intern.h index df35a0a5dc3..46b5be70773 100644 --- a/include/crypto/fn_intern.h +++ b/include/crypto/fn_intern.h @@ -36,15 +36,15 @@ extern "C" { #endif int ossl_fn_set_words(OSSL_FN *f, const OSSL_FN_ULONG *words, size_t limbs); -const OSSL_FN_ULONG *ossl_fn_get_words(OSSL_FN *f); +const OSSL_FN_ULONG *ossl_fn_get_words(const OSSL_FN *f); -size_t ossl_fn_get_dsize(OSSL_FN *f); +size_t ossl_fn_get_dsize(const OSSL_FN *f); void ossl_fn_set_negative(OSSL_FN *f, bool neg); -bool ossl_fn_is_negative(OSSL_FN *f); -bool ossl_fn_is_dynamically_allocated(OSSL_FN *f); -bool ossl_fn_is_securely_allocated(OSSL_FN *f); +bool ossl_fn_is_negative(const OSSL_FN *f); +bool ossl_fn_is_dynamically_allocated(const OSSL_FN *f); +bool ossl_fn_is_securely_allocated(const OSSL_FN *f); #ifdef __cplusplus }