Commit Graph

30163 Commits

Author SHA1 Message Date
Dr. David von Oheimb
1986f6152f OSSL_CRMF_{CERTTEMPLATE,CERTID}_get0_serialNumber(): Make result const for consistency
Also make doc/man3/OSSL_CRMF_MSG_get0_tmpl.pod consistent with crmf.h.in regarding const results

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15790)
2021-06-30 10:38:23 +02:00
Dr. David von Oheimb
66be663b64 cmp_mock_srv.c: Add missing OldCertID check for 'kur' cert update requests
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15790)
2021-06-30 10:38:23 +02:00
Dr. David von Oheimb
7df56adac7 CMP: Add missing getter functions to CRMF API and CMP API
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15790)
2021-06-30 10:38:23 +02:00
Pauli
b9bc8eb054 test: fix test ordering in threads test
Fixes #15953

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15954)
2021-06-30 17:54:45 +10:00
Pauli
5e56f4587d evp: fix coverity 1473380 Copy into fixed size buffer (STRING_OVERFLOW)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15943)
2021-06-30 13:55:09 +10:00
Pauli
98431c4313 dh_test: fix coverity 1473239 Argument cannot be negative (NEGATIVE_RETURNS)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15943)
2021-06-30 13:55:09 +10:00
Pauli
159dacca46 s_time: avoid unlikely division by zero
Fixing coverity 966560 Division or modulo by zero (DIVIDE_BY_ZERO)

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15943)
2021-06-30 13:55:09 +10:00
Pauli
196feb18de bio: check for valid socket when closing
Fixes coverity 271258 Improper use of negative value (NEGATIVE_RETURNS)

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15943)
2021-06-30 13:55:09 +10:00
Pauli
01fb4bff9b test: fix coverity 1469427 Improper use of negative value (NEGATIVE_RETURNS)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15943)
2021-06-30 13:55:09 +10:00
Pauli
10af976962 x509: improve error reporting
Distinguish between not being able to extract a public key versus not knowing
the key's type.

Alternative to #15921

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15944)
2021-06-30 13:53:49 +10:00
Dmitry Belyavskiy
a73a5d0a14 Missing link to fips_config documentation
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15940)
2021-06-29 21:05:40 +02:00
Tomas Mraz
452580e5b0 coverity #1486532: fix potential NULL dereference in test_mk_file_path()
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15942)
2021-06-29 18:41:46 +02:00
Tomas Mraz
475c5bbd10 coverity #1486531: return error properly from x509_pubkey_ex_new_ex()
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15942)
2021-06-29 18:41:45 +02:00
Richard Levitte
69e14a546d EVP: Have EVP_PKCS82PKEY_ex() pass a correct selection to OSSL_DECODER
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15934)
2021-06-29 13:50:51 +02:00
Richard Levitte
398f8fe1c4 DECODER & ENCODER: Make sure to pass around the original selection bits
When decoding a key and asking the keymgmt to import the key data, it
was told that the key data includes everything.  This may not be true,
since the user may have specified a different selection, and some
keymgmts may want to be informed.

Our key decoders' export function, on the other hand, didn't care
either, and simply export anything they could, regardless.

In both cases, the selection that was specified by the user is now
passed all the way.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15934)
2021-06-29 13:50:51 +02:00
Dr. David von Oheimb
6eaf139f62 ossl_cmp_error_new(): Fix Coverity issue 1486534, and consequently also issues 1486536 and 1486533
The issues are due to an integer overflow that may happen on '(ERR_SYSTEM_FLAG << 1)'.

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15938)
2021-06-29 13:05:52 +02:00
Hubert Kario
b2eabccbe5 doc: make error checking in ticket handling code explicit
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15918)
2021-06-29 12:15:40 +02:00
David CARLIER
f0b9e75e4f darwin platform replacing getentropy usage by platform api instead.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15924)
2021-06-29 19:03:28 +10:00
Richard Levitte
19c0b46b83 OSSL_STORE: Fix crash when tracing STORE
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15931)
2021-06-29 09:32:59 +02:00
Richard Levitte
f616ad4b02 ENCODER & DECODER: Make a tighter coupling between en/decoders and keymgmt
If there are keymgmts and en/decoders from the same provider, try to
combine them first.

This avoids unnecessary export/import dances, and also tries to avoid
issues where the keymgmt doesn't fully support exporting and importing,
which we can assume will be the case for HSM protected keys.

Fixes #15932

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15933)
2021-06-29 17:03:45 +10:00
Richard Levitte
16561896ae PROV: Have our PEM->DER decoder only recognise our PEM names
This is to avoid creating confusion where other PEM decoder
implementations may know better what PEM names that are unknown to us
actually mean.

Fixes #15929

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15930)
2021-06-29 06:01:48 +02:00
Matt Caswell
6ee4741281 Ensure ordinals are created during release process
We introduce a new makefile target "make release-update" that forces
ordinal file renumbering, and also does the fips checksum updates. We
then call that  from the release script.

