Compiling usr.bin/pkg with OpenSSL 3 results in a host of -Wdeprecated-declaration errors. This doesn't seem to happen with newer versions of pkg from ports -- I'm guessing that there are some changes that need to be synced from the GH repo. Here are some example failures: ``` /usr/local/include/openssl/sha.h:76:1: note: 'SHA256_Final' has been explicitly marked deprecated here OSSL_DEPRECATEDIN_3_0 int SHA256_Final(unsigned char *md, SHA256_CTX *c); ^ /usr/local/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0' # define OSSL_DEPRECATEDIN_3_0 OSSL_DEPRECATED(3.0) ^ /usr/local/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED' # define OSSL_DEPRECATED(since) __attribute__((deprecated)) ^ /usr/src/usr.sbin/pkg/pkg.c:456:2: error: 'SHA256_Init' is deprecated [-Werror,-Wdeprecated-declarations] SHA256_Init(&sha256); ^ /usr/local/include/openssl/sha.h:73:1: note: 'SHA256_Init' has been explicitly marked deprecated here OSSL_DEPRECATEDIN_3_0 int SHA256_Init(SHA256_CTX *c); ^ /usr/local/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0' # define OSSL_DEPRECATEDIN_3_0 OSSL_DEPRECATED(3.0) ^ /usr/local/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED' # define OSSL_DEPRECATED(since) __attribute__((deprecated)) ^ /usr/src/usr.sbin/pkg/pkg.c:459:3: error: 'SHA256_Update' is deprecated [-Werror,-Wdeprecated-declarations] SHA256_Update(&sha256, buffer, r); ^ /usr/local/include/openssl/sha.h:74:1: note: 'SHA256_Update' has been explicitly marked deprecated here OSSL_DEPRECATEDIN_3_0 int SHA256_Update(SHA256_CTX *c, ^ /usr/local/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0' # define OSSL_DEPRECATEDIN_3_0 OSSL_DEPRECATED(3.0) ^ /usr/local/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED' # define OSSL_DEPRECATED(since) __attribute__((deprecated)) ^ /usr/src/usr.sbin/pkg/pkg.c:466:2: error: 'SHA256_Final' is deprecated [-Werror,-Wdeprecated-declarations] SHA256_Final(hash, &sha256); ^ /usr/local/include/openssl/sha.h:76:1: note: 'SHA256_Final' has been explicitly marked deprecated here OSSL_DEPRECATEDIN_3_0 int SHA256_Final(unsigned char *md, SHA256_CTX *c); ^ /usr/local/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0' # define OSSL_DEPRECATEDIN_3_0 OSSL_DEPRECATED(3.0) ^ /usr/local/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED' # define OSSL_DEPRECATED(since) __attribute__((deprecated)) ^ 6 errors generated. *** Error code 1 ```
For anyone else wondering: this issue is present in stable/13 and main.
pkg has close to 0 relationship to pkg in github.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=b2654064c2d11a1ee36667b3ff8b0f4d2536af74 commit b2654064c2d11a1ee36667b3ff8b0f4d2536af74 Author: Baptiste Daroussin <bapt@FreeBSD.org> AuthorDate: 2023-03-09 16:38:30 +0000 Commit: Baptiste Daroussin <bapt@FreeBSD.org> CommitDate: 2023-03-09 16:43:01 +0000 pkg(7): use libmd for sha256 instead of openssl OpenSSL 3.0 has deprecated the sha256 api, let's use libmd which has the same API instead. In order to avoid the collision in definitions (sha256.h cannot be included in the same file as a file where openssl headers has been included) let's move the sha256 related code in its own file PR: 270023 Reported by: ngie usr.sbin/pkg/Makefile | 4 +- usr.sbin/pkg/hash.c (new) | 112 ++++++++++++++++++++++++++++++++++++++++++++++ usr.sbin/pkg/hash.h (new) | 32 +++++++++++++ usr.sbin/pkg/pkg.c | 78 +------------------------------- 4 files changed, 147 insertions(+), 79 deletions(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=7bc2192380e10f3469ab4eda69ade324aae976cd commit 7bc2192380e10f3469ab4eda69ade324aae976cd Author: Baptiste Daroussin <bapt@FreeBSD.org> AuthorDate: 2023-03-09 16:38:30 +0000 Commit: Baptiste Daroussin <bapt@FreeBSD.org> CommitDate: 2023-05-19 08:16:51 +0000 pkg(7): use libmd for sha256 instead of openssl OpenSSL 3.0 has deprecated the sha256 api, let's use libmd which has the same API instead. In order to avoid the collision in definitions (sha256.h cannot be included in the same file as a file where openssl headers has been included) let's move the sha256 related code in its own file PR: 270023 Reported by: ngie (cherry picked from commit b2654064c2d11a1ee36667b3ff8b0f4d2536af74) usr.sbin/pkg/Makefile | 4 +- usr.sbin/pkg/hash.c (new) | 112 ++++++++++++++++++++++++++++++++++++++++++++++ usr.sbin/pkg/hash.h (new) | 32 +++++++++++++ usr.sbin/pkg/pkg.c | 78 +------------------------------- 4 files changed, 147 insertions(+), 79 deletions(-)