summaryrefslogtreecommitdiffstats
path: root/test/certs/bad-othername-namec-inter.pem (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-01-26Add support for signed BIGNUMs in the OSSL_PARAM_BLD APIRichard Levitte3-15/+52
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17162)
2022-01-26Add support for signed BIGNUMs in the OSSL_PARAM APIRichard Levitte2-24/+42
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17162)
2022-01-26UI: Check for NULL pointer after calling OPENSSL_memdupJiasheng Jiang1-2/+5
The OPENSSL_memdup() is not always success, as the potential failure of the allocation. Then the '*pptr'could be NULL pointer but the ui_dup_method_data() will still return 1. In CRYPTO_dup_ex_data(), the 'storage[i]->dup_func' will not fail and 'ptr' will be used in CRYPTO_set_ex_data(). Also, if '*pptr' is NULL, I think it should also return 0 to tell the caller that the duplication fails in order to prevernt using the NULL pointer. Therefore, it should be better to add the check and return 1 only if the duplication succeed. Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17582)
2022-01-26Allow empty passphrase in PEM_write_bio_PKCS8PrivateKey_nid()Darshan Sen3-3/+17
Signed-off-by: Darshan Sen <raisinten@gmail.com> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17507)
2022-01-26Fix invalid malloc failures in PEM_write_bio_PKCS8PrivateKey()Darshan Sen4-2/+33
When `PEM_write_bio_PKCS8PrivateKey()` was passed an empty passphrase string, `OPENSSL_memdup()` was incorrectly getting used for 0 bytes size allocation, which resulted in malloc failures. Fixes: https://github.com/openssl/openssl/issues/17506 Signed-off-by: Darshan Sen <raisinten@gmail.com> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17507)
2022-01-26x509: add the check for X509_STORE_lockJiasheng Jiang1-7/+25
Since we may fail to get the lock, for example there is no lock, the X509_STORE_lock() will return 0. Therefore, we should check it in order to prevent the dirty data. Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17575)
2022-01-25test/ct_test.c: Add the missing check after calling sk_SCT_new_nullJiasheng Jiang1-0/+3
As the potential failure of the allocation, the sk_SCT_new_null() could return NULL pointer if fails. And then sk_SCT_push() uses the 'fixture->sct_list' and returns -1 if fails. But the return value of the sk_SCT_push() is not checked. I think it is better to check it just after the allocation. CLA: trivial Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17571)
2022-01-25evp_test: Add the missing check after calling OPENSSL_mallocJiasheng Jiang1-2/+6
The OPENSSL_zalloc() could return NULL pointer if fails. Add the check for it does make sense, like how digest_test_init() deals with. CLA: trivial Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17571)
2022-01-25Optimize AES-GCM for uarchs with unroll and new instructionsXiaokangQian8-18/+7546
Increase the block numbers to 8 for every iteration. Increase the hash table capacity. Make use of EOR3 instruction to improve the performance. This can improve performance 25-40% on out-of-order microarchitectures with a large number of fast execution units, such as Neoverse V1. We also see 20-30% performance improvements on other architectures such as the M1. Assembly code reviewd by Tom Cosgrove (ARM). Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15916)
2022-01-24AES-GCM performance optimzation with stitched method for p9+ ppc64leDanny Tsen5-1/+1494
Assembly code reviewed by Shricharan Srivatsan <ssrivat@us.ibm.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16854)
2022-01-24`make clean` should clean up fips provider shared object.Todd Short1-1/+1
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17556) (cherry picked from commit 45036df45048c6498efa49d3572869830d05df45)
2022-01-23self_test.h: fix the C++ wrappingPauli1-4/+3
Fixes #17557 Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17562)
2022-01-21Standardize progress callback for dhparam, dsaparam, etc.Philip Prindeville6-82/+21
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17359)
2022-01-21LEGACY PROV: Reimplement the ERR building blocks in upcall termsRichard Levitte1-0/+102
This involves the following functions: ERR_new(), ERR_set_debug(), ERR_set_error(), ERR_vset_error(), ERR_set_mark(), ERR_clear_last_mark(), ERR_pop_to_mark(void) Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17474)
2022-01-21ERR: Move ERR_set_mark(), ERR_pop_to_mark() and ERR_clear_last_mark()Richard Levitte3-56/+70
Move them to their own source file, so they end up in a separate object file. This allows providers to override their implementation to use the corresponding OSSL_FUNC upcalls without having to reimplement everything from crypto/err/err.c. Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17474)
2022-01-21crypto/bio: drop float formating for UEFIGerd Hoffmann1-0/+20
Using floating point is not supported in UEFI and can cause build problems, for example due to SSE being disabled and x64 calling convention passing floats in SSE registers. Avoid those problems by not compiling the formating code for floating point numbers. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17547)
2022-01-21Revert "crypto/bio: fix build on UEFI"Gerd Hoffmann1-9/+0
This reverts commit 328bf5adf9e23da523d4195db309083aa02403c4. Turned out it isn't that simple, the fix is incomplete. So revert and try again with another approach. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17547)
2022-01-21Fix the same BIO_FLAGS macro definitionyangyangtiantianlonglong2-1/+3
Also add comment to the public header to avoid making another conflict in future. Fixes #17545 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17546)
2022-01-20TEST: Add a test of the new BN_signed set of functions in test/bntest.cRichard Levitte1-0/+132
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17139)
2022-01-20Add signed bn2bin and bin2bn functionsRichard Levitte4-32/+150
This adds the functions BN_signed_bin2bn(), BN_signed_bn2bin(), BN_signed_lebin2bn(), BN_signed_bn2lebin(), BN_signed_native2bn(), and BN_signed_bn2native(), all essentially doing the same job as BN_bin2bn(), BN_bn2binpad(), BN_lebin2bn(), BN_bn2lebinpad(), BN_native2bn(), and BN_bn2nativepad(), except that the 'signed' ones operate on signed number bins in 2's complement form. Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17139)
2022-01-20[refactor] BIGNUM: Modify bin2bn() to work from least to most significant chunkRichard Levitte1-22/+30
This will make it easier to introduce the possibility for signed input numbers. We also refactor the inner loop to simplify the calculation of each bignum chunk. Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17139)
2022-01-20BIGNUM: Add a comment on chunk order in struct bignum_stRichard Levitte1-2/+5
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17139)
2022-01-20[refactor] BIGNUM: Modify bn2binpad()'s setup to be more like bin2bn()'sRichard Levitte1-9/+20
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17139)
2022-01-20[refactor] BIGNUM: collapse BN_bin2bn() and BN_lebin2bn() into oneRichard Levitte1-52/+34
BN_lebin2bn() is a block copy of BN_bin2bn() with just a couple of very minute details changed. For better maintainability, we collapse them into the internal function bn2bin(), and change BN_bin2bn() and BN_lebin2bn() to become simple wrappers. Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17139)
2022-01-20Clarify flags argument of X509_check_ipTobias Nießen1-1/+2
Because no supported flag affects the behavior of X509_check_ip, the flags argument currently has no effect. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17536)
2022-01-20s_server: correctly handle 2^14 byte long recordsHubert Kario1-5/+9
as the code uses BIO_gets, and it always null terminates the strings it reads, when it reads a record 2^14 byte long, it actually returns 2^14-1 bytes to the calling application, in general it returns size-1 bytes to the caller This makes the code sub-optimal (as every 2^14 record will need two BIO_gets() calls) and makes it impossible to use -rev option to test all plaintext lengths (like in openssl#15706) Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17538)
2022-01-20Simpler square-root computation for Ed25519James Muir1-9/+4
Description: Mark Wooden and Franck Rondepierre noted that the square-root-mod-p operations used in the EdDSA RFC (RFC 8032) can be simplified. For Ed25519, instead of computing u*v^3 * (u * v^7)^((p-5)/8), we can compute u * (u*v)^((p-5)/8). This saves 3 multiplications and 2 squarings. For more details (including a proof), see the following message from the CFRG mailing list: https://mailarchive.ietf.org/arch/msg/cfrg/qlKpMBqxXZYmDpXXIx6LO3Oznv4/ Note that the Ed448 implementation (see ossl_curve448_point_decode_like_eddsa_and_mul_by_ratio() in ./crypto/ec/curve448/curve448.c) appears to already use this simpler method (i.e. it does not follow the method suggested in RFC 8032). Testing: Build and then run the test suite: ./Configure -Werror --strict-warnings make update make make test Numerical testing of the square-root computation can be done using the following sage script: def legendre(x,p): return kronecker(x,p) # Ed25519 p = 2**255-19 # -1 is a square if legendre(-1,p)==1: print("-1 is a square") # suppose u/v is a square. # to compute one of its square roots, find x such that # x**4 == (u/v)**2 . # this implies # x**2 == u/v, or # x**2 == -(u/v) , # which implies either x or i*x is a square-root of u/v (where i is a square root of -1). # we can take x equal to u * (u*v)**((p-5)/8). # 2 is a generator # this can be checked by factoring p-1 # and then showing 2**((p-1)/q) != 1 (mod p) # for all primes q dividing p-1. g = 2 s = p>>2 # s = (p-1)/4 i = power_mod(g, s, p) t = p>>3 # t = (p-5)/8 COUNT = 1<<18 while COUNT > 0: COUNT -= 1 r = randint(0,p-1) # r = u/v v = randint(1,p-1) u = mod(r*v,p) # compute x = u * (u*v)**((p-5)/8) w = mod(u*v,p) x = mod(u*power_mod(w, t, p), p) # check that x**2 == r, or (i*x)**2 == r, or r is not a square rr = power_mod(x, 2, p) if rr==r: continue rr = power_mod(mod(i*x,p), 2, p) if rr==r: continue if legendre(r,p) != 1: continue print("failure!") exit() print("passed!") Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17544)
2022-01-20Fix sm3ss1 translation issue in sm3-armv8.plfangming.fang1-8/+7
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17542)
2022-01-19ssl: better support TSAN operationsPauli6-27/+93
For platforms that do not have native TSAN support, locking needs to be used instead. This adds the locking. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17489)
2022-01-19test: add cipher context dup testPauli1-2/+9
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17529)
2022-01-19test: add digest context dup testsPauli2-12/+41
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17529)
2022-01-19doc: document digest and cipher dup functionsPauli2-2/+35
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17529)
2022-01-19Add context dup functions for digests and ciphersPauli4-0/+26
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17529)
2022-01-19fix indentationPauli2-5/+5
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17529)
2022-01-18SM4 optimization for ARM by HW instructionDaniel Hu10-60/+945
This patch implements the SM4 optimization for ARM processor, using SM4 HW instruction, which is an optional feature of crypto extension for aarch64 V8. Tested on some modern ARM micro-architectures with SM4 support, the performance uplift can be observed around 8X~40X over existing C implementation in openssl. Algorithms that can be parallelized (like CTR, ECB, CBC decryption) are on higher end, with algorithm like CBC encryption on lower end (due to inter-block dependency) Perf data on Yitian-710 2.75GHz hardware, before and after optimization: Before: type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes SM4-CTR 105787.80k 107837.87k 108380.84k 108462.08k 108549.46k 108554.92k SM4-ECB 111924.58k 118173.76k 119776.00k 120093.70k 120264.02k 120274.94k SM4-CBC 106428.09k 109190.98k 109674.33k 109774.51k 109827.41k 109827.41k After (7.4x - 36.6x faster): type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes SM4-CTR 781979.02k 2432994.28k 3437753.86k 3834177.88k 3963715.58k 3974556.33k SM4-ECB 937590.69k 2941689.02k 3945751.81k 4328655.87k 4459181.40k 4468692.31k SM4-CBC 890639.88k 1027746.58k 1050621.78k 1056696.66k 1058613.93k 1058701.31k Signed-off-by: Daniel Hu <Daniel.Hu@arm.com> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17455)
2022-01-18dh_exch.c: Correct gettable parameters for DH key exchangeTomas Mraz1-1/+1
Fixes #17510 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17515)
2022-01-18e_dasync: remove empty statementPauli1-1/+0
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17528)
2022-01-18demo: remove end of line whitespacePauli1-1/+1
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17528)
2022-01-18speed: rework if condition to avoid empty statementPauli1-3/+1
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17528)
2022-01-18replace ;; with ; as statement separatorPauli3-3/+3
Fixes #17525 Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17528)
2022-01-18apps/ca: replace ;; with ; as statement separatorPauli1-1/+1
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17528)
2022-01-18ssl: replace ;; with ; as statement separatorPauli3-3/+3
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17528)
2022-01-18Fix mistake in ERR_peek_error_all documentation.Kevin Jones1-1/+1
The `func` parameter was incorrect. It was documented as `const char *func` instead of `const char **func`. CLA: trivial Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17522)
2022-01-17bn_ppc.c: Fix build failure on AIX with XLC/XLCLANGTomas Mraz1-1/+1
These compilers define _ARCH_PPC64 for 32 bit builds so we cannot depend solely on this define to identify 32 bit build. Fixes #17087 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17497)
2022-01-17dhtest: Add testcase for EVP_PKEY_CTX_set_dh_nidTomas Mraz1-0/+28
And a negative testcase for EVP_PKEY_CTX_set_dhx_rfc5114 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17498)
2022-01-17Do not call ossl_ffc_name_to_dh_named_group with NULL argumentTomas Mraz2-0/+2
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17498)
2022-01-17Properly return error on EVP_PKEY_CTX_set_dh_nid and ↵Tomas Mraz1-6/+17
EVP_PKEY_CTX_set_dhx_rfc5114 Fixes #17485 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17498)
2022-01-17Fix typo in SSL_CTX_set_dh_autoEasySec1-1/+1
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17499)
2022-01-17ssl/t1_enc: Fix kTLS RX offload pathDmytro Podgornyi1-1/+1
During counting of the unprocessed records, return code is treated in a wrong way. This forces kTLS RX path to be skipped in case of presence of unprocessed records. CLA: trivial Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17492)
2022-01-15property: reduce memory consumption when OPENSSL_SMALL_FOOTPRINT is defined.Pauli1-4/+46
This takes out the lock step stacks that allow a fast property to name resolution. Follow on from #17325. Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17388)