]> git.ipfire.org Git - thirdparty/openssl.git/log
thirdparty/openssl.git
2 years agoAdd a test quicserver utility
Matt Caswell [Thu, 8 Jun 2023 11:18:38 +0000 (12:18 +0100)] 
Add a test quicserver utility

This QUIC server utility is intended for test purposes only and is expected
to be replaced in a future version of OpenSSL by s_server. At that point
it will be removed.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21204)

2 years agoadd no-docs option
Vladimír Kotal [Mon, 19 Jun 2023 11:43:35 +0000 (13:43 +0200)] 
add no-docs option

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21240)

2 years agos390xcap.c: Avoid copying structure on initialization
Tomas Mraz [Mon, 26 Jun 2023 15:13:30 +0000 (17:13 +0200)] 
s390xcap.c: Avoid copying structure on initialization

This is problematic on old compilers. It also avoids duplicating
the read-only data.

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21284)

(cherry picked from commit 0dee3b0421047354abd0b70cedd4c1bceaf323b0)

2 years agoMiscellaneous updates
Hugo Landau [Wed, 26 Apr 2023 14:11:08 +0000 (15:11 +0100)] 
Miscellaneous updates

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19769)

2 years agoMulti-Stream API
Hugo Landau [Wed, 29 Mar 2023 06:58:15 +0000 (07:58 +0100)] 
Multi-Stream API

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19769)

2 years agoQUIC API: More minor tweaks
Hugo Landau [Thu, 5 Jan 2023 10:59:43 +0000 (10:59 +0000)] 
QUIC API: More minor tweaks

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19769)

2 years agoQUIC API: Minor tweaks
Hugo Landau [Thu, 8 Dec 2022 15:00:47 +0000 (15:00 +0000)] 
QUIC API: Minor tweaks

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19769)

2 years agoQUIC API Overview: Add SSL API triage list
Hugo Landau [Thu, 8 Dec 2022 10:11:21 +0000 (10:11 +0000)] 
QUIC API Overview: Add SSL API triage list

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19769)

2 years agoQUIC API: Shutdown handling, etc.
Hugo Landau [Tue, 6 Dec 2022 18:03:34 +0000 (18:03 +0000)] 
QUIC API: Shutdown handling, etc.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19769)

2 years agoQUIC API Overview: Add Q&A, minor fixes
Hugo Landau [Mon, 28 Nov 2022 12:04:07 +0000 (12:04 +0000)] 
QUIC API Overview: Add Q&A, minor fixes

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19769)

2 years agoQUIC API Overview Design Document
Hugo Landau [Fri, 25 Nov 2022 12:44:31 +0000 (12:44 +0000)] 
QUIC API Overview Design Document

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19769)

2 years agoAdd support for SHA256/192
Fergus Dall [Mon, 12 Jun 2023 10:02:14 +0000 (20:02 +1000)] 
Add support for SHA256/192

This is defined in NIST SP 800-208 as the truncation to 192 bits of
SHA256. Unlike other truncated hashes in the SHA2 suite, this variant
doesn't have a different initial state, it is just a pure truncation
of the output.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21180)

2 years agoCONF_modules_load_file_ex(): Do not try to load an empty file name
Tomas Mraz [Mon, 26 Jun 2023 09:11:57 +0000 (11:11 +0200)] 
CONF_modules_load_file_ex(): Do not try to load an empty file name

Fixes #21258

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/21282)

2 years agoAdd some test_ssl_new tests for the ffdhe groups
Matt Caswell [Fri, 23 Jun 2023 15:01:41 +0000 (16:01 +0100)] 
Add some test_ssl_new tests for the ffdhe groups

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21274)

2 years agoFix supported_groups handing in TLSv1.2
Matt Caswell [Fri, 23 Jun 2023 14:45:14 +0000 (15:45 +0100)] 
Fix supported_groups handing in TLSv1.2

