From: Bob Beck Date: Tue, 28 Apr 2026 01:23:48 +0000 (-0600) Subject: Generate guarded bn_prime.h X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3b2632ffafc57010c11d04695e8f397d9d0bbce;p=thirdparty%2Fopenssl.git Generate guarded bn_prime.h Reviewed-by: Tomas Mraz Reviewed-by: Nikola Pajkovsky Reviewed-by: Norbert Pocs MergeDate: Wed May 6 11:36:00 2026 (Merged from https://github.com/openssl/openssl/pull/31001) --- diff --git a/crypto/bn/bn_prime.h b/crypto/bn/bn_prime.h index 8a859ac02e2..4038d99b6ab 100644 --- a/crypto/bn/bn_prime.h +++ b/crypto/bn/bn_prime.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by crypto/bn/bn_prime.pl * - * Copyright 1998-2021 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1998-2026 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -10,6 +10,10 @@ * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_BN_BN_PRIME_H) +#define OSSL_LIBCRYPTO_BN_BN_PRIME_H + +/* clang-format off */ typedef unsigned short prime_t; # define NUMPRIMES 2048 @@ -271,3 +275,6 @@ static const prime_t primes[2048] = { 17707, 17713, 17729, 17737, 17747, 17749, 17761, 17783, 17789, 17791, 17807, 17827, 17837, 17839, 17851, 17863, }; +/* clang-format on */ + +#endif /* !defined(OSSL_LIBCRYPTO_BN_BN_PRIME_H) */ diff --git a/crypto/bn/bn_prime.pl b/crypto/bn/bn_prime.pl index a7a764627b9..3d9722d0088 100644 --- a/crypto/bn/bn_prime.pl +++ b/crypto/bn/bn_prime.pl @@ -25,6 +25,10 @@ print <<"EOF"; * https://www.openssl.org/source/license.html */ +#if !defined(OSSL_LIBCRYPTO_BN_BN_PRIME_H) +#define OSSL_LIBCRYPTO_BN_BN_PRIME_H + +/* clang-format off */ EOF @@ -50,3 +54,5 @@ for (my $i = 0; $i <= $#primes; $i++) { printf " %5d,", $primes[$i]; } print "\n};\n"; +print "/* clang-format on */\n"; +print "\n#endif /* !defined(OSSL_LIBCRYPTO_BN_BN_PRIME_H) */\n"