]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Rename fnv1a_hash() to ossl_fnv1a_hash()
authorTomas Mraz <tomas@openssl.org>
Mon, 24 Feb 2025 08:47:13 +0000 (09:47 +0100)
committerTomas Mraz <tomas@openssl.org>
Tue, 25 Feb 2025 14:45:42 +0000 (15:45 +0100)
It is no longer static.

Also add it to libssl only with quic enabled.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26882)

crypto/hashtable/hashfunc.c
crypto/hashtable/hashtable.c
include/internal/hashfunc.h
ssl/build.info
ssl/quic/quic_impl.c

index 9f3226c9ea78e33b28f1657f0f7fb09f7791afa1..eb2d027b6f2657819f576c8cddfc468ad287f3e3 100644 (file)
@@ -10,7 +10,7 @@
 
 #include "internal/hashfunc.h"
 
-ossl_unused uint64_t fnv1a_hash(uint8_t *key, size_t len)
+ossl_unused uint64_t ossl_fnv1a_hash(uint8_t *key, size_t len)
 {
     uint64_t hash = 0xcbf29ce484222325ULL;
     size_t i;
index 9203a2809229a9a7abaed7ca72c7429a773536df..f69d1e496219287b436b0c754f89fc5e18cbe840 100644 (file)
@@ -218,7 +218,7 @@ HT *ossl_ht_new(const HT_CONFIG *conf)
         goto err;
 
     if (new->config.ht_hash_fn == NULL)
-        new->config.ht_hash_fn = fnv1a_hash;
+        new->config.ht_hash_fn = ossl_fnv1a_hash;
 
     return new;
 
index 2423fc81bcd2f657802e8b23a468f6ea6f5ae430..cabc7beed4a78cb631e617da0091627dec983220 100644 (file)
@@ -14,6 +14,6 @@
 /**
  * Generalized fnv1a 64 bit hash function
  */
-ossl_unused uint64_t fnv1a_hash(uint8_t *key, size_t len);
+ossl_unused uint64_t ossl_fnv1a_hash(uint8_t *key, size_t len);
 
 #endif
index ab458c736cc6e298482c28094805984ea1de23b7..a5b5d17a2641359db7f42549a237a67756e99c34 100644 (file)
@@ -21,8 +21,7 @@ SOURCE[../libssl]=\
 # For shared builds we need to include the libcrypto packet.c and quic_vlint.c
 # in libssl as well.
 SHARED_SOURCE[../libssl]=\
-        ../crypto/packet.c ../crypto/quic_vlint.c ../crypto/time.c \
-        ../crypto/hashtable/hashfunc.c
+        ../crypto/packet.c ../crypto/quic_vlint.c ../crypto/time.c
 
 IF[{- !$disabled{'deprecated-3.0'} -}]
   SOURCE[../libssl]=ssl_rsa_legacy.c
@@ -30,6 +29,7 @@ ENDIF
 
 IF[{- !$disabled{quic} -}]
   SOURCE[../libssl]=priority_queue.c
+  SHARED_SOURCE[../libssl] = ../crypto/hashtable/hashfunc.c
   IF[{- $disabled{siphash} -}]
     SOURCE[../libssl]=../crypto/siphash/siphash.c
   ELSE
index c00cc7305cdadadce3158430337005de3085a8e5..3bf8b357bd7d02e0eb5582c6f48fc048a269bb6d 100644 (file)
@@ -4657,7 +4657,7 @@ struct ssl_token_store_st {
 
 static unsigned long quic_token_hash(const QUIC_TOKEN *item)
 {
-    return (unsigned long)fnv1a_hash(item->hashkey, item->hashkey_len);
+    return (unsigned long)ossl_fnv1a_hash(item->hashkey, item->hashkey_len);
 }
 
 static int quic_token_cmp(const QUIC_TOKEN *a, const QUIC_TOKEN *b)