In TLSv1.2 we should not attempt to use a supported_group value that is
intended for use with TLSv1.3 - even if both the server and the client
support it, e.g. the ffdhe groups are supported by OpenSSL for TLSv1.3 but
not for TLSv1.2.

Fixes #21081

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21274)

2 years agoAdd a test for pkeyutl encrypt/decrypt using SM2
Matt Caswell [Fri, 23 Jun 2023 11:05:07 +0000 (12:05 +0100)] 
Add a test for pkeyutl encrypt/decrypt using SM2

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21272)

2 years agoDon't truncate the input when decrypting in pkeyutl
Matt Caswell [Fri, 23 Jun 2023 10:50:17 +0000 (11:50 +0100)] 
Don't truncate the input when decrypting in pkeyutl

The pkeyutl app was truncating the input file for decryption leading to
incorrect results. This was probably ok historically when RSA was being
used for decryption which has short maximum sizes. This is not ok with SM2.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21272)

2 years agoCheck for 0 modulus in BN_RECP_CTX_set.
fullwaywang [Wed, 21 Jun 2023 07:00:06 +0000 (15:00 +0800)] 
Check for 0 modulus in BN_RECP_CTX_set.
The function BN_RECP_CTX_set did not check whether arg d is zero,
in which case an early failure should be returned to the invoker.
This is a similar fix to the cognate defect of CVE-2015-1794.

Fixes #21111

CLA: trivial

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21255)

2 years agoadd note about retrieving error stack
Vladimír Kotal [Fri, 16 Jun 2023 09:22:24 +0000 (11:22 +0200)] 
add note about retrieving error stack

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21220)

2 years agoAdd a test case for the password prompt on garbage PKCS#12 file
Richard Levitte [Fri, 16 Jun 2023 11:56:36 +0000 (13:56 +0200)] 
Add a test case for the password prompt on garbage PKCS#12 file

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21197)

2 years agoOSSL_STORE and PKCS#12: Check if there is a MAC to verify before prompting
Richard Levitte [Tue, 13 Jun 2023 18:06:04 +0000 (20:06 +0200)] 
OSSL_STORE and PKCS#12: Check if there is a MAC to verify before prompting

When a DER object with unknown contents comes all the way to
ossl_store_handle_load_result(), and it attempts to decode them as different
objects, the PKCS#12 decoding attempt would (almost) always prompt for a
passphrase, even if there isn't a MAC to verify it against in the PKCS#12
object.

This change checks if there is a MAC to verify against before attempting to
prompt for a passphrase, leading to less surprising behavior.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21197)

2 years agoConsistency: "Authors" after "The OpenSSL Project"
Dimitri Papadopoulos [Thu, 22 Jun 2023 13:12:34 +0000 (15:12 +0200)] 
Consistency: "Authors" after "The OpenSSL Project"

All source files show "The OpenSSL Project Authors" as the
copyright owner.

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21268)

2 years agoAdd decoder fuzzer
Kurt Roeckx [Wed, 11 Jan 2023 20:14:35 +0000 (21:14 +0100)] 
Add decoder fuzzer

This found CVE-2023-0217

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20269)

2 years agoAdd a test for an invalid group in the HRR
Matt Caswell [Fri, 9 Jun 2023 08:33:11 +0000 (09:33 +0100)] 
Add a test for an invalid group in the HRR

Test that if the client sends a key share for a group in the server's
supported_group list but is otherwise invalid, that we don't select it
in the HRR.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/21163)

2 years agoDon't ask for an invalid group in an HRR
Matt Caswell [Fri, 9 Jun 2023 08:09:06 +0000 (09:09 +0100)] 
Don't ask for an invalid group in an HRR

If the client sends us a group in a key_share that is in our
supported_groups list but is otherwise not suitable (e.g. not compatible
with TLSv1.3) we reject it. We should not ask for that same group again
in a subsequent HRR.

Fixes #21157

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/21163)

