head 1.2; access; symbols pkgsrc-2026Q1:1.2.0.28 pkgsrc-2026Q1-base:1.2 pkgsrc-2025Q4:1.2.0.26 pkgsrc-2025Q4-base:1.2 pkgsrc-2025Q3:1.2.0.24 pkgsrc-2025Q3-base:1.2 pkgsrc-2025Q2:1.2.0.22 pkgsrc-2025Q2-base:1.2 pkgsrc-2025Q1:1.2.0.20 pkgsrc-2025Q1-base:1.2 pkgsrc-2024Q4:1.2.0.18 pkgsrc-2024Q4-base:1.2 pkgsrc-2024Q3:1.2.0.16 pkgsrc-2024Q3-base:1.2 pkgsrc-2024Q2:1.2.0.14 pkgsrc-2024Q2-base:1.2 pkgsrc-2024Q1:1.2.0.12 pkgsrc-2024Q1-base:1.2 pkgsrc-2023Q4:1.2.0.10 pkgsrc-2023Q4-base:1.2 pkgsrc-2023Q3:1.2.0.8 pkgsrc-2023Q3-base:1.2 pkgsrc-2023Q2:1.2.0.6 pkgsrc-2023Q2-base:1.2 pkgsrc-2023Q1:1.2.0.4 pkgsrc-2023Q1-base:1.2 pkgsrc-2022Q4:1.2.0.2 pkgsrc-2022Q4-base:1.2 pkgsrc-2022Q3:1.1.0.4 pkgsrc-2022Q3-base:1.1 pkgsrc-2022Q2:1.1.0.2 pkgsrc-2022Q2-base:1.1; locks; strict; comment @// @; 1.2 date 2022.12.19.17.39.40; author nros; state Exp; branches; next 1.1; commitid fnusJUhFcowS2c6E; 1.1 date 2022.04.01.08.01.12; author wiz; state Exp; branches; next ; commitid vzga9BJCrKezgtyD; desc @@ 1.2 log @botan2: fix build of os_utils.cpp on SunOS os_utils.cpp needs priv.h to be included on SunOS for the patch to build. Use Botans own BOTAN_TARGET_OS_IS_SOLARIS instead of __sun as indicator for building on SunOS. @ text @$NetBSD: patch-src_lib_utils_os__utils.cpp,v 1.1 2022/04/01 08:01:12 wiz Exp $ Add check for ability to do mlock() on SunOS. --- src/lib/utils/os_utils.cpp.orig 2022-11-16 11:19:19.000000000 +0000 +++ src/lib/utils/os_utils.cpp @@@@ -60,6 +60,10 @@@@ #include #endif +#if defined(BOTAN_TARGET_OS_IS_SOLARIS) +# include +#endif + namespace Botan { // Not defined in OS namespace for historical reasons @@@@ -326,7 +330,21 @@@@ size_t OS::system_page_size() size_t OS::get_memory_locking_limit() { -#if defined(BOTAN_TARGET_OS_HAS_POSIX1) && defined(BOTAN_TARGET_OS_HAS_POSIX_MLOCK) && defined(RLIMIT_MEMLOCK) +#if defined(BOTAN_TARGET_OS_IS_SOLARIS) + priv_set_t *priv_set = priv_allocset(); + if (priv_set == nullptr) + return 0; + bool can_mlock = false; + + if(getppriv(PRIV_EFFECTIVE, priv_set) == 0) + can_mlock = priv_ismember(priv_set, PRIV_PROC_LOCK_MEMORY); + + priv_freeset(priv_set); + + /* XXX how to obtain the real limit? */ + size_t mlock_requested = BOTAN_MLOCK_ALLOCATOR_MAX_LOCKED_KB; + return can_mlock ? std::min(512 * 1024, mlock_requested) : 0; +#elif defined(BOTAN_TARGET_OS_HAS_POSIX1) && defined(BOTAN_TARGET_OS_HAS_POSIX_MLOCK) && defined(RLIMIT_MEMLOCK) /* * If RLIMIT_MEMLOCK is not defined, likely the OS does not support * unprivileged mlock calls. @ 1.1 log @security/botan2: import botan-2.19.1 Reimported from security/botan-devel. Botan is a crypto library written in C++. It provides a variety of cryptographic algorithms, including common ones such as AES, MD5, SHA, HMAC, RSA, Diffie-Hellman, DSA, and ECDSA, as well as many others that are more obscure or specialized. It also offers X.509v3 certificates and CRLs, and PKCS #10 certificate requests. A message processing system that uses a filter/pipeline metaphor allows for many common cryptographic tasks to be completed with just a few lines of code. Assembly optimizations for common CPUs, including x86, x86-64, and PowerPC, offers further speedups for critical tasks such as SHA-1 hashing and multiple precision integer operations. This package contains major version 2 of the library. The version contains a much improved TLS infrastructure. It also depends on C++11. @ text @d1 1 a1 1 $NetBSD: patch-src_lib_utils_os__utils.cpp,v 1.7 2021/03/07 17:56:25 he Exp $ d5 1 a5 1 --- src/lib/utils/os_utils.cpp.orig 2019-07-15 18:14:39.932394200 +0000 d7 12 a18 1 @@@@ -325,7 +325,21 @@@@ size_t OS::system_page_size() d23 1 a23 1 +#if defined(__sun) @