]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
OSSL_FN: constify some of the internal construction and introspection functions
authorRichard Levitte <levitte@openssl.org>
Tue, 25 Nov 2025 10:26:20 +0000 (11:26 +0100)
committerRichard Levitte <levitte@openssl.org>
Thu, 11 Dec 2025 09:35:46 +0000 (10:35 +0100)
This should have been done when they were added.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29203)

crypto/fn/fn_intern.c
include/crypto/fn_intern.h

index 3aa3afb3f1b56824078cf2cd7c1f48de0bec8ece..6113ccd215db75298aaafd5b1a5c789503959c65 100644 (file)
@@ -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;
 }
index df35a0a5dc35fa9dc67c38076218b852e2b9a512..46b5be70773c63fb5f85a6794dad1c3623126f08 100644 (file)
@@ -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
 }