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
F168850225: D49516.diff
Sun, Aug 30, 11:00 AM
F168832866: D49516.id.diff
Sun, Aug 30, 9:03 AM
Unknown Object (File)
Tue, Aug 25, 12:08 PM
Unknown Object (File)
Tue, Aug 25, 11:36 AM
Unknown Object (File)
Sat, Aug 22, 11:48 PM
Unknown Object (File)
Wed, Aug 12, 6:01 PM
Unknown Object (File)
Wed, Aug 12, 12:10 AM
Unknown Object (File)
Mon, Aug 10, 12:55 PM
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.