2 years agoSupport SSL_OP_CLEANSE_PLAINTEXT on QUIC streams
Tomas Mraz [Mon, 12 Jun 2023 16:16:35 +0000 (18:16 +0200)] 
Support SSL_OP_CLEANSE_PLAINTEXT on QUIC streams

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21182)

2 years agoAllow to disable apps building with no-apps
Vladimír Kotal [Thu, 15 Jun 2023 08:02:57 +0000 (10:02 +0200)] 
Allow to disable apps building with no-apps

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21212)

2 years agoupdated the end copyright year in README.md to 2023
Preveen Padmanabhan [Sat, 17 Jun 2023 04:07:06 +0000 (09:37 +0530)] 
updated the end copyright year in README.md to 2023

CLA: trivial

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21225)

2 years agoRemove restriction to only cross-sign self-signed certificates
Yannik Sembritzki [Mon, 29 May 2023 14:04:38 +0000 (14:04 +0000)] 
Remove restriction to only cross-sign self-signed certificates

CLA: trivial

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21137)

2 years agoadd no-http
Vladimír Kotal [Thu, 15 Jun 2023 19:29:58 +0000 (21:29 +0200)] 
add no-http

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21217)

2 years agolog actual NID causing the 'unknown message digest algorithm error'
Vladimír Kotal [Thu, 15 Jun 2023 15:03:21 +0000 (17:03 +0200)] 
log actual NID causing the 'unknown message digest algorithm error'

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21214)

2 years agoreturn immediately if namemap is NULL
Vladimír Kotal [Fri, 16 Jun 2023 14:25:58 +0000 (16:25 +0200)] 
return immediately if namemap is NULL

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21223)

2 years agoFix new typos found by codespell
Dimitri Papadopoulos [Thu, 15 Jun 2023 06:36:35 +0000 (08:36 +0200)] 
Fix new typos found by codespell

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21210)

2 years agoFix function signatures in aes-gcm-armv8 comments.
fisher.yu [Wed, 14 Jun 2023 07:17:49 +0000 (07:17 +0000)] 
Fix function signatures in aes-gcm-armv8 comments.

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21208)

2 years agofips: use tsan counter instead of tsan_add to increment
Pauli [Wed, 14 Jun 2023 06:53:51 +0000 (16:53 +1000)] 
fips: use tsan counter instead of tsan_add to increment

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/21199)

2 years agoQUIC: Allow application to trigger TXKU
Hugo Landau [Mon, 12 Jun 2023 13:13:33 +0000 (14:13 +0100)] 
QUIC: Allow application to trigger TXKU

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21029)

2 years agoQUIC: Minor fixups
Hugo Landau [Mon, 12 Jun 2023 13:13:26 +0000 (14:13 +0100)] 
QUIC: Minor fixups

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21029)

2 years agoQUIC CHANNEL: Inform the ACKM when the handshake is confirmed
Hugo Landau [Tue, 23 May 2023 14:37:34 +0000 (15:37 +0100)] 
QUIC CHANNEL: Inform the ACKM when the handshake is confirmed

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21029)

2 years agoQUIC: Test key update works correctly
Hugo Landau [Tue, 23 May 2023 11:23:06 +0000 (12:23 +0100)] 
QUIC: Test key update works correctly

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21029)

2 years agoQUIC CHANNEL: Optimise key update using ACKs
Hugo Landau [Tue, 23 May 2023 11:23:06 +0000 (12:23 +0100)] 
QUIC CHANNEL: Optimise key update using ACKs

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21029)

2 years agoQUIC: Add internal APIs for white-box testing of key update
Hugo Landau [Tue, 23 May 2023 11:23:06 +0000 (12:23 +0100)] 
QUIC: Add internal APIs for white-box testing of key update

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21029)

2 years agoQUIC CHANNEL: Enforce the RX packet forgery limit
Hugo Landau [Tue, 23 May 2023 11:23:06 +0000 (12:23 +0100)] 
QUIC CHANNEL: Enforce the RX packet forgery limit

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21029)

