Page MenuHomeFreeBSD

openssh: undef EVP_CIPHER_CTX_get_iv prior to defining it
AbandonedPublic

Authored by jlduran on Mar 26 2025, 8:43 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 8, 9:14 PM
Unknown Object (File)
Thu, Oct 2, 10:49 AM
Unknown Object (File)
Thu, Oct 2, 5:42 AM
Unknown Object (File)
Wed, Oct 1, 3:32 AM
Unknown Object (File)
Wed, Sep 17, 6:36 AM
Unknown Object (File)
Sep 13 2025, 8:13 AM
Unknown Object (File)
Sep 12 2025, 4:32 AM
Unknown Object (File)
Sep 10 2025, 4:46 AM
Subscribers

Details

Reviewers
emaste
kevans
Summary

The script freebsd-namespace.sh does namespace munging, by adding the Fssh_ prefix to every symbol in libssh, to prevent collisions with other libraries that link with it.
Upstream OpenSSH commit:
324449a68 ("support OpenSSL 3.x cipher IV API change")
Defines EVP_CIPHER_CTX_get_iv as EVP_CIPHER_CTX_get_updated_iv (if HAVE_EVP_CIPHER_CTX_GET_UPDATED_IV is set in config.h).

This produces a compilation warning about the macro being redefined:

In file included from /usr/src/crypto/openssh/monitor.c:64:
/usr/src/crypto/openssh/openbsd-compat/openssl-compat.h:69:11: warning: 'EVP_CIPHER_CTX_get_iv' macro redefined [-Wmacro-redefined]
   69 | #  define EVP_CIPHER_CTX_get_iv EVP_CIPHER_CTX_get_updated_iv
      |           ^
/usr/src/crypto/openssh/ssh_namespace.h:12:9: note: previous definition is here
   12 | #define EVP_CIPHER_CTX_get_iv                   Fssh_EVP_CIPHER_CTX_get_iv
      |         ^

Avoid the warning by un-defining it before defining it, as done in ee8c73cd0620 ("Silence warnings about redefined macros."), appending the same comment from crypto/openssh/umac128.c for easy grepping.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 63134
Build 60018: arc lint + arc unit

Event Timeline

jlduran retitled this revision from openssh: undef EVP_CIPHER_CTX_get_iv to openssh: undef EVP_CIPHER_CTX_get_iv prior to defining it.Apr 12 2025, 6:39 PM
jlduran edited the summary of this revision. (Show Details)

Abandoned. Work will continue on D51810.