deps: upgrade openssl sources to quictls/openssl-3.0.3

This updates all sources in deps/openssl/openssl by:
    $ git clone git@github.com:quictls/openssl.git
    $ cd openssl
    $ git checkout openssl-3.0.3+quic
    $ cd ../node/deps/openssl
    $ rm -rf openssl
    $ cp -R ../../../openssl openssl
    $ rm -rf openssl/.git* openssl/.travis*
    $ git add --all openssl
    $ git commit openssl

PR-URL: https://github.com/nodejs/node/pull/43022
Refs: https://mta.openssl.org/pipermail/openssl-announce/2022-May/000223.html
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
This commit is contained in:
RafaelGSS committed 2022-05-12 09:15:21 -03:00
1 parent 8e0f3ff7f7
commit d82eaf839c
220 files changed
+2186 -912

No files matched your search

+109 -1
View File
@@ -28,12 +28,120 @@ breaking changes, and mappings for the large list of deprecated functions.
[Migration guide]: https://github.com/openssl/openssl/tree/master/doc/man7/migration_guide.pod
### Changes between 3.0.2 and 3.0.2+quic [15 Mar 2022]
### Changes between 3.0.3 and 3.0.3+quic [3 May 2022]
* Add QUIC API support from BoringSSL.
*Todd Short*
### Changes between 3.0.2 and 3.0.3 [3 May 2022]
* Fixed a bug in the c_rehash script which was not properly sanitising shell
metacharacters to prevent command injection. This script is distributed by
some operating systems in a manner where it is automatically executed. On
such operating systems, an attacker could execute arbitrary commands with the
privileges of the script.
Use of the c_rehash script is considered obsolete and should be replaced
by the OpenSSL rehash command line tool.
(CVE-2022-1292)
*Tomáš Mráz*
* Fixed a bug in the function `OCSP_basic_verify` that verifies the signer
certificate on an OCSP response. The bug caused the function in the case
where the (non-default) flag OCSP_NOCHECKS is used to return a postivie
response (meaning a successful verification) even in the case where the
response signing certificate fails to verify.
It is anticipated that most users of `OCSP_basic_verify` will not use the
OCSP_NOCHECKS flag. In this case the `OCSP_basic_verify` function will return
a negative value (indicating a fatal error) in the case of a certificate
verification failure. The normal expected return value in this case would be
0.
This issue also impacts the command line OpenSSL "ocsp" application. When
verifying an ocsp response with the "-no_cert_checks" option the command line
application will report that the verification is successful even though it
has in fact failed. In this case the incorrect successful response will also
be accompanied by error messages showing the failure and contradicting the
apparently successful result.
([CVE-2022-1343])
*Matt Caswell*
* Fixed a bug where the RC4-MD5 ciphersuite incorrectly used the
AAD data as the MAC key. This made the MAC key trivially predictable.
An attacker could exploit this issue by performing a man-in-the-middle attack
to modify data being sent from one endpoint to an OpenSSL 3.0 recipient such
that the modified data would still pass the MAC integrity check.
Note that data sent from an OpenSSL 3.0 endpoint to a non-OpenSSL 3.0
endpoint will always be rejected by the recipient and the connection will
fail at that point. Many application protocols require data to be sent from
the client to the server first. Therefore, in such a case, only an OpenSSL
3.0 server would be impacted when talking to a non-OpenSSL 3.0 client.
If both endpoints are OpenSSL 3.0 then the attacker could modify data being
sent in both directions. In this case both clients and servers could be
affected, regardless of the application protocol.
Note that in the absence of an attacker this bug means that an OpenSSL 3.0
endpoint communicating with a non-OpenSSL 3.0 endpoint will fail to complete
the handshake when using this ciphersuite.
The confidentiality of data is not impacted by this issue, i.e. an attacker
cannot decrypt data that has been encrypted using this ciphersuite - they can
only modify it.
In order for this attack to work both endpoints must legitimately negotiate
the RC4-MD5 ciphersuite. This ciphersuite is not compiled by default in
OpenSSL 3.0, and is not available within the default provider or the default
ciphersuite list. This ciphersuite will never be used if TLSv1.3 has been
negotiated. In order for an OpenSSL 3.0 endpoint to use this ciphersuite the
following must have occurred:
1) OpenSSL must have been compiled with the (non-default) compile time option
enable-weak-ssl-ciphers
2) OpenSSL must have had the legacy provider explicitly loaded (either
through application code or via configuration)
3) The ciphersuite must have been explicitly added to the ciphersuite list
4) The libssl security level must have been set to 0 (default is 1)
5) A version of SSL/TLS below TLSv1.3 must have been negotiated
6) Both endpoints must negotiate the RC4-MD5 ciphersuite in preference to any
others that both endpoints have in common
(CVE-2022-1434)
*Matt Caswell*
* Fix a bug in the OPENSSL_LH_flush() function that breaks reuse of the memory
occuppied by the removed hash table entries.
This function is used when decoding certificates or keys. If a long lived
process periodically decodes certificates or keys its memory usage will
expand without bounds and the process might be terminated by the operating
system causing a denial of service. Also traversing the empty hash table
entries will take increasingly more time.
Typically such long lived processes might be TLS clients or TLS servers
configured to accept client certificate authentication.
(CVE-2022-1473)
*Hugo Landau, Aliaksei Levin*
* The functions `OPENSSL_LH_stats` and `OPENSSL_LH_stats_bio` now only report
the `num_items`, `num_nodes` and `num_alloc_nodes` statistics. All other
statistics are no longer supported. For compatibility, these statistics are
still listed in the output but are now always reported as zero.
*Hugo Landau*
### Changes between 3.0.1 and 3.0.2 [15 Mar 2022]
* Fixed a bug in the BN_mod_sqrt() function that can cause it to loop forever
+1 -1
View File
@@ -60,7 +60,7 @@ guidelines:
GitHub Actions and AppVeyor are required, and they are started automatically
whenever a PR is created or updated.
[coding style]: https://www.openssl.org/policies/codingstyle.html
[coding style]: https://www.openssl.org/policies/technical/coding-style.html
5. When at all possible, patches should include tests. These can
either be added to an existing test, or completely new. Please see
+1 -1
View File
@@ -25,5 +25,5 @@ sub staticname {
return $in_libname
if $unified_info{attributes}->{libraries}->{$_[1]}->{noinst};
return platform::BASE->staticname($_[1]) . '_a';
return platform::BASE->staticname($_[1]) . ($disabled{shared} ? '' : '_a');
}
+11
View File
@@ -18,6 +18,17 @@ OpenSSL Releases
OpenSSL 3.0
-----------
### Major changes between OpenSSL 3.0.2 and OpenSSL 3.0.3 [3 May 2022]
* Fixed a bug in the c_rehash script which was not properly sanitising shell
metacharacters to prevent command injection ([CVE-2022-1292])
* Fixed a bug in the function `OCSP_basic_verify` that verifies the signer
certificate on an OCSP response ([CVE-2022-1343])
* Fixed a bug where the RC4-MD5 ciphersuite incorrectly used the
AAD data as the MAC key ([CVE-2022-1434])
* Fix a bug in the OPENSSL_LH_flush() function that breaks reuse of the memory
occuppied by the removed hash table entries ([CVE-2022-1473])
### Major changes between OpenSSL 3.0.1 and OpenSSL 3.0.2 [15 Mar 2022]
* Fixed a bug in the BN_mod_sqrt() function that can cause it to loop forever
+47 -37
View File
@@ -28,12 +28,12 @@ For this option you can use Cygwin.
Native builds using Visual C++
==============================
The native builds using Visual C++ have a VC-* prefix.
The native builds using Visual C++ have a `VC-*` prefix.
Requirement details
-------------------
In addition to the requirements and instructions listed in INSTALL.md,
In addition to the requirements and instructions listed in `INSTALL.md`,
these are required as well:
### Perl
@@ -64,22 +64,26 @@ Quick start
4. Use Visual Studio Developer Command Prompt with administrative privileges,
choosing one of its variants depending on the intended architecture.
Or run "cmd" and execute "vcvarsall.bat" with one of the options x86,
x86_amd64, x86_arm, x86_arm64, amd64, amd64_x86, amd64_arm, or amd64_arm64.
This sets up the environment variables needed for nmake.exe, cl.exe, etc.
Or run `cmd` and execute `vcvarsall.bat` with one of the options `x86`,
`x86_amd64`, `x86_arm`, `x86_arm64`, `amd64`, `amd64_x86`, `amd64_arm`,
or `amd64_arm64`.
This sets up the environment variables needed for `nmake.exe`, `cl.exe`,
etc.
See also
<https://docs.microsoft.com/cpp/build/building-on-the-command-line>
5. From the root of the OpenSSL source directory enter
perl Configure VC-WIN32 if you want 32-bit OpenSSL or
perl Configure VC-WIN64A if you want 64-bit OpenSSL or
perl Configure to let Configure figure out the platform
- `perl Configure VC-WIN32` if you want 32-bit OpenSSL or
- `perl Configure VC-WIN64A` if you want 64-bit OpenSSL or
- `perl Configure VC-WIN64-ARM` if you want Windows on Arm (win-arm64)
OpenSSL or
- `perl Configure` to let Configure figure out the platform
6. nmake
6. `nmake`
7. nmake test
7. `nmake test`
8. nmake install
8. `nmake install`
For the full installation instructions, or if anything goes wrong at any stage,
check the INSTALL.md file.
@@ -109,25 +113,25 @@ installation for examples), these fallbacks are used:
ALSO NOTE that those directories are usually write protected, even if
your account is in the Administrators group. To work around that,
start the command prompt by right-clicking on it and choosing "Run as
Administrator" before running 'nmake install'. The other solution
Administrator" before running `nmake install`. The other solution
is, of course, to choose a different set of directories by using
--prefix and --openssldir when configuring.
`--prefix` and `--openssldir` when configuring.
Special notes for Universal Windows Platform builds, aka VC-*-UWP
--------------------------------------------------------------------
Special notes for Universal Windows Platform builds, aka `VC-*-UWP`
-------------------------------------------------------------------
- UWP targets only support building the static and dynamic libraries.
- You should define the platform type to "uwp" and the target arch via
"vcvarsall.bat" before you compile. For example, if you want to build
"arm64" builds, you should run "vcvarsall.bat x86_arm64 uwp".
- You should define the platform type to `uwp` and the target arch via
`vcvarsall.bat` before you compile. For example, if you want to build
`arm64` builds, you should run `vcvarsall.bat x86_arm64 uwp`.
Native builds using Embarcadero C++Builder
=========================================
This toolchain (a descendant of Turbo/Borland C++) is an alternative to MSVC.
OpenSSL currently includes an experimental 32-bit configuration targeting the
Clang-based compiler (bcc32c.exe) in v10.3.3 Community Edition.
Clang-based compiler (`bcc32c.exe`) in v10.3.3 Community Edition.
<https://www.embarcadero.com/products/cbuilder/starter>
1. Install Perl.
@@ -135,11 +139,11 @@ Clang-based compiler (bcc32c.exe) in v10.3.3 Community Edition.
2. Open the RAD Studio Command Prompt.
3. Go to the root of the OpenSSL source directory and run:
perl Configure BC-32 --prefix=%CD%
`perl Configure BC-32 --prefix=%CD%`
4. make -N
4. `make -N`
5. make -N test
5. `make -N test`
6. Build your program against this OpenSSL:
* Set your include search path to the "include" subdirectory of OpenSSL.
@@ -166,9 +170,9 @@ MinGW offers an alternative way to build native OpenSSL, by cross compilation.
- Perl, at least version 5.10.0, which usually comes pre-installed with MSYS2
- make, installed using "pacman -S make" into the MSYS2 environment
- make, installed using `pacman -S make` into the MSYS2 environment
- MinGW[64] compiler: mingw-w64-i686-gcc and/or mingw-w64-x86_64-gcc.
- MinGW[64] compiler: `mingw-w64-i686-gcc` and/or `mingw-w64-x86_64-gcc`.
These compilers must be on your MSYS2 $PATH.
A common error is to not have these on your $PATH.
The MSYS2 version of gcc will not work correctly here.
@@ -176,22 +180,28 @@ MinGW offers an alternative way to build native OpenSSL, by cross compilation.
In the MSYS2 shell do the configuration depending on the target architecture:
./Configure mingw ...
or
./Configure mingw64 ...
or
./Configure ...
for the default architecture.
Apart from that, follow the Unix / Linux instructions in INSTALL.md.
Apart from that, follow the Unix / Linux instructions in `INSTALL.md`.
* It is also possible to build mingw[64] on Linux or Cygwin.
In this case configure with the corresponding --cross-compile-prefix= option.
For example
In this case configure with the corresponding `--cross-compile-prefix=`
option. For example
./Configure mingw --cross-compile-prefix=i686-w64-mingw32- ...
or
./Configure mingw64 --cross-compile-prefix=x86_64-w64-mingw32- ...
This requires that you've installed the necessary add-on packages for
@@ -203,18 +213,18 @@ Linking native applications
This section applies to all native builds.
If you link with static OpenSSL libraries then you're expected to
additionally link your application with WS2_32.LIB, GDI32.LIB,
ADVAPI32.LIB, CRYPT32.LIB and USER32.LIB. Those developing
additionally link your application with `WS2_32.LIB`, `GDI32.LIB`,
`ADVAPI32.LIB`, `CRYPT32.LIB` and `USER32.LIB`. Those developing
non-interactive service applications might feel concerned about
linking with GDI32.LIB and USER32.LIB, as they are justly associated
linking with `GDI32.LIB` and `USER32.LIB`, as they are justly associated
with interactive desktop, which is not available to service
processes. The toolkit is designed to detect in which context it's
currently executed, GUI, console app or service, and act accordingly,
namely whether or not to actually make GUI calls. Additionally those
who wish to /DELAYLOAD:GDI32.DLL and /DELAYLOAD:USER32.DLL and
who wish to `/DELAYLOAD:GDI32.DLL` and `/DELAYLOAD:USER32.DLL` and
actually keep them off service process should consider implementing
and exporting from .exe image in question own _OPENSSL_isservice not
relying on USER32.DLL. E.g., on Windows Vista and later you could:
and exporting from .exe image in question own `_OPENSSL_isservice` not
relying on `USER32.DLL`. E.g., on Windows Vista and later you could:
__declspec(dllexport) __cdecl BOOL _OPENSSL_isservice(void)
{
@@ -233,7 +243,7 @@ See also the OPENSSL_Applink manual page.
Hosted builds using Cygwin
==========================
Cygwin implements a POSIX/Unix runtime system (cygwin1.dll) on top of the
Cygwin implements a POSIX/Unix runtime system (`cygwin1.dll`) on top of the
Windows subsystem and provides a Bash shell and GNU tools environment.
Consequently, a build of OpenSSL with Cygwin is virtually identical to the
Unix procedure.
@@ -249,7 +259,7 @@ To build OpenSSL using Cygwin, you need to:
Apart from that, follow the Unix / Linux instructions in INSTALL.md.
NOTE: "make test" and normal file operations may fail in directories
mounted as text (i.e. mount -t c:\somewhere /home) due to Cygwin
NOTE: `make test` and normal file operations may fail in directories
mounted as text (i.e. `mount -t c:\somewhere /home`) due to Cygwin
stripping of carriage returns. To avoid this ensure that a binary
mount is used, e.g. mount -b c:\somewhere /home.
mount is used, e.g. `mount -b c:\somewhere /home`.
+1 -1
View File
@@ -4,7 +4,7 @@ What This Is
This is a fork of [OpenSSL](https://www.openssl.org) to enable QUIC. In addition
to the website, the official source distribution is at
<https://github.com/openssl/openssl>. The OpenSSL `README` can be found at
[README-OpenSSL.md](https://github.com/quictls/openssl/blob/openssl-3.0.2%2Bquic/README-OpenSSL.md)
[README-OpenSSL.md](https://github.com/quictls/openssl/blob/openssl-3.0.3%2Bquic/README-OpenSSL.md)
This fork adds APIs that can be used by QUIC implementations for connection
handshakes. Quoting the IETF Working group
+2 -2
View File
@@ -1,7 +1,7 @@
MAJOR=3
MINOR=0
PATCH=2
PATCH=3
PRE_RELEASE_TAG=
BUILD_METADATA=quic
RELEASE_DATE="15 Mar 2022"
RELEASE_DATE="3 May 2022"
SHLIB_VERSION=81.3
+3 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -2367,7 +2367,7 @@ static char *make_revocation_str(REVINFO_TYPE rev_type, const char *rev_arg)
case REV_CRL_REASON:
for (i = 0; i < 8; i++) {
if (strcasecmp(rev_arg, crl_reasons[i]) == 0) {
if (OPENSSL_strcasecmp(rev_arg, crl_reasons[i]) == 0) {
reason = crl_reasons[i];
break;
}
@@ -2584,7 +2584,7 @@ int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
}
if (reason_str) {
for (i = 0; i < NUM_REASONS; i++) {
if (strcasecmp(reason_str, crl_reasons[i]) == 0) {
if (OPENSSL_strcasecmp(reason_str, crl_reasons[i]) == 0) {
reason_code = i;
break;
}
+1 -1
View File
@@ -1745,7 +1745,7 @@ static int handle_opt_geninfo(OSSL_CMP_CTX *ctx)
valptr[0] = '\0';
valptr++;
if (strncasecmp(valptr, "int:", 4) != 0) {
if (OPENSSL_strncasecmp(valptr, "int:", 4) != 0) {
CMP_err("missing 'int:' in -geninfo option");
return 0;
}
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2002-2022 The OpenSSL Project Authors. All Rights Reserved.
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
@@ -229,7 +229,7 @@ int ecparam_main(int argc, char **argv)
point_format, 0);
*p = OSSL_PARAM_construct_end();
if (strcasecmp(curve_name, "SM2") == 0)
if (OPENSSL_strcasecmp(curve_name, "SM2") == 0)
gctx_params = EVP_PKEY_CTX_new_from_name(NULL, "sm2", NULL);
else
gctx_params = EVP_PKEY_CTX_new_from_name(NULL, "ec", NULL);
+8 -8
View File
@@ -688,8 +688,8 @@ int load_cert_certs(const char *uri,
int ret = 0;
char *pass_string;
if (exclude_http && (strncasecmp(uri, "http://", 7) == 0
|| strncasecmp(uri, "https://", 8) == 0)) {
if (exclude_http && (OPENSSL_strncasecmp(uri, "http://", 7) == 0
|| OPENSSL_strncasecmp(uri, "https://", 8) == 0)) {
BIO_printf(bio_err, "error: HTTP retrieval not allowed for %s\n", desc);
return ret;
}
@@ -1182,20 +1182,20 @@ int set_name_ex(unsigned long *flags, const char *arg)
int set_dateopt(unsigned long *dateopt, const char *arg)
{
if (strcasecmp(arg, "rfc_822") == 0)
if (OPENSSL_strcasecmp(arg, "rfc_822") == 0)
*dateopt = ASN1_DTFLGS_RFC822;
else if (strcasecmp(arg, "iso_8601") == 0)
else if (OPENSSL_strcasecmp(arg, "iso_8601") == 0)
*dateopt = ASN1_DTFLGS_ISO8601;
return 0;
}
int set_ext_copy(int *copy_type, const char *arg)
{
if (strcasecmp(arg, "none") == 0)
if (OPENSSL_strcasecmp(arg, "none") == 0)
*copy_type = EXT_COPY_NONE;
else if (strcasecmp(arg, "copy") == 0)
else if (OPENSSL_strcasecmp(arg, "copy") == 0)
*copy_type = EXT_COPY_ADD;
else if (strcasecmp(arg, "copyall") == 0)
else if (OPENSSL_strcasecmp(arg, "copyall") == 0)
*copy_type = EXT_COPY_ALL;
else
return 0;
@@ -1275,7 +1275,7 @@ static int set_table_opts(unsigned long *flags, const char *arg,
}
for (ptbl = in_tbl; ptbl->name; ptbl++) {
if (strcasecmp(arg, ptbl->name) == 0) {
if (OPENSSL_strcasecmp(arg, ptbl->name) == 0) {
*flags &= ~ptbl->mask;
if (c)
*flags |= ptbl->flag;
+1 -1
View File
@@ -71,7 +71,7 @@ static OSSL_STORE_LOADER_CTX *engine_open(const OSSL_STORE_LOADER *loader,
char *keyid = NULL;
OSSL_STORE_LOADER_CTX *ctx = NULL;
if (strncasecmp(p, ENGINE_SCHEME_COLON, sizeof(ENGINE_SCHEME_COLON) - 1)
if (OPENSSL_strncasecmp(p, ENGINE_SCHEME_COLON, sizeof(ENGINE_SCHEME_COLON) - 1)
!= 0)
return NULL;
p += sizeof(ENGINE_SCHEME_COLON) - 1;
+5 -4
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -453,10 +453,11 @@ int http_server_get_asn1_req(const ASN1_ITEM *it, ASN1_VALUE **preq,
}
*line_end = '\0';
/* https://tools.ietf.org/html/rfc7230#section-6.3 Persistence */
if (found_keep_alive != NULL && strcasecmp(key, "Connection") == 0) {
if (strcasecmp(value, "keep-alive") == 0)
if (found_keep_alive != NULL
&& OPENSSL_strcasecmp(key, "Connection") == 0) {
if (OPENSSL_strcasecmp(value, "keep-alive") == 0)
*found_keep_alive = 1;
else if (strcasecmp(value, "close") == 0)
else if (OPENSSL_strcasecmp(value, "close") == 0)
*found_keep_alive = 0;
}
}
+3 -6
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2019-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -11,14 +11,11 @@
#include <openssl/bio.h>
#include <openssl/safestack.h>
#include "names.h"
#ifdef _WIN32
# define strcasecmp _stricmp
#endif
#include "openssl/crypto.h"
int name_cmp(const char * const *a, const char * const *b)
{
return strcasecmp(*a, *b);
return OPENSSL_strcasecmp(*a, *b);
}
void collect_names(const char *name, void *vdata)
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2016-2022 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2016 VMS Software, Inc. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
@@ -132,7 +132,7 @@ int main (int argc, char *argv[], char *envp[])
len;
LogMessage ("Enter 'q' or 'Q' to quit ...");
while (strcasecmp (TermBuff, "Q")) {
while (OPENSSL_strcasecmp (TermBuff, "Q")) {
/*
** Create the terminal socket
*/
+5 -5
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -71,7 +71,7 @@ static void legacy_cipher_fn(const EVP_CIPHER *c,
{
if (select_name != NULL
&& (c == NULL
|| strcasecmp(select_name, EVP_CIPHER_get0_name(c)) != 0))
|| OPENSSL_strcasecmp(select_name, EVP_CIPHER_get0_name(c)) != 0))
return;
if (c != NULL) {
BIO_printf(arg, " %s\n", EVP_CIPHER_get0_name(c));
@@ -370,7 +370,7 @@ DEFINE_STACK_OF(EVP_RAND)
static int rand_cmp(const EVP_RAND * const *a, const EVP_RAND * const *b)
{
int ret = strcasecmp(EVP_RAND_get0_name(*a), EVP_RAND_get0_name(*b));
int ret = OPENSSL_strcasecmp(EVP_RAND_get0_name(*a), EVP_RAND_get0_name(*b));
if (ret == 0)
ret = strcmp(OSSL_PROVIDER_get0_name(EVP_RAND_get0_provider(*a)),
@@ -404,7 +404,7 @@ static void list_random_generators(void)
const EVP_RAND *m = sk_EVP_RAND_value(rands, i);
if (select_name != NULL
&& strcasecmp(EVP_RAND_get0_name(m), select_name) != 0)
&& OPENSSL_strcasecmp(EVP_RAND_get0_name(m), select_name) != 0)
continue;
BIO_printf(bio_out, " %s", EVP_RAND_get0_name(m));
BIO_printf(bio_out, " @ %s\n",
@@ -463,7 +463,7 @@ static void display_random(const char *name, EVP_RAND_CTX *drbg)
if (gettables != NULL)
for (; gettables->key != NULL; gettables++) {
/* State has been dealt with already, so ignore */
if (strcasecmp(gettables->key, OSSL_RAND_PARAM_STATE) == 0)
if (OPENSSL_strcasecmp(gettables->key, OSSL_RAND_PARAM_STATE) == 0)
continue;
/* Outside of verbose mode, we skip non-string values */
if (gettables->data_type != OSSL_PARAM_UTF8_STRING
+5
View File
@@ -1115,6 +1115,11 @@ static void make_ocsp_response(BIO *err, OCSP_RESPONSE **resp, OCSP_REQUEST *req
single = OCSP_basic_add1_status(bs, cid,
V_OCSP_CERTSTATUS_REVOKED,
reason, revtm, thisupd, nextupd);
if (single == NULL) {
*resp = OCSP_response_create(OCSP_RESPONSE_STATUS_INTERNALERROR,
NULL);
goto end;
}
if (invtm != NULL)
OCSP_SINGLERESP_add1_ext_i2d(single, NID_invalidity_date,
invtm, 0, 0);
+2 -2
View File
@@ -214,7 +214,7 @@ static int handle_symlink(const char *filename, const char *fullpath)
return -1;
for (type = OSSL_NELEM(suffixes) - 1; type > 0; type--) {
const char *suffix = suffixes[type];
if (strncasecmp(suffix, &filename[i], strlen(suffix)) == 0)
if (OPENSSL_strncasecmp(suffix, &filename[i], strlen(suffix)) == 0)
break;
}
i += strlen(suffixes[type]);
@@ -249,7 +249,7 @@ static int do_file(const char *filename, const char *fullpath, enum Hash h)
if ((ext = strrchr(filename, '.')) == NULL)
goto end;
for (i = 0; i < OSSL_NELEM(extensions); i++) {
if (strcasecmp(extensions[i], ext + 1) == 0)
if (OPENSSL_strcasecmp(extensions[i], ext + 1) == 0)
break;
}
if (i >= OSSL_NELEM(extensions))
+1 -1
View File
@@ -992,7 +992,7 @@ int req_main(int argc, char **argv)
goto end;
}
fprintf(stdout, "Modulus=");
if (EVP_PKEY_is_a(tpubkey, "RSA")) {
if (EVP_PKEY_is_a(tpubkey, "RSA") || EVP_PKEY_is_a(tpubkey, "RSA-PSS")) {
BIGNUM *n = NULL;
if (!EVP_PKEY_get_bn_param(tpubkey, "n", &n))
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -257,7 +257,7 @@ int rsa_main(int argc, char **argv)
ERR_print_errors(bio_err);
goto end;
}
if (!EVP_PKEY_is_a(pkey, "RSA")) {
if (!EVP_PKEY_is_a(pkey, "RSA") && !EVP_PKEY_is_a(pkey, "RSA-PSS")) {
BIO_printf(bio_err, "Not an RSA key\n");
goto end;
}
+1 -1
View File
@@ -432,7 +432,7 @@ static int ssl_servername_cb(SSL *s, int *ad, void *arg)
return SSL_TLSEXT_ERR_NOACK;
if (servername != NULL) {
if (strcasecmp(servername, p->servername))
if (OPENSSL_strcasecmp(servername, p->servername))
return p->extension_error;
if (ctx2 != NULL) {
BIO_printf(p->biodebug, "Switching server context.\n");
+5 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2006-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -976,6 +976,10 @@ static X509_STORE *create_cert_store(const char *CApath, const char *CAfile,
const char *propq = app_get0_propq();
cert_ctx = X509_STORE_new();
if (cert_ctx == NULL) {
BIO_printf(bio_err, "memory allocation failure\n");
return NULL;
}
X509_STORE_set_verify_cb(cert_ctx, verify_cb);
if (CApath != NULL) {
lookup = X509_STORE_add_lookup(cert_ctx, X509_LOOKUP_hash_dir());
+1 -1
View File
@@ -954,7 +954,7 @@ int x509_main(int argc, char **argv)
purpose_print(out, x, X509_PURPOSE_get0(j));
} else if (i == modulus) {
BIO_printf(out, "Modulus=");
if (EVP_PKEY_is_a(pkey, "RSA")) {
if (EVP_PKEY_is_a(pkey, "RSA") || EVP_PKEY_is_a(pkey, "RSA-PSS")) {
BIGNUM *n = NULL;
/* Every RSA key has an 'n' */
+3 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2004-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2004-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -141,7 +141,8 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory)
p--;
if (p > (*ctx)->entry_name && p[-1] == ';')
p[-1] = '\0';
if (strcasecmp((*ctx)->entry_name, (*ctx)->previous_entry_name) == 0)
if (OPENSSL_strcasecmp((*ctx)->entry_name,
(*ctx)->previous_entry_name) == 0)
goto again;
}
#endif
+2 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2006-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -10,7 +10,6 @@
/* We need to use some engine deprecated APIs */
#define OPENSSL_SUPPRESS_DEPRECATED
#include "e_os.h" /* for strncasecmp */
#include "internal/cryptlib.h"
#include <stdio.h>
#include <openssl/asn1t.h>
@@ -134,7 +133,7 @@ const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(ENGINE **pe,
if (ameth->pkey_flags & ASN1_PKEY_ALIAS)
continue;
if ((int)strlen(ameth->pem_str) == len
&& strncasecmp(ameth->pem_str, str, len) == 0)
&& OPENSSL_strncasecmp(ameth->pem_str, str, len) == 0)
return ameth;
}
return NULL;
+3 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2002-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -10,7 +10,6 @@
#include "internal/cryptlib.h"
#include <openssl/asn1.h>
#include <openssl/x509v3.h>
#include "e_os.h" /* strncasecmp() */
#define ASN1_GEN_FLAG 0x10000
#define ASN1_GEN_FLAG_IMP (ASN1_GEN_FLAG|1)
@@ -565,7 +564,8 @@ static int asn1_str2tag(const char *tagstr, int len)
tntmp = tnst;
for (i = 0; i < OSSL_NELEM(tnst); i++, tntmp++) {
if ((len == tntmp->len) && (strncasecmp(tntmp->strnam, tagstr, len) == 0))
if ((len == tntmp->len)
&& (OPENSSL_strncasecmp(tntmp->strnam, tagstr, len) == 0))
return tntmp->tag;
}
+5 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -446,8 +446,10 @@ int bn_div_fixed_top(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
snum->neg = num_neg;
snum->top = div_n;
snum->flags |= BN_FLG_FIXED_TOP;
if (rm != NULL)
bn_rshift_fixed_top(rm, snum, norm_shift);
if (rm != NULL && bn_rshift_fixed_top(rm, snum, norm_shift) == 0)
goto err;
BN_CTX_end(ctx);
return 1;
err:
+3 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -187,13 +187,14 @@ int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
return ret;
}
BN_RECP_CTX_init(&recp);
BN_CTX_start(ctx);
aa = BN_CTX_get(ctx);
val[0] = BN_CTX_get(ctx);
if (val[0] == NULL)
goto err;
BN_RECP_CTX_init(&recp);
if (m->neg) {
/* ignore sign of 'm' */
if (!BN_copy(aa, m))
+4 -4
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2006-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -499,9 +499,9 @@ void Camellia_DecryptBlock_Rounds(int grandRounds, const u8 ciphertext[],
PUTU32(plaintext + 12, s1);
}
void Camellia_DecryptBlock(int keyBitLength, const u8 plaintext[],
const KEY_TABLE_TYPE keyTable, u8 ciphertext[])
void Camellia_DecryptBlock(int keyBitLength, const u8 ciphertext[],
const KEY_TABLE_TYPE keyTable, u8 plaintext[])
{
Camellia_DecryptBlock_Rounds(keyBitLength == 128 ? 3 : 4,
plaintext, keyTable, ciphertext);
ciphertext, keyTable, plaintext);
}
+2 -2
View File
@@ -5,7 +5,7 @@ IF[{- !$disabled{asm} -}]
$CHACHAASM_x86=chacha-x86.s
$CHACHAASM_x86_64=chacha-x86_64.s
$CHACHAASM_ia64=chacha-ia64.S
$CHACHAASM_ia64=chacha-ia64.s
$CHACHAASM_s390x=chacha-s390x.S
@@ -36,4 +36,4 @@ INCLUDE[chacha-armv8.o]=..
INCLUDE[chacha-s390x.o]=..
GENERATE[chacha-c64xplus.S]=asm/chacha-c64xplus.pl
GENERATE[chacha-s390x.S]=asm/chacha-s390x.pl
GENERATE[chacha-ia64.S]=asm/chacha-ia64.pl
GENERATE[chacha-ia64.s]=asm/chacha-ia64.pl
+9 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2008-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2008-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -41,8 +41,11 @@ CMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms)
ci = ASN1_item_d2i_bio_ex(ASN1_ITEM_rptr(CMS_ContentInfo), bp, cms,
ossl_cms_ctx_get0_libctx(ctx),
ossl_cms_ctx_get0_propq(ctx));
if (ci != NULL)
if (ci != NULL) {
ERR_set_mark();
ossl_cms_resolve_libctx(ci);
ERR_pop_to_mark();
}
return ci;
}
@@ -104,8 +107,11 @@ CMS_ContentInfo *SMIME_read_CMS_ex(BIO *bio, int flags, BIO **bcont,
(ASN1_VALUE **)cms,
ossl_cms_ctx_get0_libctx(ctx),
ossl_cms_ctx_get0_propq(ctx));
if (ci != NULL)
if (ci != NULL) {
ERR_set_mark();
ossl_cms_resolve_libctx(ci);
ERR_pop_to_mark();
}
return ci;
}
+10 -8
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -11,7 +11,7 @@
#include <stdio.h>
#include <string.h>
#include "e_os.h" /* strcasecmp and struct stat */
#include "e_os.h" /* struct stat */
#ifdef __TANDEM
# include <sys/types.h> /* needed for stat.h */
# include <sys/stat.h> /* struct stat */
@@ -192,11 +192,11 @@ static int def_load(CONF *conf, const char *name, long *line)
/* Parse a boolean value and fill in *flag. Return 0 on error. */
static int parsebool(const char *pval, int *flag)
{
if (strcasecmp(pval, "on") == 0
|| strcasecmp(pval, "true") == 0) {
if (OPENSSL_strcasecmp(pval, "on") == 0
|| OPENSSL_strcasecmp(pval, "true") == 0) {
*flag = 1;
} else if (strcasecmp(pval, "off") == 0
|| strcasecmp(pval, "false") == 0) {
} else if (OPENSSL_strcasecmp(pval, "off") == 0
|| OPENSSL_strcasecmp(pval, "false") == 0) {
*flag = 0;
} else {
ERR_raise(ERR_LIB_CONF, CONF_R_INVALID_PRAGMA);
@@ -839,8 +839,10 @@ static BIO *get_next_file(const char *path, OPENSSL_DIR_CTX **dirctx)
namelen = strlen(filename);
if ((namelen > 5 && strcasecmp(filename + namelen - 5, ".conf") == 0)
|| (namelen > 4 && strcasecmp(filename + namelen - 4, ".cnf") == 0)) {
if ((namelen > 5
&& OPENSSL_strcasecmp(filename + namelen - 5, ".conf") == 0)
|| (namelen > 4
&& OPENSSL_strcasecmp(filename + namelen - 4, ".cnf") == 0)) {
size_t newlen;
char *newpath;
BIO *bio;
+3 -1
View File
@@ -14,6 +14,7 @@
#include "internal/core.h"
#include "internal/bio.h"
#include "internal/provider.h"
#include "crypto/ctype.h"
struct ossl_lib_ctx_onfree_list_st {
ossl_lib_ctx_onfree_fn *fn;
@@ -150,7 +151,8 @@ static CRYPTO_THREAD_LOCAL default_context_thread_local;
DEFINE_RUN_ONCE_STATIC(default_context_do_init)
{
return CRYPTO_THREAD_init_local(&default_context_thread_local, NULL)
&& context_init(&default_context_int);
&& context_init(&default_context_int)
&& ossl_init_casecmp();
}
void ossl_lib_ctx_default_deinit(void)
+1 -2
View File
@@ -7,7 +7,6 @@
* https://www.openssl.org/source/license.html
*/
#include "e_os.h" /* strcasecmp */
#include "internal/namemap.h"
#include <openssl/lhash.h>
#include "crypto/lhash.h" /* ossl_lh_strcasehash */
@@ -49,7 +48,7 @@ static unsigned long namenum_hash(const NAMENUM_ENTRY *n)
static int namenum_cmp(const NAMENUM_ENTRY *a, const NAMENUM_ENTRY *b)
{
return strcasecmp(a->name, b->name);
return OPENSSL_strcasecmp(a->name, b->name);
}
static void namenum_free(NAMENUM_ENTRY *n)
+101 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2017-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -12,6 +12,19 @@
#include "crypto/ctype.h"
#include <openssl/ebcdic.h>
#include <openssl/crypto.h>
#include "internal/core.h"
#include "internal/thread_once.h"
#ifndef OPENSSL_SYS_WINDOWS
#include <strings.h>
#endif
#include <locale.h>
#ifdef OPENSSL_SYS_MACOSX
#include <xlocale.h>
#endif
/*
* Define the character classes for each character in the seven bit ASCII
* character set. This is independent of the host's character set, characters
@@ -278,3 +291,90 @@ int ossl_ascii_isdigit(const char inchar) {
return 1;
return 0;
}
/* str[n]casecmp_l is defined in POSIX 2008-01. Value is taken accordingly
* https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html */
#if (defined OPENSSL_SYS_WINDOWS) || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200809L)
# if defined OPENSSL_SYS_WINDOWS
# define locale_t _locale_t
# define freelocale _free_locale
# define strcasecmp_l _stricmp_l
# define strncasecmp_l _strnicmp_l
# endif
# ifndef FIPS_MODULE
static locale_t loc;
static int locale_base_inited = 0;
static CRYPTO_ONCE locale_base = CRYPTO_ONCE_STATIC_INIT;
static CRYPTO_ONCE locale_base_deinit = CRYPTO_ONCE_STATIC_INIT;
void *ossl_c_locale() {
return (void *)loc;
}
DEFINE_RUN_ONCE_STATIC(ossl_init_locale_base)
{
# ifdef OPENSSL_SYS_WINDOWS
loc = _create_locale(LC_COLLATE, "C");
# else
loc = newlocale(LC_COLLATE_MASK, "C", (locale_t) 0);
# endif
locale_base_inited = 1;
return (loc == (locale_t) 0) ? 0 : 1;
}
DEFINE_RUN_ONCE_STATIC(ossl_deinit_locale_base)
{
if (locale_base_inited && loc) {
freelocale(loc);
loc = NULL;
}
return 1;
}
int ossl_init_casecmp()
{
return RUN_ONCE(&locale_base, ossl_init_locale_base);
}
void ossl_deinit_casecmp() {
(void)RUN_ONCE(&locale_base_deinit, ossl_deinit_locale_base);
}
# endif
int OPENSSL_strcasecmp(const char *s1, const char *s2)
{
return strcasecmp_l(s1, s2, (locale_t)ossl_c_locale());
}
int OPENSSL_strncasecmp(const char *s1, const char *s2, size_t n)
{
return strncasecmp_l(s1, s2, n, (locale_t)ossl_c_locale());
}
#else
# ifndef FIPS_MODULE
void *ossl_c_locale() {
return NULL;
}
# endif
int ossl_init_casecmp() {
return 1;
}
void ossl_deinit_casecmp() {
}
int OPENSSL_strcasecmp(const char *s1, const char *s2)
{
return strcasecmp(s1, s2);
}
int OPENSSL_strncasecmp(const char *s1, const char *s2, size_t n)
{
return strncasecmp(s1, s2, n);
}
#endif
+1 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2017-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -23,7 +23,6 @@
#include <openssl/objects.h>
#include "internal/nelem.h"
#include "crypto/dh.h"
#include "e_os.h" /* strcasecmp */
static DH *dh_param_init(OSSL_LIB_CTX *libctx, const DH_NAMED_GROUP *group)
{
+3 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2013-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -39,6 +39,8 @@ int ossl_dh_kdf_X9_42_asn1(unsigned char *out, size_t outlen,
const char *mdname = EVP_MD_get0_name(md);
kdf = EVP_KDF_fetch(libctx, OSSL_KDF_NAME_X942KDF_ASN1, propq);
if (kdf == NULL)
return 0;
kctx = EVP_KDF_CTX_new(kdf);
if (kctx == NULL)
goto err;
+2 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2017-2022 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2015-2016 Cryptography Research, Inc.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
@@ -586,6 +586,7 @@ static int recode_wnaf(struct smvt_control *control,
int32_t delta = odd & mask;
assert(position >= 0);
assert(pos < 32); /* can't fail since current & 0xFFFF != 0 */
if (odd & (1 << (table_bits + 1)))
delta -= (1 << (table_bits + 1));
current -= delta * (1 << pos);
+4 -4
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2020-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -54,7 +54,7 @@ int ossl_ec_encoding_name2id(const char *name)
return OPENSSL_EC_NAMED_CURVE;
for (i = 0, sz = OSSL_NELEM(encoding_nameid_map); i < sz; i++) {
if (strcasecmp(name, encoding_nameid_map[i].ptr) == 0)
if (OPENSSL_strcasecmp(name, encoding_nameid_map[i].ptr) == 0)
return encoding_nameid_map[i].id;
}
return -1;
@@ -91,7 +91,7 @@ static int ec_check_group_type_name2id(const char *name)
return 0;
for (i = 0, sz = OSSL_NELEM(check_group_type_nameid_map); i < sz; i++) {
if (strcasecmp(name, check_group_type_nameid_map[i].ptr) == 0)
if (OPENSSL_strcasecmp(name, check_group_type_nameid_map[i].ptr) == 0)
return check_group_type_nameid_map[i].id;
}
return -1;
@@ -136,7 +136,7 @@ int ossl_ec_pt_format_name2id(const char *name)
return (int)POINT_CONVERSION_UNCOMPRESSED;
for (i = 0, sz = OSSL_NELEM(format_nameid_map); i < sz; i++) {
if (strcasecmp(name, format_nameid_map[i].ptr) == 0)
if (OPENSSL_strcasecmp(name, format_nameid_map[i].ptr) == 0)
return format_nameid_map[i].id;
}
return -1;
+3 -1
View File
@@ -1,6 +1,6 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -35,6 +35,8 @@ static const ERR_STRING_DATA EC_str_reasons[] = {
"discriminant is zero"},
{ERR_PACK(ERR_LIB_EC, 0, EC_R_EC_GROUP_NEW_BY_NAME_FAILURE),
"ec group new by name failure"},
{ERR_PACK(ERR_LIB_EC, 0, EC_R_EXPLICIT_PARAMS_NOT_SUPPORTED),
"explicit params not supported"},
{ERR_PACK(ERR_LIB_EC, 0, EC_R_FAILED_MAKING_PUBLIC_KEY),
"failed making public key"},
{ERR_PACK(ERR_LIB_EC, 0, EC_R_FIELD_TOO_LARGE), "field too large"},
+22 -10
View File
@@ -22,7 +22,6 @@
#include "crypto/ec.h"
#include "internal/nelem.h"
#include "ec_local.h"
#include "e_os.h" /* strcasecmp */
/* functions for EC_GROUP objects */
@@ -1387,6 +1386,7 @@ int EC_GROUP_get_pentanomial_basis(const EC_GROUP *group, unsigned int *k1,
}
#endif
#ifndef FIPS_MODULE
/*
* Check if the explicit parameters group matches any built-in curves.
*
@@ -1424,7 +1424,7 @@ static EC_GROUP *ec_group_explicit_to_named(const EC_GROUP *group,
* parameters with one created from a named group.
*/
#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
# ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
/*
* NID_wap_wsg_idm_ecid_wtls12 and NID_secp224r1 are both aliases for
* the same curve, we prefer the SECP nid when matching explicit
@@ -1432,7 +1432,7 @@ static EC_GROUP *ec_group_explicit_to_named(const EC_GROUP *group,
*/
if (curve_name_nid == NID_wap_wsg_idm_ecid_wtls12)
curve_name_nid = NID_secp224r1;
#endif /* !def(OPENSSL_NO_EC_NISTP_64_GCC_128) */
# endif /* !def(OPENSSL_NO_EC_NISTP_64_GCC_128) */
ret_group = EC_GROUP_new_by_curve_name_ex(libctx, propq, curve_name_nid);
if (ret_group == NULL)
@@ -1467,6 +1467,7 @@ err:
EC_GROUP_free(ret_group);
return NULL;
}
#endif /* FIPS_MODULE */
static EC_GROUP *group_new_from_name(const OSSL_PARAM *p,
OSSL_LIB_CTX *libctx, const char *propq)
@@ -1536,9 +1537,13 @@ int ossl_ec_group_set_params(EC_GROUP *group, const OSSL_PARAM params[])
EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
OSSL_LIB_CTX *libctx, const char *propq)
{
const OSSL_PARAM *ptmp, *pa, *pb;
const OSSL_PARAM *ptmp;
EC_GROUP *group = NULL;
#ifndef FIPS_MODULE
const OSSL_PARAM *pa, *pb;
int ok = 0;
EC_GROUP *group = NULL, *named_group = NULL;
EC_GROUP *named_group = NULL;
BIGNUM *p = NULL, *a = NULL, *b = NULL, *order = NULL, *cofactor = NULL;
EC_POINT *point = NULL;
int field_bits = 0;
@@ -1546,6 +1551,7 @@ EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
BN_CTX *bnctx = NULL;
const unsigned char *buf = NULL;
int encoding_flag = -1;
#endif
/* This is the simple named group case */
ptmp = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_GROUP_NAME);
@@ -1559,6 +1565,10 @@ EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
}
return group;
}
#ifdef FIPS_MODULE
ERR_raise(ERR_LIB_EC, EC_R_EXPLICIT_PARAMS_NOT_SUPPORTED);
return NULL;
#else
/* If it gets here then we are trying explicit parameters */
bnctx = BN_CTX_new_ex(libctx);
if (bnctx == NULL) {
@@ -1581,9 +1591,10 @@ EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
ERR_raise(ERR_LIB_EC, EC_R_INVALID_FIELD);
goto err;
}
if (strcasecmp(ptmp->data, SN_X9_62_prime_field) == 0) {
if (OPENSSL_strcasecmp(ptmp->data, SN_X9_62_prime_field) == 0) {
is_prime_field = 1;
} else if (strcasecmp(ptmp->data, SN_X9_62_characteristic_two_field) == 0) {
} else if (OPENSSL_strcasecmp(ptmp->data,
SN_X9_62_characteristic_two_field) == 0) {
is_prime_field = 0;
} else {
/* Invalid field */
@@ -1623,10 +1634,10 @@ EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
/* create the EC_GROUP structure */
group = EC_GROUP_new_curve_GFp(p, a, b, bnctx);
} else {
#ifdef OPENSSL_NO_EC2M
# ifdef OPENSSL_NO_EC2M
ERR_raise(ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED);
goto err;
#else
# else
/* create the EC_GROUP structure */
group = EC_GROUP_new_curve_GF2m(p, a, b, NULL);
if (group != NULL) {
@@ -1636,7 +1647,7 @@ EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
goto err;
}
}
#endif /* OPENSSL_NO_EC2M */
# endif /* OPENSSL_NO_EC2M */
}
if (group == NULL) {
@@ -1733,4 +1744,5 @@ EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[],
BN_CTX_free(bnctx);
return group;
#endif /* FIPS_MODULE */
}
+2 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2014-2022 The OpenSSL Project Authors. All Rights Reserved.
* Copyright (c) 2014, Intel Corporation. All Rights Reserved.
* Copyright (c) 2015, CloudFlare, Inc.
*
@@ -978,6 +978,7 @@ __owur static int ecp_nistz256_points_mul(const EC_GROUP *group,
return 0;
}
memset(&p, 0, sizeof(p));
BN_CTX_start(ctx);
if (scalar) {
+7 -5
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2020-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -789,7 +789,7 @@ static int decoder_process(const OSSL_PARAM params[], void *arg)
*/
trace_data_structure = data_structure;
if (data_type != NULL && data_structure != NULL
&& strcasecmp(data_structure, "type-specific") == 0)
&& OPENSSL_strcasecmp(data_structure, "type-specific") == 0)
data_structure = NULL;
OSSL_TRACE_BEGIN(DECODER) {
@@ -850,7 +850,7 @@ static int decoder_process(const OSSL_PARAM params[], void *arg)
* that's the case, we do this extra check.
*/
if (decoder == NULL && ctx->start_input_type != NULL
&& strcasecmp(ctx->start_input_type, new_input_type) != 0) {
&& OPENSSL_strcasecmp(ctx->start_input_type, new_input_type) != 0) {
OSSL_TRACE_BEGIN(DECODER) {
BIO_printf(trc_out,
"(ctx %p) %s [%u] the start input type '%s' doesn't match the input type of the considered decoder, skipping...\n",
@@ -896,7 +896,8 @@ static int decoder_process(const OSSL_PARAM params[], void *arg)
*/
if (data_structure != NULL
&& (new_input_structure == NULL
|| strcasecmp(data_structure, new_input_structure) != 0)) {
|| OPENSSL_strcasecmp(data_structure,
new_input_structure) != 0)) {
OSSL_TRACE_BEGIN(DECODER) {
BIO_printf(trc_out,
"(ctx %p) %s [%u] the previous decoder's data structure doesn't match the input structure of the considered decoder, skipping...\n",
@@ -915,7 +916,8 @@ static int decoder_process(const OSSL_PARAM params[], void *arg)
&& ctx->input_structure != NULL
&& new_input_structure != NULL) {
data->flag_input_structure_checked = 1;
if (strcasecmp(new_input_structure, ctx->input_structure) != 0) {
if (OPENSSL_strcasecmp(new_input_structure,
ctx->input_structure) != 0) {
OSSL_TRACE_BEGIN(DECODER) {
BIO_printf(trc_out,
"(ctx %p) %s [%u] the previous decoder's data structure doesn't match the input structure given by the user, skipping...\n",
+1 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2020-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -18,7 +18,6 @@
#include "crypto/evp.h"
#include "crypto/decoder.h"
#include "encoder_local.h"
#include "e_os.h" /* strcasecmp on Windows */
int OSSL_DECODER_CTX_set_passphrase(OSSL_DECODER_CTX *ctx,
const unsigned char *kstr,
+5 -6
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2019-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -7,7 +7,6 @@
* https://www.openssl.org/source/license.html
*/
#include "e_os.h" /* strcasecmp on Windows */
#include <openssl/core_names.h>
#include <openssl/bio.h>
#include <openssl/encoder.h>
@@ -453,8 +452,8 @@ static int encoder_process(struct encoder_process_data_st *data)
*/
if (top) {
if (data->ctx->output_type != NULL
&& strcasecmp(current_output_type,
data->ctx->output_type) != 0) {
&& OPENSSL_strcasecmp(current_output_type,
data->ctx->output_type) != 0) {
OSSL_TRACE_BEGIN(ENCODER) {
BIO_printf(trc_out,
"[%d] Skipping because current encoder output type (%s) != desired output type (%s)\n",
@@ -482,8 +481,8 @@ static int encoder_process(struct encoder_process_data_st *data)
*/
if (data->ctx->output_structure != NULL
&& current_output_structure != NULL) {
if (strcasecmp(data->ctx->output_structure,
current_output_structure) != 0) {
if (OPENSSL_strcasecmp(data->ctx->output_structure,
current_output_structure) != 0) {
OSSL_TRACE_BEGIN(ENCODER) {
BIO_printf(trc_out,
"[%d] Skipping because current encoder output structure (%s) != ctx output structure (%s)\n",
@@ -7,7 +7,6 @@
* https://www.openssl.org/source/license.html
*/
#include "e_os.h" /* strcasecmp on Windows */
#include <openssl/err.h>
#include <openssl/ui.h>
#include <openssl/params.h>
+22 -11
View File
@@ -401,6 +401,26 @@ static int int_load(dynamic_data_ctx *ctx)
return 0;
}
/*
* Unfortunately the version checker does not distinguish between
* engines built for openssl 1.1.x and openssl 3.x, but loading
* an engine that is built for openssl 1.1.x will cause a fatal
* error. Detect such engines, since EVP_PKEY_base_id is exported
* as a function in openssl 1.1.x, while it is named EVP_PKEY_get_base_id
* in openssl 3.x. Therefore we take the presence of that symbol
* as an indication that the engine will be incompatible.
*/
static int using_libcrypto_11(dynamic_data_ctx *ctx)
{
int ret;
ERR_set_mark();
ret = DSO_bind_func(ctx->dynamic_dso, "EVP_PKEY_base_id") != NULL;
ERR_pop_to_mark();
return ret;
}
static int dynamic_load(ENGINE *e, dynamic_data_ctx *ctx)
{
ENGINE cpy;
@@ -450,18 +470,9 @@ static int dynamic_load(ENGINE *e, dynamic_data_ctx *ctx)
/*
* We fail if the version checker veto'd the load *or* if it is
* deferring to us (by returning its version) and we think it is too
* old.
* Unfortunately the version checker does not distinguish between
* engines built for openssl 1.1.x and openssl 3.x, but loading
* an engine that is built for openssl 1.1.x will cause a fatal
* error. Detect such engines, since EVP_PKEY_base_id is exported
* as a function in openssl 1.1.x, while it is a macro in openssl 3.x,
* and therefore only the symbol EVP_PKEY_get_base_id is available
* in openssl 3.x.
* old. Also fail if this is engine for openssl 1.1.x.
*/
if (vcheck_res < OSSL_DYNAMIC_OLDEST
|| DSO_bind_func(ctx->dynamic_dso,
"EVP_PKEY_base_id") != NULL) {
if (vcheck_res < OSSL_DYNAMIC_OLDEST || using_libcrypto_11(ctx)) {
/* Fail */
ctx->bind_engine = NULL;
ctx->v_check = NULL;
+3 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2006-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -152,7 +152,7 @@ const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth_str(ENGINE *e,
e->pkey_asn1_meths(e, &ameth, NULL, nids[i]);
if (ameth != NULL
&& ((int)strlen(ameth->pem_str) == len)
&& strncasecmp(ameth->pem_str, str, len) == 0)
&& OPENSSL_strncasecmp(ameth->pem_str, str, len) == 0)
return ameth;
}
return NULL;
@@ -177,7 +177,7 @@ static void look_str_cb(int nid, STACK_OF(ENGINE) *sk, ENGINE *def, void *arg)
e->pkey_asn1_meths(e, &ameth, NULL, nid);
if (ameth != NULL
&& ((int)strlen(ameth->pem_str) == lk->len)
&& strncasecmp(ameth->pem_str, lk->str, lk->len) == 0) {
&& OPENSSL_strncasecmp(ameth->pem_str, lk->str, lk->len) == 0) {
lk->e = e;
lk->ameth = ameth;
return;
+2 -1
View File
@@ -1,4 +1,4 @@
# Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved.
# Copyright 1999-2022 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
@@ -537,6 +537,7 @@ EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING:159:curve does not support signing
EC_R_DECODE_ERROR:142:decode error
EC_R_DISCRIMINANT_IS_ZERO:118:discriminant is zero
EC_R_EC_GROUP_NEW_BY_NAME_FAILURE:119:ec group new by name failure
EC_R_EXPLICIT_PARAMS_NOT_SUPPORTED:127:explicit params not supported
EC_R_FAILED_MAKING_PUBLIC_KEY:166:failed making public key
EC_R_FIELD_TOO_LARGE:143:field too large
EC_R_GF2M_NOT_SUPPORTED:147:gf2m not supported
+11 -7
View File
@@ -37,8 +37,6 @@
#include "crypto/dh.h"
#include "crypto/ec.h"
#include "e_os.h" /* strcasecmp() for Windows */
struct translation_ctx_st; /* Forwarding */
struct translation_st; /* Forwarding */
@@ -905,7 +903,7 @@ static int fix_kdf_type(enum state state,
/* Convert KDF type strings to numbers */
for (; kdf_type_map->kdf_type_str != NULL; kdf_type_map++)
if (strcasecmp(ctx->p2, kdf_type_map->kdf_type_str) == 0) {
if (OPENSSL_strcasecmp(ctx->p2, kdf_type_map->kdf_type_str) == 0) {
ctx->p1 = kdf_type_map->kdf_type_num;
ret = 1;
break;
@@ -1074,7 +1072,11 @@ static int fix_dh_paramgen_type(enum state state,
return 0;
if (state == PRE_CTRL_STR_TO_PARAMS) {
ctx->p2 = (char *)ossl_dh_gen_type_id2name(atoi(ctx->p2));
if ((ctx->p2 = (char *)ossl_dh_gen_type_id2name(atoi(ctx->p2)))
== NULL) {
ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_VALUE);
return 0;
}
ctx->p1 = strlen(ctx->p2);
}
@@ -2469,10 +2471,11 @@ lookup_translation(struct translation_st *tmpl,
* cmd name in the template.
*/
if (item->ctrl_str != NULL
&& strcasecmp(tmpl->ctrl_str, item->ctrl_str) == 0)
&& OPENSSL_strcasecmp(tmpl->ctrl_str, item->ctrl_str) == 0)
ctrl_str = tmpl->ctrl_str;
else if (item->ctrl_hexstr != NULL
&& strcasecmp(tmpl->ctrl_hexstr, item->ctrl_hexstr) == 0)
&& OPENSSL_strcasecmp(tmpl->ctrl_hexstr,
item->ctrl_hexstr) == 0)
ctrl_hexstr = tmpl->ctrl_hexstr;
else
continue;
@@ -2500,7 +2503,8 @@ lookup_translation(struct translation_st *tmpl,
if ((item->action_type != NONE
&& tmpl->action_type != item->action_type)
|| (item->param_key != NULL
&& strcasecmp(tmpl->param_key, item->param_key) != 0))
&& OPENSSL_strcasecmp(tmpl->param_key,
item->param_key) != 0))
continue;
} else {
return NULL;
+3 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2020-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -10,7 +10,7 @@
#include <string.h>
#include <openssl/ec.h>
#include "crypto/ec.h"
#include "e_os.h" /* strcasecmp required by windows */
#include "internal/nelem.h"
typedef struct ec_name2nid_st {
const char *name;
@@ -139,7 +139,7 @@ int ossl_ec_curve_name2nid(const char *name)
return nid;
for (i = 0; i < OSSL_NELEM(curve_list); i++) {
if (strcasecmp(curve_list[i].name, name) == 0)
if (OPENSSL_strcasecmp(curve_list[i].name, name) == 0)
return curve_list[i].nid;
}
}
+8 -3
View File
@@ -344,8 +344,10 @@ static int evp_cipher_init_internal(EVP_CIPHER_CTX *ctx,
case EVP_CIPH_CBC_MODE:
n = EVP_CIPHER_CTX_get_iv_length(ctx);
if (!ossl_assert(n >= 0 && n <= (int)sizeof(ctx->iv)))
return 0;
if (n < 0 || n > (int)sizeof(ctx->iv)) {
ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH);
return 0;
}
if (iv != NULL)
memcpy(ctx->oiv, iv, n);
memcpy(ctx->iv, ctx->oiv, n);
@@ -355,8 +357,11 @@ static int evp_cipher_init_internal(EVP_CIPHER_CTX *ctx,
ctx->num = 0;
/* Don't reuse IV for CTR mode */
if (iv != NULL) {
if ((n = EVP_CIPHER_CTX_get_iv_length(ctx)) <= 0)
n = EVP_CIPHER_CTX_get_iv_length(ctx);
if (n <= 0 || n > (int)sizeof(ctx->iv)) {
ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH);
return 0;
}
memcpy(ctx->iv, iv, n);
}
break;
+7 -8
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -15,7 +15,6 @@
#include <stdio.h>
#include <string.h>
#include "e_os.h" /* strcasecmp */
#include "internal/cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
@@ -1170,17 +1169,17 @@ EVP_PKEY *EVP_PKEY_Q_keygen(OSSL_LIB_CTX *libctx, const char *propq,
va_start(args, type);
if (strcasecmp(type, "RSA") == 0) {
if (OPENSSL_strcasecmp(type, "RSA") == 0) {
bits = va_arg(args, size_t);
params[0] = OSSL_PARAM_construct_size_t(OSSL_PKEY_PARAM_RSA_BITS, &bits);
} else if (strcasecmp(type, "EC") == 0) {
} else if (OPENSSL_strcasecmp(type, "EC") == 0) {
name = va_arg(args, char *);
params[0] = OSSL_PARAM_construct_utf8_string(OSSL_PKEY_PARAM_GROUP_NAME,
name, 0);
} else if (strcasecmp(type, "ED25519") != 0
&& strcasecmp(type, "X25519") != 0
&& strcasecmp(type, "ED448") != 0
&& strcasecmp(type, "X448") != 0) {
} else if (OPENSSL_strcasecmp(type, "ED25519") != 0
&& OPENSSL_strcasecmp(type, "X25519") != 0
&& OPENSSL_strcasecmp(type, "ED448") != 0
&& OPENSSL_strcasecmp(type, "X448") != 0) {
ERR_raise(ERR_LIB_EVP, ERR_R_PASSED_INVALID_ARGUMENT);
goto end;
}
+3 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1999-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -42,6 +42,8 @@ int ossl_pkcs5_pbkdf2_hmac_ex(const char *pass, int passlen,
salt = (unsigned char *)empty;
kdf = EVP_KDF_fetch(libctx, OSSL_KDF_NAME_PBKDF2, propq);
if (kdf == NULL)
return 0;
kctx = EVP_KDF_CTX_new(kdf);
EVP_KDF_free(kdf);
if (kctx == NULL)
+2 -4
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -50,8 +50,6 @@
#include "internal/provider.h"
#include "evp_local.h"
#include "e_os.h" /* strcasecmp on Windows */
static int pkey_set_type(EVP_PKEY *pkey, ENGINE *e, int type, const char *str,
int len, EVP_KEYMGMT *keymgmt);
static void evp_pkey_free_it(EVP_PKEY *key);
@@ -1018,7 +1016,7 @@ int evp_pkey_name2type(const char *name)
size_t i;
for (i = 0; i < OSSL_NELEM(standard_name2type); i++) {
if (strcasecmp(name, standard_name2type[i].ptr) == 0)
if (OPENSSL_strcasecmp(name, standard_name2type[i].ptr) == 0)
return (int)standard_name2type[i].id;
}
+3 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2006-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -27,6 +27,7 @@
#ifndef FIPS_MODULE
# include "crypto/asn1.h"
#endif
#include "crypto/ctype.h"
#include "crypto/evp.h"
#include "crypto/dh.h"
#include "crypto/ec.h"
@@ -199,6 +200,7 @@ static EVP_PKEY_CTX *int_ctx_new(OSSL_LIB_CTX *libctx,
}
#ifndef FIPS_MODULE
if (keytype != NULL) {
ossl_init_casecmp();
id = evp_pkey_name2type(keytype);
if (id == NID_undef)
id = -1;
+2 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2020-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -10,7 +10,6 @@
#include "internal/ffc.h"
#include "internal/nelem.h"
#include "crypto/bn_dh.h"
#include "e_os.h" /* strcasecmp */
#ifndef OPENSSL_NO_DH
@@ -84,7 +83,7 @@ const DH_NAMED_GROUP *ossl_ffc_name_to_dh_named_group(const char *name)
size_t i;
for (i = 0; i < OSSL_NELEM(dh_named_groups); ++i) {
if (strcasecmp(dh_named_groups[i].name, name) == 0)
if (OPENSSL_strcasecmp(dh_named_groups[i].name, name) == 0)
return &dh_named_groups[i];
}
return NULL;
+1 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2019-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -12,7 +12,6 @@
#include "internal/ffc.h"
#include "internal/param_build_set.h"
#include "internal/nelem.h"
#include "e_os.h" /* strcasecmp */
#ifndef FIPS_MODULE
# include <openssl/asn1.h> /* ossl_ffc_params_print */
+9 -9
View File
@@ -322,7 +322,7 @@ static int add1_headers(OSSL_HTTP_REQ_CTX *rctx,
for (i = 0; i < sk_CONF_VALUE_num(headers); i++) {
hdr = sk_CONF_VALUE_value(headers, i);
if (add_host && strcasecmp("host", hdr->name) == 0)
if (add_host && OPENSSL_strcasecmp("host", hdr->name) == 0)
add_host = 0;
if (!OSSL_HTTP_REQ_CTX_add1_header(rctx, hdr->name, hdr->value))
return 0;
@@ -666,13 +666,13 @@ int OSSL_HTTP_REQ_CTX_nbio(OSSL_HTTP_REQ_CTX *rctx)
}
if (value != NULL && line_end != NULL) {
if (rctx->state == OHS_REDIRECT
&& strcasecmp(key, "Location") == 0) {
&& OPENSSL_strcasecmp(key, "Location") == 0) {
rctx->redirection_url = value;
return 0;
}
if (rctx->expected_ct != NULL
&& strcasecmp(key, "Content-Type") == 0) {
if (strcasecmp(rctx->expected_ct, value) != 0) {
if (rctx->state == OHS_HEADERS && rctx->expected_ct != NULL
&& OPENSSL_strcasecmp(key, "Content-Type") == 0) {
if (OPENSSL_strcasecmp(rctx->expected_ct, value) != 0) {
ERR_raise_data(ERR_LIB_HTTP, HTTP_R_UNEXPECTED_CONTENT_TYPE,
"expected=%s, actual=%s",
rctx->expected_ct, value);
@@ -682,12 +682,12 @@ int OSSL_HTTP_REQ_CTX_nbio(OSSL_HTTP_REQ_CTX *rctx)
}
/* https://tools.ietf.org/html/rfc7230#section-6.3 Persistence */
if (strcasecmp(key, "Connection") == 0) {
if (strcasecmp(value, "keep-alive") == 0)
if (OPENSSL_strcasecmp(key, "Connection") == 0) {
if (OPENSSL_strcasecmp(value, "keep-alive") == 0)
found_keep_alive = 1;
else if (strcasecmp(value, "close") == 0)
else if (OPENSSL_strcasecmp(value, "close") == 0)
found_keep_alive = 0;
} else if (strcasecmp(key, "Content-Length") == 0) {
} else if (OPENSSL_strcasecmp(key, "Content-Length") == 0) {
resp_len = (size_t)strtoul(value, &line_end, 10);
if (line_end == value || *line_end != '\0') {
ERR_raise_data(ERR_LIB_HTTP,
+8 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2016-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -32,6 +32,7 @@
#include "crypto/store.h"
#include <openssl/cmp_util.h> /* for OSSL_CMP_log_close() */
#include <openssl/trace.h>
#include "crypto/ctype.h"
static int stopped = 0;
static uint64_t optsdone = 0;
@@ -447,6 +448,9 @@ void OPENSSL_cleanup(void)
OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_trace_cleanup()\n");
ossl_trace_cleanup();
OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_deinit_casecmp()\n");
ossl_deinit_casecmp();
base_inited = 0;
}
@@ -460,6 +464,9 @@ int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings)
uint64_t tmp;
int aloaddone = 0;
if (!ossl_init_casecmp())
return 0;
/* Applications depend on 0 being returned when cleanup was already done */
if (stopped) {
if (!(opts & OPENSSL_INIT_BASE_ONLY))
+13 -28
View File
@@ -61,37 +61,22 @@ void OPENSSL_LH_node_usage_stats(const OPENSSL_LHASH *lh, FILE *fp)
void OPENSSL_LH_stats_bio(const OPENSSL_LHASH *lh, BIO *out)
{
int omit_tsan = 0;
#ifdef TSAN_REQUIRES_LOCKING
if (!CRYPTO_THREAD_read_lock(lh->tsan_lock)) {
BIO_printf(out, "unable to lock table, omitting TSAN counters\n");
omit_tsan = 1;
}
#endif
BIO_printf(out, "num_items = %lu\n", lh->num_items);
BIO_printf(out, "num_nodes = %u\n", lh->num_nodes);
BIO_printf(out, "num_alloc_nodes = %u\n", lh->num_alloc_nodes);
BIO_printf(out, "num_expands = %lu\n", lh->num_expands);
BIO_printf(out, "num_expand_reallocs = %lu\n", lh->num_expand_reallocs);
BIO_printf(out, "num_contracts = %lu\n", lh->num_contracts);
BIO_printf(out, "num_contract_reallocs = %lu\n", lh->num_contract_reallocs);
if (!omit_tsan) {
BIO_printf(out, "num_hash_calls = %lu\n", lh->num_hash_calls);
BIO_printf(out, "num_comp_calls = %lu\n", lh->num_comp_calls);
}
BIO_printf(out, "num_insert = %lu\n", lh->num_insert);
BIO_printf(out, "num_replace = %lu\n", lh->num_replace);
BIO_printf(out, "num_delete = %lu\n", lh->num_delete);
BIO_printf(out, "num_no_delete = %lu\n", lh->num_no_delete);
if (!omit_tsan) {
BIO_printf(out, "num_retrieve = %lu\n", lh->num_retrieve);
BIO_printf(out, "num_retrieve_miss = %lu\n", lh->num_retrieve_miss);
BIO_printf(out, "num_hash_comps = %lu\n", lh->num_hash_comps);
#ifdef TSAN_REQUIRES_LOCKING
CRYPTO_THREAD_unlock(lh->tsan_lock);
#endif
}
BIO_printf(out, "num_expands = 0\n");
BIO_printf(out, "num_expand_reallocs = 0\n");
BIO_printf(out, "num_contracts = 0\n");
BIO_printf(out, "num_contract_reallocs = 0\n");
BIO_printf(out, "num_hash_calls = 0\n");
BIO_printf(out, "num_comp_calls = 0\n");
BIO_printf(out, "num_insert = 0\n");
BIO_printf(out, "num_replace = 0\n");
BIO_printf(out, "num_delete = 0\n");
BIO_printf(out, "num_no_delete = 0\n");
BIO_printf(out, "num_retrieve = 0\n");
BIO_printf(out, "num_retrieve_miss = 0\n");
BIO_printf(out, "num_hash_comps = 0\n");
}
void OPENSSL_LH_node_stats_bio(const OPENSSL_LHASH *lh, BIO *out)
+4 -52
View File
@@ -44,22 +44,6 @@ static int expand(OPENSSL_LHASH *lh);
static void contract(OPENSSL_LHASH *lh);
static OPENSSL_LH_NODE **getrn(OPENSSL_LHASH *lh, const void *data, unsigned long *rhash);
static ossl_inline int tsan_lock(const OPENSSL_LHASH *lh)
{
#ifdef TSAN_REQUIRES_LOCKING
if (!CRYPTO_THREAD_write_lock(lh->tsan_lock))
return 0;
#endif
return 1;
}
static ossl_inline void tsan_unlock(const OPENSSL_LHASH *lh)
{
#ifdef TSAN_REQUIRES_LOCKING
CRYPTO_THREAD_unlock(lh->tsan_lock);
#endif
}
OPENSSL_LHASH *OPENSSL_LH_new(OPENSSL_LH_HASHFUNC h, OPENSSL_LH_COMPFUNC c)
{
OPENSSL_LHASH *ret;
@@ -74,10 +58,6 @@ OPENSSL_LHASH *OPENSSL_LH_new(OPENSSL_LH_HASHFUNC h, OPENSSL_LH_COMPFUNC c)
}
if ((ret->b = OPENSSL_zalloc(sizeof(*ret->b) * MIN_NODES)) == NULL)
goto err;
#ifdef TSAN_REQUIRES_LOCKING
if ((ret->tsan_lock = CRYPTO_THREAD_lock_new()) == NULL)
goto err;
#endif
ret->comp = ((c == NULL) ? (OPENSSL_LH_COMPFUNC)strcmp : c);
ret->hash = ((h == NULL) ? (OPENSSL_LH_HASHFUNC)OPENSSL_LH_strhash : h);
ret->num_nodes = MIN_NODES / 2;
@@ -99,9 +79,6 @@ void OPENSSL_LH_free(OPENSSL_LHASH *lh)
return;
OPENSSL_LH_flush(lh);
#ifdef TSAN_REQUIRES_LOCKING
CRYPTO_THREAD_lock_free(lh->tsan_lock);
#endif
OPENSSL_free(lh->b);
OPENSSL_free(lh);
}
@@ -123,6 +100,8 @@ void OPENSSL_LH_flush(OPENSSL_LHASH *lh)
}
lh->b[i] = NULL;
}
lh->num_items = 0;
}
void *OPENSSL_LH_insert(OPENSSL_LHASH *lh, void *data)
@@ -147,12 +126,10 @@ void *OPENSSL_LH_insert(OPENSSL_LHASH *lh, void *data)
nn->hash = hash;
*rn = nn;
ret = NULL;
lh->num_insert++;
lh->num_items++;
} else { /* replace same key */
ret = (*rn)->data;
(*rn)->data = data;
lh->num_replace++;
}
return ret;
}
@@ -167,14 +144,12 @@ void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
rn = getrn(lh, data, &hash);
if (*rn == NULL) {
lh->num_no_delete++;
return NULL;
} else {
nn = *rn;
*rn = nn->next;
ret = nn->data;
OPENSSL_free(nn);
lh->num_delete++;
}
lh->num_items--;
@@ -190,18 +165,11 @@ void *OPENSSL_LH_retrieve(OPENSSL_LHASH *lh, const void *data)
unsigned long hash;
OPENSSL_LH_NODE **rn;
/*-
* This should be atomic without tsan.
* It's not clear why it was done this way and not elsewhere.
*/
tsan_store((TSAN_QUALIFIER int *)&lh->error, 0);
if (lh->error != 0)
lh->error = 0;
rn = getrn(lh, data, &hash);
if (tsan_lock(lh)) {
tsan_counter(*rn == NULL ? &lh->num_retrieve_miss : &lh->num_retrieve);
tsan_unlock(lh);
}
return *rn == NULL ? NULL : (*rn)->data;
}
@@ -262,14 +230,12 @@ static int expand(OPENSSL_LHASH *lh)
memset(n + nni, 0, sizeof(*n) * (j - nni));
lh->pmax = nni;
lh->num_alloc_nodes = j;
lh->num_expand_reallocs++;
lh->p = 0;
} else {
lh->p++;
}
lh->num_nodes++;
lh->num_expands++;
n1 = &(lh->b[p]);
n2 = &(lh->b[p + pmax]);
*n2 = NULL;
@@ -302,7 +268,6 @@ static void contract(OPENSSL_LHASH *lh)
lh->error++;
return;
}
lh->num_contract_reallocs++;
lh->num_alloc_nodes /= 2;
lh->pmax /= 2;
lh->p = lh->pmax - 1;
@@ -311,7 +276,6 @@ static void contract(OPENSSL_LHASH *lh)
lh->p--;
lh->num_nodes--;
lh->num_contracts++;
n1 = lh->b[(int)lh->p];
if (n1 == NULL)
@@ -329,14 +293,8 @@ static OPENSSL_LH_NODE **getrn(OPENSSL_LHASH *lh,
OPENSSL_LH_NODE **ret, *n1;
unsigned long hash, nn;
OPENSSL_LH_COMPFUNC cf;
int do_tsan = 1;
#ifdef TSAN_REQUIRES_LOCKING
do_tsan = tsan_lock(lh);
#endif
hash = (*(lh->hash)) (data);
if (do_tsan)
tsan_counter(&lh->num_hash_calls);
*rhash = hash;
nn = hash % lh->pmax;
@@ -346,20 +304,14 @@ static OPENSSL_LH_NODE **getrn(OPENSSL_LHASH *lh,
cf = lh->comp;
ret = &(lh->b[(int)nn]);
for (n1 = *ret; n1 != NULL; n1 = n1->next) {
if (do_tsan)
tsan_counter(&lh->num_hash_comps);
if (n1->hash != hash) {
ret = &(n1->next);
continue;
}
if (do_tsan)
tsan_counter(&lh->num_comp_calls);
if (cf(n1->data, data) == 0)
break;
ret = &(n1->next);
}
if (do_tsan)
tsan_unlock(lh);
return ret;
}
-16
View File
@@ -27,21 +27,5 @@ struct lhash_st {
unsigned long up_load; /* load times 256 */
unsigned long down_load; /* load times 256 */
unsigned long num_items;
unsigned long num_expands;
unsigned long num_expand_reallocs;
unsigned long num_contracts;
unsigned long num_contract_reallocs;
TSAN_QUALIFIER unsigned long num_hash_calls;
TSAN_QUALIFIER unsigned long num_comp_calls;
unsigned long num_insert;
unsigned long num_replace;
unsigned long num_delete;
unsigned long num_no_delete;
TSAN_QUALIFIER unsigned long num_retrieve;
TSAN_QUALIFIER unsigned long num_retrieve_miss;
TSAN_QUALIFIER unsigned long num_hash_comps;
int error;
#ifdef TSAN_REQUIRES_LOCKING
CRYPTO_RWLOCK *tsan_lock;
#endif
};
+3 -20
View File
@@ -1,5 +1,5 @@
/*
* Copyright 1998-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1998-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -21,23 +21,6 @@
#include "obj_local.h"
#include "e_os.h"
/*
* We define this wrapper for two reasons. Firstly, later versions of
* DEC C add linkage information to certain functions, which makes it
* tricky to use them as values to regular function pointers.
* Secondly, in the EDK2 build environment, the strcasecmp function is
* actually an external function with the Microsoft ABI, so we can't
* transparently assign function pointers to it.
*/
#if defined(OPENSSL_SYS_VMS_DECC) || defined(OPENSSL_SYS_UEFI)
static int obj_strcasecmp(const char *a, const char *b)
{
return strcasecmp(a, b);
}
#else
#define obj_strcasecmp strcasecmp
#endif
/*
* I use the ex_data stuff to manage the identifiers for the obj_name_types
* that applications may define. I only really use the free function field.
@@ -111,7 +94,7 @@ int OBJ_NAME_new_index(unsigned long (*hash_func) (const char *),
goto out;
}
name_funcs->hash_func = ossl_lh_strcasehash;
name_funcs->cmp_func = obj_strcasecmp;
name_funcs->cmp_func = OPENSSL_strcasecmp;
push = sk_NAME_FUNCS_push(name_funcs_stack, name_funcs);
if (!push) {
@@ -145,7 +128,7 @@ static int obj_name_cmp(const OBJ_NAME *a, const OBJ_NAME *b)
ret = sk_NAME_FUNCS_value(name_funcs_stack,
a->type)->cmp_func(a->name, b->name);
} else
ret = strcasecmp(a->name, b->name);
ret = OPENSSL_strcasecmp(a->name, b->name);
}
return ret;
}
+4 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2001-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -59,9 +59,10 @@ static int ocsp_verify_signer(X509 *signer, int response,
ret = X509_verify_cert(ctx);
if (ret <= 0) {
ret = X509_STORE_CTX_get_error(ctx);
int err = X509_STORE_CTX_get_error(ctx);
ERR_raise_data(ERR_LIB_OCSP, OCSP_R_CERTIFICATE_VERIFY_ERROR,
"Verify error: %s", X509_verify_cert_error_string(ret));
"Verify error: %s", X509_verify_cert_error_string(err));
goto end;
}
if (chain != NULL)
+3 -4
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2021-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -11,7 +11,6 @@
#include <openssl/params.h>
#include <openssl/param_build.h>
#include "internal/param_build_set.h"
#include "e_os.h" /* strcasecmp */
#define OSSL_PARAM_ALLOCATED_END 127
#define OSSL_PARAM_MERGE_LIST_MAX 128
@@ -142,7 +141,7 @@ static int compare_params(const void *left, const void *right)
const OSSL_PARAM *l = *(const OSSL_PARAM **)left;
const OSSL_PARAM *r = *(const OSSL_PARAM **)right;
return strcasecmp(l->key, r->key);
return OPENSSL_strcasecmp(l->key, r->key);
}
OSSL_PARAM *OSSL_PARAM_merge(const OSSL_PARAM *p1, const OSSL_PARAM *p2)
@@ -205,7 +204,7 @@ OSSL_PARAM *OSSL_PARAM_merge(const OSSL_PARAM *p1, const OSSL_PARAM *p2)
break;
}
/* consume the list element with the smaller key */
diff = strcasecmp((*p1cur)->key, (*p2cur)->key);
diff = OPENSSL_strcasecmp((*p1cur)->key, (*p2cur)->key);
if (diff == 0) {
/* If the keys are the same then throw away the list1 element */
*dst++ = **p2cur;
+1 -1
View File
@@ -5,7 +5,7 @@ IF[{- !$disabled{asm} -}]
$POLY1305ASM_x86=poly1305-x86.s
$POLY1305ASM_x86_64=poly1305-x86_64.s
$POLY1305ASM_ia64=asm/poly1305-ia64.S
$POLY1305ASM_ia64=asm/poly1305-ia64.s
$POLY1305ASM_sparcv9=poly1305-sparcv9.S
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2019-2022 The OpenSSL Project Authors. All Rights Reserved.
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
@@ -45,7 +45,7 @@ static int match(const char *t[], const char m[], size_t m_len)
{
const char *s = *t;
if (strncasecmp(s, m, m_len) == 0) {
if (OPENSSL_strncasecmp(s, m, m_len) == 0) {
*t = skip_space(s + m_len);
return 1;
}
+6 -6
View File
@@ -768,22 +768,22 @@ static int random_conf_init(CONF_IMODULE *md, const CONF *cnf)
for (i = 0; i < sk_CONF_VALUE_num(elist); i++) {
cval = sk_CONF_VALUE_value(elist, i);
if (strcasecmp(cval->name, "random") == 0) {
if (OPENSSL_strcasecmp(cval->name, "random") == 0) {
if (!random_set_string(&dgbl->rng_name, cval->value))
return 0;
} else if (strcasecmp(cval->name, "cipher") == 0) {
} else if (OPENSSL_strcasecmp(cval->name, "cipher") == 0) {
if (!random_set_string(&dgbl->rng_cipher, cval->value))
return 0;
} else if (strcasecmp(cval->name, "digest") == 0) {
} else if (OPENSSL_strcasecmp(cval->name, "digest") == 0) {
if (!random_set_string(&dgbl->rng_digest, cval->value))
return 0;
} else if (strcasecmp(cval->name, "properties") == 0) {
} else if (OPENSSL_strcasecmp(cval->name, "properties") == 0) {
if (!random_set_string(&dgbl->rng_propq, cval->value))
return 0;
} else if (strcasecmp(cval->name, "seed") == 0) {
} else if (OPENSSL_strcasecmp(cval->name, "seed") == 0) {
if (!random_set_string(&dgbl->seed_name, cval->value))
return 0;
} else if (strcasecmp(cval->name, "seed_properties") == 0) {
} else if (OPENSSL_strcasecmp(cval->name, "seed_properties") == 0) {
if (!random_set_string(&dgbl->seed_propq, cval->value))
return 0;
} else {
+2 -4
View File
@@ -27,8 +27,6 @@
#include "crypto/rsa.h"
#include "rsa_local.h"
#include "e_os.h" /* strcasecmp for Windows() */
/*
* The intention with the "backend" source file is to offer backend support
* for legacy backends (EVP_PKEY_ASN1_METHOD and EVP_PKEY_METHOD) and provider
@@ -275,8 +273,8 @@ int ossl_rsa_pss_params_30_fromdata(RSA_PSS_PARAMS_30 *pss_params,
else if (!OSSL_PARAM_get_utf8_ptr(param_mgf, &mgfname))
return 0;
if (strcasecmp(param_mgf->data,
ossl_rsa_mgf_nid2name(default_maskgenalg_nid)) != 0)
if (OPENSSL_strcasecmp(param_mgf->data,
ossl_rsa_mgf_nid2name(default_maskgenalg_nid)) != 0)
return 0;
}
+4 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2017-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -72,6 +72,9 @@ struct OPENSSL_s390xcap_st {
unsigned long long kdsa[2];
};
#if defined(__GNUC__) && defined(__linux)
__attribute__ ((visibility("hidden")))
#endif
extern struct OPENSSL_s390xcap_st OPENSSL_s390xcap_P;
/* Max number of 64-bit words currently returned by STFLE */
+4 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2010-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -74,6 +74,9 @@ void OPENSSL_s390x_functions(void);
struct OPENSSL_s390xcap_st OPENSSL_s390xcap_P;
#if defined(__GNUC__) && defined(__linux)
__attribute__ ((visibility("hidden")))
#endif
void OPENSSL_cpuid_setup(void)
{
struct OPENSSL_s390xcap_st cap;
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2017-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -204,7 +204,7 @@ int SipHash_Final(SIPHASH *ctx, unsigned char *out, size_t outlen)
uint64_t v2 = ctx->v2;
uint64_t v3 = ctx->v3;
if (outlen != (size_t)ctx->hash_size)
if (ctx->crounds == 0 || outlen == 0 || outlen != (size_t)ctx->hash_size)
return 0;
switch (ctx->len) {
+10 -15
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2019-2022 The OpenSSL Project Authors. All Rights Reserved.
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
@@ -19,24 +19,19 @@
* depth of the tree but potentially wastes more memory. That is, this is a
* direct space versus time tradeoff.
*
* The large memory model uses twelve bits which means that the are 4096
* pointers in each tree node. This is more than sufficient to hold the
* largest defined NID (as of Feb 2019). This means that using a NID to
* index a sparse array becomes a constant time single array look up.
*
* The small memory model uses four bits which means the tree nodes contain
* sixteen pointers. This reduces the amount of unused space significantly
* at a cost in time.
* The default is to use four bits which means that the are 16
* pointers in each tree node.
*
* The library builder is also permitted to define other sizes in the closed
* interval [2, sizeof(ossl_uintmax_t) * 8].
* interval [2, sizeof(ossl_uintmax_t) * 8]. Space use generally scales
* exponentially with the block size, although the implementation only
* creates enough blocks to support the largest used index. The depth is:
* ceil(log_2(largest index) / 2^{block size})
* E.g. with a block size of 4, and a largest index of 1000, the depth
* will be three.
*/
#ifndef OPENSSL_SA_BLOCK_BITS
# ifdef OPENSSL_SMALL_FOOTPRINT
# define OPENSSL_SA_BLOCK_BITS 4
# else
# define OPENSSL_SA_BLOCK_BITS 12
# endif
# define OPENSSL_SA_BLOCK_BITS 4
#elif OPENSSL_SA_BLOCK_BITS < 2 || OPENSSL_SA_BLOCK_BITS > (BN_BITS2 - 1)
# error OPENSSL_SA_BLOCK_BITS is out of range
#endif
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2016-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -93,7 +93,7 @@ OSSL_STORE_open_ex(const char *uri, OSSL_LIB_CTX *libctx, const char *propq,
OPENSSL_strlcpy(scheme_copy, uri, sizeof(scheme_copy));
if ((p = strchr(scheme_copy, ':')) != NULL) {
*p++ = '\0';
if (strcasecmp(scheme_copy, "file") != 0) {
if (OPENSSL_strcasecmp(scheme_copy, "file") != 0) {
if (strncmp(p, "//", 2) == 0)
schemes_n--; /* Invalidate the file scheme */
schemes[schemes_n++] = scheme_copy;
+1 -1
View File
@@ -457,7 +457,7 @@ static int try_cert(struct extracted_param_data_st *data, OSSL_STORE_INFO **v,
/* If we have a data type, it should be a PEM name */
if (data->data_type != NULL
&& (strcasecmp(data->data_type, PEM_STRING_X509_TRUSTED) == 0))
&& (OPENSSL_strcasecmp(data->data_type, PEM_STRING_X509_TRUSTED) == 0))
ignore_trusted = 0;
if (d2i_X509_AUX(&cert, (const unsigned char **)&data->octet_data,
+15 -3
View File
@@ -17,6 +17,18 @@
# include <atomic.h>
#endif
#if defined(__apple_build_version__) && __apple_build_version__ < 6000000
/*
* OS/X 10.7 and 10.8 had a weird version of clang which has __ATOMIC_ACQUIRE and
* __ATOMIC_ACQ_REL but which expects only one parameter for __atomic_is_lock_free()
* rather than two which has signature __atomic_is_lock_free(sizeof(_Atomic(T))).
* All of this makes impossible to use __atomic_is_lock_free here.
*
* See: https://github.com/llvm/llvm-project/commit/a4c2602b714e6c6edb98164550a5ae829b2de760
*/
#define BROKEN_CLANG_ATOMICS
#endif
#if defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG) && !defined(OPENSSL_SYS_WINDOWS)
# if defined(OPENSSL_SYS_UNIX)
@@ -188,7 +200,7 @@ int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b)
int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
{
# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL)
# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
if (__atomic_is_lock_free(sizeof(*val), val)) {
*ret = __atomic_add_fetch(val, amount, __ATOMIC_ACQ_REL);
return 1;
@@ -215,7 +227,7 @@ int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
int CRYPTO_atomic_or(uint64_t *val, uint64_t op, uint64_t *ret,
CRYPTO_RWLOCK *lock)
{
# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL)
# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
if (__atomic_is_lock_free(sizeof(*val), val)) {
*ret = __atomic_or_fetch(val, op, __ATOMIC_ACQ_REL);
return 1;
@@ -240,7 +252,7 @@ int CRYPTO_atomic_or(uint64_t *val, uint64_t op, uint64_t *ret,
int CRYPTO_atomic_load(uint64_t *val, uint64_t *ret, CRYPTO_RWLOCK *lock)
{
# if defined(__GNUC__) && defined(__ATOMIC_ACQUIRE)
# if defined(__GNUC__) && defined(__ATOMIC_ACQUIRE) && !defined(BROKEN_CLANG_ATOMICS)
if (__atomic_is_lock_free(sizeof(*val), val)) {
__atomic_load(val, ret, __ATOMIC_ACQUIRE);
return 1;
+1 -3
View File
@@ -19,8 +19,6 @@
#include "internal/refcount.h"
#include "crypto/cryptlib.h"
#include "e_os.h" /* strcasecmp for Windows */
#ifndef OPENSSL_NO_TRACE
static CRYPTO_RWLOCK *trace_lock = NULL;
@@ -158,7 +156,7 @@ int OSSL_trace_get_category_num(const char *name)
size_t i;
for (i = 0; i < OSSL_NELEM(trace_categories); i++)
if (strcasecmp(name, trace_categories[i].name) == 0)
if (OPENSSL_strcasecmp(name, trace_categories[i].name) == 0)
return trace_categories[i].num;
return -1; /* not found */
}
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2015-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -108,7 +108,7 @@ static TLS_FEATURE *v2i_TLS_FEATURE(const X509V3_EXT_METHOD *method,
extval = val->name;
for (j = 0; j < OSSL_NELEM(tls_feature_tbl); j++)
if (strcasecmp(extval, tls_feature_tbl[j].name) == 0)
if (OPENSSL_strcasecmp(extval, tls_feature_tbl[j].name) == 0)
break;
if (j < OSSL_NELEM(tls_feature_tbl))
tlsextid = tls_feature_tbl[j].num;
+14 -6
View File
@@ -349,7 +349,9 @@ STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line)
ERR_raise(ERR_LIB_X509V3, X509V3_R_INVALID_EMPTY_NAME);
goto err;
}
X509V3_add_value(ntmp, NULL, &values);
if (!X509V3_add_value(ntmp, NULL, &values)) {
goto err;
}
}
break;
@@ -362,7 +364,9 @@ STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line)
ERR_raise(ERR_LIB_X509V3, X509V3_R_INVALID_NULL_VALUE);
goto err;
}
X509V3_add_value(ntmp, vtmp, &values);
if (!X509V3_add_value(ntmp, vtmp, &values)) {
goto err;
}
ntmp = NULL;
q = p + 1;
}
@@ -376,14 +380,18 @@ STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line)
ERR_raise(ERR_LIB_X509V3, X509V3_R_INVALID_NULL_VALUE);
goto err;
}
X509V3_add_value(ntmp, vtmp, &values);
if (!X509V3_add_value(ntmp, vtmp, &values)) {
goto err;
}
} else {
ntmp = strip_spaces(q);
if (!ntmp) {
ERR_raise(ERR_LIB_X509V3, X509V3_R_INVALID_EMPTY_NAME);
goto err;
}
X509V3_add_value(ntmp, NULL, &values);
if (!X509V3_add_value(ntmp, NULL, &values)) {
goto err;
}
}
OPENSSL_free(linebuf);
return values;
@@ -707,7 +715,7 @@ static int wildcard_match(const unsigned char *prefix, size_t prefix_len,
}
/* IDNA labels cannot match partial wildcards */
if (!allow_idna &&
subject_len >= 4 && strncasecmp((char *)subject, "xn--", 4) == 0)
subject_len >= 4 && OPENSSL_strncasecmp((char *)subject, "xn--", 4) == 0)
return 0;
/* The wildcard may match a literal '*' */
if (wildcard_end == wildcard_start + 1 && *wildcard_start == '*')
@@ -767,7 +775,7 @@ static const unsigned char *valid_star(const unsigned char *p, size_t len,
|| ('A' <= p[i] && p[i] <= 'Z')
|| ('0' <= p[i] && p[i] <= '9')) {
if ((state & LABEL_START) != 0
&& len - i >= 4 && strncasecmp((char *)&p[i], "xn--", 4) == 0)
&& len - i >= 4 && OPENSSL_strncasecmp((char *)&p[i], "xn--", 4) == 0)
state |= LABEL_IDNA;
state &= ~(LABEL_HYPHEN | LABEL_START);
} else if (p[i] == '.') {
+4 -4
View File
@@ -337,7 +337,7 @@ make update-fips-checksums >&42
if [ -n "$(git status --porcelain)" ]; then
$VERBOSE "== Committing updates"
git add -u
git commit $git_quiet -m 'make update'
git commit $git_quiet -m $'make update\n\nRelease: yes'
if [ -n "$reviewers" ]; then
addrev --nopr $reviewers
fi
@@ -375,7 +375,7 @@ done
$VERBOSE "== Comitting updates and tagging"
git add -u
git commit $git_quiet -m "Prepare for release of $release_text"
git commit $git_quiet -m "Prepare for release of $release_text"$'\n\nRelease: yes'
if [ -n "$reviewers" ]; then
addrev --nopr $reviewers
fi
@@ -477,7 +477,7 @@ done
$VERBOSE "== Committing updates"
git add -u
git commit $git_quiet -m "Prepare for $release_text"
git commit $git_quiet -m "Prepare for $release_text"$'\n\nRelease: yes'
if [ -n "$reviewers" ]; then
addrev --nopr $reviewers
fi
@@ -508,7 +508,7 @@ if $do_branch; then
$VERBOSE "== Committing updates"
git add -u
git commit $git_quiet -m "Prepare for $release_text"
git commit $git_quiet -m "Prepare for $release_text"$'\n\nRelease: yes'
if [ -n "$reviewers" ]; then
addrev --nopr $reviewers
fi
+6
View File
@@ -1531,6 +1531,10 @@ DEPEND[html/man3/OPENSSL_secure_malloc.html]=man3/OPENSSL_secure_malloc.pod
GENERATE[html/man3/OPENSSL_secure_malloc.html]=man3/OPENSSL_secure_malloc.pod
DEPEND[man/man3/OPENSSL_secure_malloc.3]=man3/OPENSSL_secure_malloc.pod
GENERATE[man/man3/OPENSSL_secure_malloc.3]=man3/OPENSSL_secure_malloc.pod
DEPEND[html/man3/OPENSSL_strcasecmp.html]=man3/OPENSSL_strcasecmp.pod
GENERATE[html/man3/OPENSSL_strcasecmp.html]=man3/OPENSSL_strcasecmp.pod
DEPEND[man/man3/OPENSSL_strcasecmp.3]=man3/OPENSSL_strcasecmp.pod
GENERATE[man/man3/OPENSSL_strcasecmp.3]=man3/OPENSSL_strcasecmp.pod
DEPEND[html/man3/OSSL_CMP_CTX_new.html]=man3/OSSL_CMP_CTX_new.pod
GENERATE[html/man3/OSSL_CMP_CTX_new.html]=man3/OSSL_CMP_CTX_new.pod
DEPEND[man/man3/OSSL_CMP_CTX_new.3]=man3/OSSL_CMP_CTX_new.pod
@@ -3114,6 +3118,7 @@ html/man3/OPENSSL_load_builtin_modules.html \
html/man3/OPENSSL_malloc.html \
html/man3/OPENSSL_s390xcap.html \
html/man3/OPENSSL_secure_malloc.html \
html/man3/OPENSSL_strcasecmp.html \
html/man3/OSSL_CMP_CTX_new.html \
html/man3/OSSL_CMP_HDR_get0_transactionID.html \
html/man3/OSSL_CMP_ITAV_set0.html \
@@ -3709,6 +3714,7 @@ man/man3/OPENSSL_load_builtin_modules.3 \
man/man3/OPENSSL_malloc.3 \
man/man3/OPENSSL_s390xcap.3 \
man/man3/OPENSSL_secure_malloc.3 \
man/man3/OPENSSL_strcasecmp.3 \
man/man3/OSSL_CMP_CTX_new.3 \
man/man3/OSSL_CMP_HDR_get0_transactionID.3 \
man/man3/OSSL_CMP_ITAV_set0.3 \
+4 -1
View File
@@ -19,4 +19,7 @@ Matt Caswell:
8657 ABB2 60F0 56B1 E519 0839 D9C4 D26D 0E60 4491
Paul Dale:
1B72 6772 1033 CC88 A531 5EF5 5359 C4D8 443B 383B
B7C1 C143 60F3 53A3 6862 E4D5 231C 84CD DCC6 9C45
Tomáš Mráz:
A21F AB74 B008 8AA3 6115 2586 B8EF 1A6B A9DA 2D5C
+5 -2
View File
@@ -118,7 +118,10 @@ for creating a new instance of the BIO respectively. This function will be
called in response to the application calling BIO_new() and passing
in a pointer to the current BIO_METHOD. The BIO_new() function will allocate the
memory for the new BIO, and a pointer to this newly allocated structure will
be passed as a parameter to the function.
be passed as a parameter to the function. If a create function is set,
BIO_new() will not mark the BIO as initialised on allocation.
L<BIO_set_init(3)> must then be called either by the create function, or later,
by a BIO ctrl function, once BIO initialisation is complete.
BIO_meth_get_destroy() and BIO_meth_set_destroy() get and set the function used
for destroying an instance of a BIO respectively. This function will be
@@ -154,7 +157,7 @@ The functions described here were added in OpenSSL 1.1.0.
=head1 COPYRIGHT
Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2016-2022 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
+2 -2
View File
@@ -34,7 +34,7 @@ The BLAKE2b algorithm that produces a 512-bit output from a given input.
=head1 RETURN VALUES
These functions return a B<EVP_MD> structure that contains the
implementation of the symmetric cipher. See L<EVP_MD_meth_new(3)> for
implementation of the message digest. See L<EVP_MD_meth_new(3)> for
details of the B<EVP_MD> structure.
=head1 CONFORMING TO
@@ -54,7 +54,7 @@ L<EVP_DigestInit(3)>
=head1 COPYRIGHT
Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2017-2022 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
+2 -2
View File
@@ -28,7 +28,7 @@ The MD2 algorithm which produces a 128-bit output from a given input.
=head1 RETURN VALUES
These functions return a B<EVP_MD> structure that contains the
implementation of the symmetric cipher. See L<EVP_MD_meth_new(3)> for
implementation of the message digest. See L<EVP_MD_meth_new(3)> for
details of the B<EVP_MD> structure.
=head1 CONFORMING TO
@@ -43,7 +43,7 @@ L<EVP_DigestInit(3)>
=head1 COPYRIGHT
Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2017-2022 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
+2 -2
View File
@@ -29,7 +29,7 @@ The MD4 algorithm which produces a 128-bit output from a given input.
=head1 RETURN VALUES
These functions return a B<EVP_MD> structure that contains the
implementation of the symmetric cipher. See L<EVP_MD_meth_new(3)> for
implementation of the message digest. See L<EVP_MD_meth_new(3)> for
details of the B<EVP_MD> structure.
=head1 CONFORMING TO
@@ -44,7 +44,7 @@ L<EVP_DigestInit(3)>
=head1 COPYRIGHT
Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2017-2022 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
+2 -2
View File
@@ -40,7 +40,7 @@ WARNING: this algorithm is not intended for non-SSL usage.
=head1 RETURN VALUES
These functions return a B<EVP_MD> structure that contains the
implementation of the symmetric cipher. See L<EVP_MD_meth_new(3)> for
implementation of the message digest. See L<EVP_MD_meth_new(3)> for
details of the B<EVP_MD> structure.
=head1 CONFORMING TO
@@ -54,7 +54,7 @@ L<EVP_DigestInit(3)>
=head1 COPYRIGHT
Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2017-2022 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
+2 -2
View File
@@ -29,7 +29,7 @@ The MDC-2DES algorithm of using MDC-2 with the DES block cipher. It produces a
=head1 RETURN VALUES
These functions return a B<EVP_MD> structure that contains the
implementation of the symmetric cipher. See L<EVP_MD_meth_new(3)> for
implementation of the message digest. See L<EVP_MD_meth_new(3)> for
details of the B<EVP_MD> structure.
=head1 CONFORMING TO
@@ -44,7 +44,7 @@ L<EVP_DigestInit(3)>
=head1 COPYRIGHT
Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2017-2022 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
+2 -2
View File
@@ -28,7 +28,7 @@ The RIPEMD-160 algorithm which produces a 160-bit output from a given input.
=head1 RETURN VALUES
These functions return a B<EVP_MD> structure that contains the
implementation of the symmetric cipher. See L<EVP_MD_meth_new(3)> for
implementation of the message digest. See L<EVP_MD_meth_new(3)> for
details of the B<EVP_MD> structure.
=head1 CONFORMING TO
@@ -43,7 +43,7 @@ L<EVP_DigestInit(3)>
=head1 COPYRIGHT
Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2017-2022 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
+2 -2
View File
@@ -29,7 +29,7 @@ The SHA-1 algorithm which produces a 160-bit output from a given input.
=head1 RETURN VALUES
These functions return a B<EVP_MD> structure that contains the
implementation of the symmetric cipher. See L<EVP_MD_meth_new(3)> for
implementation of the message digest. See L<EVP_MD_meth_new(3)> for
details of the B<EVP_MD> structure.
=head1 CONFORMING TO
@@ -43,7 +43,7 @@ L<EVP_DigestInit(3)>
=head1 COPYRIGHT
Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2017-2022 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
+2 -2
View File
@@ -49,7 +49,7 @@ their outputs are of the same size.
=head1 RETURN VALUES
These functions return a B<EVP_MD> structure that contains the
implementation of the symmetric cipher. See L<EVP_MD_meth_new(3)> for
implementation of the message digest. See L<EVP_MD_meth_new(3)> for
details of the B<EVP_MD> structure.
=head1 CONFORMING TO
@@ -63,7 +63,7 @@ L<EVP_DigestInit(3)>
=head1 COPYRIGHT
Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2017-2022 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
+2 -2
View File
@@ -54,7 +54,7 @@ B<EVP_shake256> provides that of 256 bits.
=head1 RETURN VALUES
These functions return a B<EVP_MD> structure that contains the
implementation of the symmetric cipher. See L<EVP_MD_meth_new(3)> for
implementation of the message digest. See L<EVP_MD_meth_new(3)> for
details of the B<EVP_MD> structure.
=head1 CONFORMING TO
@@ -68,7 +68,7 @@ L<EVP_DigestInit(3)>
=head1 COPYRIGHT
Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2017-2022 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
+2 -2
View File
@@ -28,7 +28,7 @@ The SM3 hash function.
=head1 RETURN VALUES
These functions return a B<EVP_MD> structure that contains the
implementation of the symmetric cipher. See L<EVP_MD_meth_new(3)> for
implementation of the message digest. See L<EVP_MD_meth_new(3)> for
details of the B<EVP_MD> structure.
=head1 CONFORMING TO
@@ -42,7 +42,7 @@ L<EVP_DigestInit(3)>
=head1 COPYRIGHT
Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2017-2022 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2017 Ribose Inc. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
+2 -2
View File
@@ -30,7 +30,7 @@ input.
=head1 RETURN VALUES
These functions return a B<EVP_MD> structure that contains the
implementation of the symmetric cipher. See L<EVP_MD_meth_new(3)> for
implementation of the message digest. See L<EVP_MD_meth_new(3)> for
details of the B<EVP_MD> structure.
=head1 CONFORMING TO
@@ -45,7 +45,7 @@ L<EVP_DigestInit(3)>
=head1 COPYRIGHT
Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2017-2022 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
+5 -4
View File
@@ -23,9 +23,10 @@ OPENSSL_LH_node_stats_bio, OPENSSL_LH_node_usage_stats_bio - LHASH statistics
The B<LHASH> structure records statistics about most aspects of
accessing the hash table.
OPENSSL_LH_stats() prints out statistics on the size of the hash table, how
many entries are in it, and the number and result of calls to the
routines in this library.
OPENSSL_LH_stats() prints out statistics on the size of the hash table and how
many entries are in it. For historical reasons, this function also outputs a
number of additional statistics, but the tracking of these statistics is no
longer supported and these statistics are always reported as zero.
OPENSSL_LH_node_stats() prints the number of entries for each 'bucket' in the
hash table.
@@ -58,7 +59,7 @@ L<bio(7)>, L<OPENSSL_LH_COMPFUNC(3)>
=head1 COPYRIGHT
Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
+47
View File
@@ -0,0 +1,47 @@
=pod
=head1 NAME
OPENSSL_strcasecmp, OPENSSL_strncasecmp - compare two strings ignoring case
=head1 SYNOPSIS
#include <openssl/crypto.h>
int OPENSSL_strcasecmp(const char *s1, const char *s2);
int OPENSSL_strncasecmp(const char *s1, const char *s2, size_t n);
=head1 DESCRIPTION
The OPENSSL_strcasecmp function performs a byte-by-byte comparison of the strings
B<s1> and B<s2>, ignoring the case of the characters.
The OPENSSL_strncasecmp function is similar, except that it compares no more than
B<n> bytes of B<s1> and B<s2>.
In POSIX-compatible system and on Windows these functions use "C" locale for
case insensitive. Otherwise the comparison is done in current locale.
=head1 RETURN VALUES
Both functions return an integer less than, equal to, or greater than zero if
s1 is found, respectively, to be less than, to match, or be greater than s2.
=head1 NOTES
OpenSSL extensively uses case insensitive comparison of ASCII strings. Though
OpenSSL itself is locale-agnostic, the applications using OpenSSL libraries may
unpredictably suffer when they use localization (e.g. Turkish locale is
well-known with a specific I/i cases). These functions use C locale for string
comparison.
=head1 COPYRIGHT
Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.
=cut
+4 -4
View File
@@ -244,7 +244,7 @@ The following options can be set:
("indirect method")
Note that a signature-based POPO can only be produced if a private key
is provided as the newPkey or client pkey component of the CMP context.
is provided as the newPkey or client's pkey component of the CMP context.
=item B<OSSL_CMP_OPT_DIGEST_ALGNID>
@@ -441,7 +441,7 @@ The reference counts of those certificates handled successfully are increased.
OSSL_CMP_CTX_get0_untrusted(OSSL_CMP_CTX *ctx) returns a pointer to the
list of untrusted certs, which may be empty if unset.
OSSL_CMP_CTX_set1_cert() sets the certificate related to the private key
OSSL_CMP_CTX_set1_cert() sets the certificate related to the client's private key
used for CMP message protection.
Therefore the public key of this I<cert> must correspond to
the private key set before or thereafter via OSSL_CMP_CTX_set1_pkey().
@@ -468,7 +468,7 @@ Calling this function is optional; by default a chain construction
is performed on demand that is equivalent to calling this function
with the I<candidates> and I<own_trusted> arguments being NULL.
OSSL_CMP_CTX_set1_pkey() sets the private key corresponding to the
OSSL_CMP_CTX_set1_pkey() sets the client's private key corresponding to the
CMP signer certificate set via OSSL_CMP_CTX_set1_cert().
This key is used create signature-based protection (protectionAlg = MSG_SIG_ALG)
of outgoing messages
@@ -519,7 +519,7 @@ The I<priv> parameter must be 0 if and only if the given key is a public key.
OSSL_CMP_CTX_get0_newPkey() gives the key to use for certificate enrollment
dependent on fields of the CMP context structure:
the newPkey (which may be a private or public key) if present,
else the public key in the p10CSR if present, else the client private key.
else the public key in the p10CSR if present, else the client's private key.
If the I<priv> parameter is not 0 and the selected key does not have a
private component then NULL is returned.
+28 -12
View File
@@ -40,19 +40,35 @@ from various information provided in the CMP context argument I<ctx>
for inclusion in a CMP request message based on details contained in I<ctx>.
The I<rid> argument defines the request identifier to use, which typically is 0.
The subject DN to include in the certificate template is determined as follows.
If I<ctx> includes a subject name set via L<OSSL_CMP_CTX_set1_subjectName(3)>,
this name is used.
Otherwise, if a PKCS#10 CSR is given in I<ctx>, its subject is used.
Otherwise, if a reference certificate is given in I<ctx>
(see L<OSSL_CMP_CTX_set1_oldCert(3)>), its subject is used if I<for_KUR>
is nonzero or the I<ctx> does not include a Subject Alternative Name.
The subject DN included in the certificate template is
the first available value of these:
The public key to include is taken from any value set via
L<OSSL_CMP_CTX_set0_newPkey(3)>,
otherwise the public key of any PKCS#10 CSR is given in I<ctx>,
otherwise the public key of any reference certificate given in I<ctx>,
otherwise it is derived from the client private key if given in I<ctx>.
=over 4
=item any subject name in I<ctx> set via L<OSSL_CMP_CTX_set1_subjectName(3)>,
=item the subject field of any PKCS#10 CSR is given in I<ctx>, or
=item the subject field of any reference certificate given in I<ctx>
(see L<OSSL_CMP_CTX_set1_oldCert(3)>), if I<for_KUR> is nonzero
or the I<ctx> does not include a Subject Alternative Name.
=back
The public key included is the first available value of these:
=over 4
=item the public key derived from any key set via L<OSSL_CMP_CTX_set0_newPkey(3)>,
=item the public key of any PKCS#10 CSR is given in I<ctx>,
=item the public key of any reference certificate given in I<ctx>, or
=item the public key derived from any client's private key
set via L<OSSL_CMP_CTX_set1_pkey(3)>.
=back
The set of X.509 extensions to include is computed as follows.
If a PKCS#10 CSR is present in I<ctx>, default extensions are taken from there,
Loaded 100 of 220 files, more files were not shown because too many files have changed in this diff. Show more