2 years agoQUIC RXDP: Strictly enforce ACK PNs with regard to TX key epochs
Hugo Landau [Tue, 23 May 2023 11:23:06 +0000 (12:23 +0100)] 
QUIC RXDP: Strictly enforce ACK PNs with regard to TX key epochs

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21029)

2 years agoQUIC CHANNEL: Ensure new packets aren't enforced with old keys
Hugo Landau [Tue, 23 May 2023 11:23:06 +0000 (12:23 +0100)] 
QUIC CHANNEL: Ensure new packets aren't enforced with old keys

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21029)

2 years agoQUIC CHANNEL: Handle key updates correctly
Hugo Landau [Tue, 23 May 2023 11:23:06 +0000 (12:23 +0100)] 
QUIC CHANNEL: Handle key updates correctly

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21029)

2 years agoQUIC TXP: Make TXP use time callback correctly
Hugo Landau [Tue, 23 May 2023 11:23:06 +0000 (12:23 +0100)] 
QUIC TXP: Make TXP use time callback correctly

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21029)

2 years agoQUIC APL: Correct implementation of time callback override
Hugo Landau [Tue, 23 May 2023 11:23:06 +0000 (12:23 +0100)] 
QUIC APL: Correct implementation of time callback override

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21029)

2 years agoQUIC RX: Support reporting the key epoch a packet was received with
Hugo Landau [Tue, 23 May 2023 11:23:06 +0000 (12:23 +0100)] 
QUIC RX: Support reporting the key epoch a packet was received with

This is needed to support key update validation on the receive side.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21029)

2 years agoQUIC TXP: Allow callbacks on ACK transmission
Hugo Landau [Tue, 23 May 2023 11:23:06 +0000 (12:23 +0100)] 
QUIC TXP: Allow callbacks on ACK transmission

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21029)

2 years agoQUIC TXP: Allow next PN to be used to be queried
Hugo Landau [Tue, 23 May 2023 11:23:06 +0000 (12:23 +0100)] 
QUIC TXP: Allow next PN to be used to be queried

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21029)

2 years agoQUIC RX: Refactor key update callback to provide PN
Hugo Landau [Tue, 23 May 2023 11:23:06 +0000 (12:23 +0100)] 
QUIC RX: Refactor key update callback to provide PN

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21029)

2 years agoQUIC TXP: Remove TX key update handling from TXP
Hugo Landau [Tue, 23 May 2023 11:23:05 +0000 (12:23 +0100)] 
QUIC TXP: Remove TX key update handling from TXP

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21029)

2 years agoQUIC TXP: Refactor status output to use an extensible structure
Hugo Landau [Tue, 23 May 2023 11:23:05 +0000 (12:23 +0100)] 
QUIC TXP: Refactor status output to use an extensible structure

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21029)

2 years agoQUIC ACKM: Allow largest acked PN to be queried
Hugo Landau [Tue, 23 May 2023 11:23:05 +0000 (12:23 +0100)] 
QUIC ACKM: Allow largest acked PN to be queried

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21029)

2 years agoQUIC WIRE: Utility function to determine if PN is in an ACK frame
Hugo Landau [Tue, 23 May 2023 11:23:05 +0000 (12:23 +0100)] 
QUIC WIRE: Utility function to determine if PN is in an ACK frame

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21029)

2 years agoQUIC Glossary: TXKU, RXKU, KU
Hugo Landau [Tue, 23 May 2023 11:23:05 +0000 (12:23 +0100)] 
QUIC Glossary: TXKU, RXKU, KU

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21029)

2 years agoapps/ca.c: Handle EVP_PKEY_get_default_digest_name() returning 1 with "UNDEF"
Richard Levitte [Wed, 8 Mar 2023 10:53:34 +0000 (11:53 +0100)] 
apps/ca.c: Handle EVP_PKEY_get_default_digest_name() returning 1 with "UNDEF"

EVP_PKEY_get_default_digest_name() may return 1 with the returned digest
name "UNDEF".  This case hasn't been documented, and the meaning has been
left undefined, until now.

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20460)