Fixes #15806

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15901)
2021-06-29 09:51:30 +10:00
Lőrinczy, Zsigmond
52f5407dc1 Update config.pm
Missing '(' added into a PowerPC-specific command

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15911)
2021-06-27 20:20:19 +10:00
Pauli
9f54970c1d evp_test: use correct size in memory clear
Fixes #15917

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15920)
2021-06-27 16:12:46 +10:00
Dr. David von Oheimb
4acda8635e DOC: Clarify the role of EKUs including defaults for TLS client and server use
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14199)
2021-06-26 15:38:40 +02:00
Richard Levitte
426005eea5 Fix 'openssl req' to correctly use the algorithm from '-newkey algo:nnnn'
We used the original string, which meant fetching for, for example,
'rsa:2048'.  That was, of course, doomed to fail.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15912)
2021-06-26 10:31:04 +02:00
Richard Levitte
92eb592b3b ENCODER & DECODER: Allow en/decoders to have multiple names
We had prepared for this a little bit, but apparently not completed it.

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15904)
2021-06-26 16:44:22 +10:00
Pauli
56ba2b78eb doc: update up call documentation
Some of the BIO functions weren't included in the provider-base documentation.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15909)
2021-06-26 16:14:52 +10:00
Richard Levitte
32a56ebab2 test/recipes/90-test_includes_data/vms-includes.cnf: correct the directory
... to mimic includes.cnf

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15823)
2021-06-26 06:43:09 +02:00
Richard Levitte
f49b42e6ee apps/CA.pl.in: restore the quotes around -CAfile, they were there for a reason
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15823)
2021-06-26 06:43:09 +02:00
Richard Levitte
ed0bd67d4b test/recipes/80-test_ca.t: Don't force quotes around the config file in $cnf
However, when passing it through the OPENSSL_CONFIG environment
variable, we still need the quotes, just to make sure.

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15823)
2021-06-26 06:43:08 +02:00
Richard Levitte
bb4f826272 test/recipes/66-test_ossl_store.t: ensure native paths
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15823)
2021-06-26 06:43:08 +02:00
Richard Levitte
01b093aaee testutil: teach test_mk_file_path() how to merge VMS file specs
This isn't a full solution, it only handles current use cases.

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15823)
2021-06-26 06:43:08 +02:00
Richard Levitte
511fb47264 test/ossl_store_test.c: Adapt the use of datadir for VMS paths
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15823)
2021-06-26 06:43:08 +02:00
Richard Levitte
46399d9db2 UTF-8 not easily supported on VMS command line yet
Some tests are designed to test UTF-8 on the command line.
We simply disable those on VMS.

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15823)
2021-06-26 06:43:08 +02:00
Richard Levitte
e7137c8497 Fix test_errstr for VMS
Occasionally, we get an error code on VMS that doesn't translate
into POSIX, and the error string reflects that

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15823)
2021-06-26 06:43:08 +02:00
Christian Heimes
89fe295257 Fix segfault in openssl x509 -modulus
The command ``openssl x509 -noout -modulus -in cert.pem`` used to segfaults
sometimes because an uninitialized variable was passed to
``BN_lebin2bn``. The bug triggered an assertion in bn_expand_internal().

Fixes: https://github.com/openssl/openssl/issues/15899
Signed-off-by: Christian Heimes <christian@python.org>

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15900)
2021-06-26 11:40:34 +10:00
Matt Caswell
15500c9d08 Add wrap.pl to .gitignore
This file is now auto-generated from a template (wrap.pl.in). Therefore
it should be ignored by git.

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15895)
2021-06-26 11:39:10 +10:00
Theo Buehler
3a1ec0c269 Fix two typos in OSSL_trace_enabled.pod
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15894)
2021-06-26 11:38:01 +10:00
Pauli
f06c554760 test: check for NULL returns better
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/15910)
2021-06-26 11:33:52 +10:00
Pauli
711d5a2fc0 test: avoid memory leaks on errors
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/15910)
2021-06-26 11:33:52 +10:00
Pauli
1f25fd1616 evp_test: address NULL pointer dereference and return failure better
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/15910)
2021-06-26 11:33:52 +10:00
Pauli
a52d20c82a ui: address potential memory leak
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/15910)
2021-06-26 11:33:52 +10:00
Pauli
1f3f8a3d01 apps: address potential memory leaks
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/15910)
2021-06-26 11:33:52 +10:00
Pauli
150251904c x509: address NULL dereference and memory leaks
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/15910)
2021-06-26 11:33:52 +10:00
Pauli
d4af922c58 apps: properly initialise arguments to EVP_PKEY_get_bn_param()
This avoids use of uninitialised memory.

Follow on to #15900

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15908)
2021-06-26 11:32:38 +10:00
Tomas Mraz
a31350c07c Update fips sources and checksums
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15903)
2021-06-26 11:31:08 +10:00
Tomas Mraz
f870a1f898 Only the fips module dependencies are relevant for fips.module.sources
Fixes #15639

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15903)
2021-06-26 11:31:08 +10:00
Dr. David von Oheimb
5fc0992fc7 Fix file_name_check() in storemgmt/file_store.c and e_loader_attic.c
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15892)
2021-06-25 12:21:36 +02:00
yunh
d5567d5f6e enable getauxval on android 10
Fixes #9498

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

(cherry picked from commit b2dea4d5f2)
2021-06-25 18:31:05 +10:00