From nobody Sat May 27 21:16:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QTF380jx3z4WnkG; Sat, 27 May 2023 21:16:36 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QTF3761lNz4NPy; Sat, 27 May 2023 21:16:35 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-5346d150972so1778808a12.3; Sat, 27 May 2023 14:16:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685222194; x=1687814194; h=to:references:message-id:cc:date:in-reply-to:from:subject :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=rWpjTtqlKWsosw7yLVovRnR9Qo2VoKAZgvSIW6LF4Rw=; b=agj8CA/ZPdWZLvVip6YemF3vlpThyxkkVnOaLJ7Dh4LSap1d8xCIxsNqQYtb3xsn3y fhMj3iwlRD34yNZrSBzhpAFe7e2Dl4vL3ILdTpCuvVp5mQKXMaPcojHjiWm6WBxeBERY g8Evehi/zHzxXSXrkgg4yPvlHqwlYqtPJ5sHxFe+7buLCV3HeXfmBIB8kU7jjRska53G lF4KxfQfU7wUO7ve3veglyUvRdV2iTTmU9GhvBUKpNUJJ3SByRfapNjNwsUY3DunEf5+ 28mx9V1ev/p8XOtoRz0ULzO6bmDOquEQew1uU+7cAyywgbesG5BoWs8n6pJDk2ax3Bai iGCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685222194; x=1687814194; h=to:references:message-id:cc:date:in-reply-to:from:subject :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rWpjTtqlKWsosw7yLVovRnR9Qo2VoKAZgvSIW6LF4Rw=; b=IML8VKdTzWziPDlJMpEHKOfRcxsZm6IvVnHigVW/2QYMi9p9UlB1BSOai6nqLAvBiT +O/qXjdGa1QtRqpAOGhQZCEbSSNNjm81HQKtkLv4fBE+uSvjaMj3YnoGv4J6iwdu4t55 ngHd6CvFEeUeITqC2c1c/InCgUKXO3/VdoryKrPNnQT8sr09iZTNn7bEZ3fhdpUIYfEY wZFpB5HNePouDcgbqY/lq7VJwukrodT7D6SOpy4J1gPkGT8TfGAyRAo2R0COM8PpJBtP wlY5Ad5ftENuvcJPHx2oM7gyetbg7eX7UUSMwABgdD6EQEQajiD+u26HpuuyCc0v3JVj xyzA== X-Gm-Message-State: AC+VfDzBPTNuXZZn7OcpORNROUm+y1LkdRvKmnsZ7vuRy/7noeaO5nS2 IJuGCFT1CJO+3idyMhSiI4oNI9RCWn03AA== X-Google-Smtp-Source: ACHHUZ7kZdqpHxp3AdJG4hi5BLnLUiNTk5Jny4mYrAWx1o3Jrsv3Akd7Uugs/JLgDg0ePzVz94f4VA== X-Received: by 2002:a17:90a:c704:b0:250:69c7:a95e with SMTP id o4-20020a17090ac70400b0025069c7a95emr6073397pjt.48.1685222193517; Sat, 27 May 2023 14:16:33 -0700 (PDT) Received: from smtpclient.apple (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id i6-20020a17090aee8600b002566caf4466sm80851pjz.24.2023.05.27.14.16.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 May 2023 14:16:33 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_736430BD-4CA6-48CB-8F24-727A6A6C6C83"; protocol="application/pgp-signature"; micalg=pgp-sha256 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: git: 537cd766435c - main - factor: support OpenSSL 3 From: Enji Cooper In-Reply-To: <626f675b-f304-b772-61a4-0a92283ac348@FreeBSD.org> Date: Sat, 27 May 2023 14:16:21 -0700 Cc: Enji Cooper , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Message-Id: <7F042D0C-F994-40A6-B5AB-4710052815DA@gmail.com> References: <202305271811.34RIBtHY093538@gitrepo.freebsd.org> <626f675b-f304-b772-61a4-0a92283ac348@FreeBSD.org> To: John Baldwin X-Mailer: Apple Mail (2.3731.500.231) X-Rspamd-Queue-Id: 4QTF3761lNz4NPy X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_736430BD-4CA6-48CB-8F24-727A6A6C6C83 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 27, 2023, at 12:21 PM, John Baldwin wrote: =E2=80=A6 > I would suggest restructing this by having a compat shim for the 3.0 = API at > the top of the file (something like this): >=20 > #if OPENSSL_VERSION_NUMBER < 0x30000000L > #define PRIME_CHECKS 5 >=20 > static int > BN_check_prime(const BIGNUM *p, BN_CTX *ctx, BN_GENCB *cb) > { > return (BN_is_prime_ex(p, PRIME_CHECKS, ctx, cb)); > } > #endif >=20 > And then just using BN_check_prime in the rest of the file without = #ifdef's. >=20 > This is the approach we used for OpenSSL 1.1.x and will result in = fewer #ifdef's > and cleaner code overall. One thing we didn't do for OpenSSL 1.1.x = but could > choose to do in this case is to define a header with these shims that = could be > shared to reduce the work needed to update programs to move away from = APIs > deprecated in 3.0. That=E2=80=99s a really fair point. I opened up = https://reviews.freebsd.org/D40305 to track the suggested updates to use = a compat function for pre-3.0. Cheers, -Enji --Apple-Mail=_736430BD-4CA6-48CB-8F24-727A6A6C6C83 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEtvtxN6kOllEF3nmX5JFNMZeDGN4FAmRycyUACgkQ5JFNMZeD GN5OkxAAhzG3uUStzaUFSYfkyf3vlYKWKigxAuI1gStU4hTMvbsQImLzgquKiJEG eO3xYPJ7RJc6TppSofFEqdGHR7I1bM0P/aBZ6eMt2Eq30sJEELuhqGc3eJztcD+b GDdCSC+5El59HL2uaHX5O6cM3I5OAJCNdoUehVTBmhE656FqyV1MTp+TtnA5MwN6 XgDfv/d0iFSoXfCGwWLGHbJFyHKg/g5CmaAaqmkDvABH3HPHvSeV7mNfiLHb6E2T jmILX7Wmxfe1fJHkQdraN+IfqAHUs/AHpAeul+d941xMmqv0DVOMoCX6k6lvhS3J wieSfz4ZT6a9jx2rT0h1rB1TjJ8TWoQfVAq10Cn4Z/52N0X1xfTQstIi+cp+pbMV VyK73CiqAqsqTfTcH8EdK7ZbctVh7XBD00Tu7EwuvpqSpptoEFisO+iM/TCsB5cN 7bvyiaV/BmEnanE71hff2kT8XxomDaSE5XM//eY1wOPaR7gkwmE0DY8K+ZjBqYvN 8V1yCZo1ST2UUzaRi300FUXEa0CrOluZPHe4qlQulL0KiauyQxEIZiN8SYqxCHOq KlTwnSpTppVRCN3F8uAwGPVTXIRU+/rCU2R6TxGFxVV1z1p8uhiBpasBonNOdKn9 wBcDvkgYk6eSi7/d909QE5jpc9koe8BhP/cb0hlGGG128N4xDgQ= =Dxup -----END PGP SIGNATURE----- --Apple-Mail=_736430BD-4CA6-48CB-8F24-727A6A6C6C83--