2 years agoPartially revert #18070 (Add support for Windows CA certificate store)
Hugo Landau [Tue, 13 Jun 2023 09:40:22 +0000 (10:40 +0100)] 
Partially revert #18070 (Add support for Windows CA certificate store)

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21190)

2 years agoOpenSSL::paramnames: Use less magic perl
Richard Levitte [Mon, 12 Jun 2023 04:31:25 +0000 (06:31 +0200)] 
OpenSSL::paramnames: Use less magic perl

Constructions like $$cursor{whatever} and %$cursor{whatever} were ambiguous
in some perl versions, and it's still better to use the arrow syntax for the
way we use them, i.e. they can both be replaced with $cursor->{whatever}.

Fixes #21152
Fixes #21172

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21178)

2 years agoFix typos found by codespell
Dimitri Papadopoulos [Tue, 9 May 2023 07:06:40 +0000 (09:06 +0200)] 
Fix typos found by codespell

Typos in doc/man* will be fixed in a different commit.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20910)

2 years agofips: update DSA security check to fix legacy verify strengths
Pauli [Mon, 12 Jun 2023 23:37:57 +0000 (09:37 +1000)] 
fips: update DSA security check to fix legacy verify strengths

Refer SP 800-131Ar2 table 2:
    https://csrc.nist.gov/publications/detail/sp/800-131a/rev-2/final

Fixes #21185

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21186)

2 years agoupdated (lib+)oqsprovider to latest releases
Michael Baentsch [Tue, 13 Jun 2023 15:30:30 +0000 (17:30 +0200)] 
updated (lib+)oqsprovider to latest releases

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21194)

2 years agoOnly take note of the ack deadline if we can actually issue an ack
Matt Caswell [Mon, 12 Jun 2023 15:21:16 +0000 (16:21 +0100)] 
Only take note of the ack deadline if we can actually issue an ack

When determining the next tick deadline we cannot actually issue an
ack if the CC will not let us, or the enc_level is not yet provisioned.

This avoids a bug where we can end up in a busy loop because the next
event deadline is reported as "now" because we want to send an ack, but
we can't actually send anything yet.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21181)

2 years agocmactest.c: Fix no-des and no-sm4 build failures
Tomas Mraz [Mon, 12 Jun 2023 17:49:03 +0000 (19:49 +0200)] 
cmactest.c: Fix no-des and no-sm4 build failures

Also use OSSL_NELEM instead of hardcoding array size.

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21183)

2 years agofips: use memory ordering rather than locks
Pauli [Tue, 13 Jun 2023 01:39:23 +0000 (11:39 +1000)] 
fips: use memory ordering rather than locks

The FIPS provider accesses it's current state under lock.
This is overkill, little or no synchronisation is actually required in
practice (because it's essentially a read only setting).  Switch to using
TSAN operations in preference.

Fixes #21179

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21187)

2 years agoFix minor issues in the demo/man pages for TLS client/blocking
Matt Caswell [Wed, 7 Jun 2023 15:26:58 +0000 (16:26 +0100)] 
Fix minor issues in the demo/man pages for TLS client/blocking

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21133)

2 years agoSplit the blocking TLS client guide page into two
Matt Caswell [Wed, 7 Jun 2023 14:58:42 +0000 (15:58 +0100)] 
Split the blocking TLS client guide page into two

We split the page into two: one covering basic TLS introductory material
that applies to both clients and servers, and one with the specific
material on writing a blocking TLS client.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21133)

2 years agoAllow man7 pages to not have a DESCRIPTION section
Matt Caswell [Wed, 7 Jun 2023 11:10:41 +0000 (12:10 +0100)] 
Allow man7 pages to not have a DESCRIPTION section

For tutorial type pages it doesn't make any sense to have a DESCRIPTION
section.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21133)

2 years agoAdd a tutorial on writing a simple blocking TLS client
Matt Caswell [Fri, 2 Jun 2023 11:26:12 +0000 (12:26 +0100)] 
Add a tutorial on writing a simple blocking TLS client

Provide guidance on the steps needed to write a very simple blocking TLS
client.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21133)

2 years agoAdd a very simple blocking TLS client demo
Matt Caswell [Fri, 2 Jun 2023 15:31:30 +0000 (16:31 +0100)] 
Add a very simple blocking TLS client demo

This blocking client is intended to be used to explain how to implement
a simple client in the documentation.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21133)

2 years agoconfigure: introduce no-ecx to remove ECX related feature
Yi Li [Mon, 17 Apr 2023 08:20:31 +0000 (16:20 +0800)] 
configure: introduce no-ecx to remove ECX related feature

This can effectively reduce the binary size for platforms
that don't need ECX feature(~100KB).

Signed-off-by: Yi Li <yi1.li@intel.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20781)

2 years agorand_lib: RAND_poll: Reseed in non-"no-deprecated" builds.
Mike Kasick [Fri, 9 Jun 2023 17:40:16 +0000 (13:40 -0400)] 
rand_lib: RAND_poll: Reseed in non-"no-deprecated" builds.

In a non-"no-deprecated" libcrypto build with a default configuration,
RAND_get_rand_method() == RAND_OpenSSL() and so needs to fall through to
the RAND_seed call (used in "no-deprecated" builds) to perform a reseed.

CLA: trivial

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21167)

2 years agocrypto/sm2/sm2_sign.c: Add BN_CTX_end
Jiasheng Jiang [Fri, 23 Sep 2022 02:35:39 +0000 (10:35 +0800)] 
crypto/sm2/sm2_sign.c: Add BN_CTX_end

To match the BN_CTX_start, it should be better to add
BN_CTX_end in the end of the function.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19266)

2 years agoX509_NAME_cmp fix for empty name
Wim Decroix [Thu, 8 Jun 2023 10:40:36 +0000 (12:40 +0200)] 
X509_NAME_cmp fix for empty name

CLA: trivial

Fixes #21156

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21155)

2 years agoUpdate CMAC test cases.
fisher.yu [Mon, 12 Jun 2023 00:59:42 +0000 (00:59 +0000)] 
Update CMAC test cases.

    1. Update cmac test cases, fullfilling test data by short string
       instead of using long string directly.
    2. Modify the wording of comments in cmac.c

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21177)

2 years agoINSTALL: document shared library pinning for static builds
Matthias St. Pierre [Wed, 17 May 2023 09:54:07 +0000 (11:54 +0200)] 
INSTALL: document shared library pinning for static builds

The libcrypto library uses shared library pinning to prevent its
cleanup handlers from crashing at program termination because of a
premature unloading of the shared library.

However, shared library pinning is enabled also for static builds,
which may lead to surpising behaviour if libcrypto is linked
statically to a shared third-party library, because in this case
the third-party library gets pinned.

This surprising behaviour is caused by the fact that the `no-shared`
configure option does not imply `no-pinshared`. Since this quirk
can't be changed without potentially breaking existing code, we just
document it here and provide a workaround.

Fixes #20977

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20985)

2 years agoFix incorrect ERR_raise() calls
Theo Buehler [Sat, 10 Jun 2023 09:01:32 +0000 (11:01 +0200)] 
Fix incorrect ERR_raise() calls

A few ERR_raise() calls in v3_purp.c use the wrong library. For example,
in OpenSSL 3.1.1 we get

00000000:error:0580009E:x509 certificate routines:ossl_x509v3_cache_extensions:reason(158):crypto/x509/v3_purp.c:635:

instead of

00000000:error:1100009E:X509 V3 routines:ossl_x509v3_cache_extensions:invalid certificate:crypto/x509/v3_purp.c:635:

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21168)

2 years agoadd cygwin CI
Michael Baentsch [Sun, 4 Jun 2023 12:43:35 +0000 (14:43 +0200)] 
add cygwin CI

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21006)

2 years agoFix build on cygwin
Michael Baentsch [Sat, 20 May 2023 04:47:39 +0000 (06:47 +0200)] 
Fix build on cygwin

Fixes #19531

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21006)

2 years agoIntroduce [HAVE_/NO_]MADVISE defines
James Knight [Sat, 6 May 2023 00:20:02 +0000 (20:20 -0400)] 
Introduce [HAVE_/NO_]MADVISE defines

Toolchains that target a non-MMU architecture may not have the `madvise`
function available, even if the `sys/mman.h` header provides a define
for `MADV_DONTDUMP` (e.g. when targeting ARMv7-M with uClibc). The
following tweaks the implementation to use `HAVE_MADVISE`/`NO_MADVISE`
defines to help indicate when to attempt to use `madvise`. This change
operates in the same manner as the original implementation (i.e. relies
on `MADV_DONTDUMP` to indicate if `madvise` can be used); however, this
change now allows a builder to override the internal detection by
explicitly providing the `HAVE_MADVISE` define at compile time. This
should give flexibility for environments which do not have `madvise`
when there is no easy logic to set `NO_MADVISE`.

Signed-off-by: James Knight <james.d.knight@live.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/20851)

2 years agoriscv: aes: dual-license under Apache + 2-clause BSD
Heiko Stuebner [Mon, 22 May 2023 12:23:35 +0000 (14:23 +0200)] 
riscv: aes: dual-license under Apache + 2-clause BSD

To allow re-use of the already reviewed openSSL crypto code for RISC-V in
other projects - like the Linux kernel, add a second license (2-clause BSD)
to the 32+64bit aes implementations using the Zkn extension.

Signed-off-by: Heiko Stuebner <heiko.stuebner@vrull.eu>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/21018)

2 years agoriscv: GCM: dual-license under Apache + 2-clause BSD
Heiko Stuebner [Thu, 30 Mar 2023 08:29:21 +0000 (10:29 +0200)] 
riscv: GCM: dual-license under Apache + 2-clause BSD

To allow re-use of the already reviewed openSSL crypto code for RISC-V in
other projects - like the Linux kernel, add a second license (2-clause BSD)
to the recently added GCM ghash functions.

Signed-off-by: Heiko Stuebner <heiko.stuebner@vrull.eu>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/20649)

2 years agoCoverity 1528485: Remove unused assignment of wvalue
Tomas Mraz [Wed, 7 Jun 2023 12:33:22 +0000 (14:33 +0200)] 
Coverity 1528485: Remove unused assignment of wvalue

wvalue is always initialized at the beginning of each cycle
and used only within the cycle

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/21145)

2 years agoCoverity 1528486: Avoid assignment of unused value of bags
Tomas Mraz [Wed, 7 Jun 2023 12:28:58 +0000 (14:28 +0200)] 
Coverity 1528486: Avoid assignment of unused value of bags

It is used only within the loop and always initialized

2 years agoCoverity 1528487: Avoid assignment of unused value of i
Tomas Mraz [Wed, 7 Jun 2023 12:25:58 +0000 (14:25 +0200)] 
Coverity 1528487: Avoid assignment of unused value of i

2 years agoCoverity 1528488: Avoid assignment of unused value rctx
Tomas Mraz [Wed, 7 Jun 2023 12:23:48 +0000 (14:23 +0200)] 
Coverity 1528488: Avoid assignment of unused value rctx

Also some move redirection_url inside loop
where it is only used.

2 years agoCoverity 1528490: Avoid assignment of unused value of i
Tomas Mraz [Wed, 7 Jun 2023 12:05:38 +0000 (14:05 +0200)] 
Coverity 1528490: Avoid assignment of unused value of i

It is used only within the loop and initialized at the beginning

2 years agoCoverity 1528492: Fix possible memory leak if t == NULL
Tomas Mraz [Wed, 7 Jun 2023 11:56:54 +0000 (13:56 +0200)] 
Coverity 1528492: Fix possible memory leak if t == NULL

2 years agoCoverity 1528494 and 1528493: Remove unused assignment of wvalue
Tomas Mraz [Wed, 7 Jun 2023 11:47:59 +0000 (13:47 +0200)] 
Coverity 1528494 and 1528493: Remove unused assignment of wvalue

wvalue is always initialized at the beginning of each cycle
and used only within the cycle

2 years agoCoverity 1528496: remove assignment of unused value
Tomas Mraz [Wed, 7 Jun 2023 11:33:40 +0000 (13:33 +0200)] 
Coverity 1528496: remove assignment of unused value

ctx is used only within the loop and always assigned at start

2 years agoCoverity 1529992: Check return value of sscanf()
Tomas Mraz [Wed, 7 Jun 2023 11:29:01 +0000 (13:29 +0200)] 
Coverity 1529992: Check return value of sscanf()

Also moving the call to setup_tests() where it
fits better.

2 years agoCoverity 1531836: Check return value of CRYPTO_atomic_add()
Tomas Mraz [Wed, 7 Jun 2023 11:22:19 +0000 (13:22 +0200)] 
Coverity 1531836: Check return value of CRYPTO_atomic_add()

2 years agoCoverity 1531872: j is not used anywhere later, remove the assignment
Tomas Mraz [Wed, 7 Jun 2023 11:18:26 +0000 (13:18 +0200)] 
Coverity 1531872: j is not used anywhere later, remove the assignment

2 years agoInclude poll.h instead of incorrect sys/poll.h
Tomas Mraz [Tue, 6 Jun 2023 10:19:10 +0000 (12:19 +0200)] 
Include poll.h instead of incorrect sys/poll.h

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Anton Arapov <anton@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21131)

2 years agoFix failures of OS Zoo CI
Tomas Mraz [Tue, 6 Jun 2023 09:48:36 +0000 (11:48 +0200)] 
Fix failures of OS Zoo CI

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Anton Arapov <anton@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21131)

2 years agoSet RC4 defines on libcrypto/liblegacy
Tomas Mraz [Thu, 8 Jun 2023 08:50:52 +0000 (10:50 +0200)] 
Set RC4 defines on libcrypto/liblegacy

Also add missing prototype for rc4_md5_enc.

Fixes #21150

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21153)

2 years agoCast the argument to unsigned char when calling isspace()
Michael Baentsch [Thu, 8 Jun 2023 06:05:42 +0000 (08:05 +0200)] 
Cast the argument to unsigned char when calling isspace()

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21151)

2 years agoutil/find-doc-nits: extend regex to match new OPT_INFORM A
Matthias St. Pierre [Wed, 17 May 2023 16:37:40 +0000 (18:37 +0200)] 
util/find-doc-nits: extend regex to match new OPT_INFORM A

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7320)

2 years agoapps/asn1parse: improve RFC7462 compliance
Dr. Matthias St. Pierre [Wed, 26 Sep 2018 06:37:01 +0000 (08:37 +0200)] 
apps/asn1parse: improve RFC7462 compliance

The asn1parse command now supports three different input formats:

     openssl asn1parse -inform PEM|DER|B64

       PEM: base64 encoded data enclosed by PEM markers (RFC7462)
       DER: der encoded binary data
       B64: raw base64 encoded data

The PEM input format is the default format. It is equivalent
to the former `-strictpem` option which is now marked obsolete
and kept for backward compatibility only.

The B64 is equivalent to the former default input format of the
asn1parse command (without `-strictpem`)

Fixes #7317

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7320)

2 years agoapps/opt: refactor input format parsing
Dr. Matthias St. Pierre [Wed, 26 Sep 2018 06:30:54 +0000 (08:30 +0200)] 
apps/opt: refactor input format parsing

- split OPT_FMT_PEMDER flag into OPT_FMT_PEM and OPT_FMT_DER
- add OPT_FMT_B64 option (`-inform b64`)

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7320)