summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Provide DSA_R_INVALID_PARAMETERS error codetb2023-03-042-2/+4
| | | | | | | This has been missing for a while already and will be used in a few upcoming commits. ok beck jsing
* Mop up ECP_NISTZ256_ASM and OPENSSL_NO_EC_NISTP_64_GCC_128 leftovers.jsing2023-03-042-22/+3
| | | | | This is `unifdef -m -DOPENSSL_NO_EC_NISTP_64_GCC_128 -UECP_NISTZ256_ASM` and some manual tidy up.
* Rename field_data1 and field_data2.jsing2023-03-042-48/+50
| | | | | | | | Rather than pretending that these "generic" variables are used for multiple things, rename them to reflect their actual usage and use appropriate types instead of void *. ok tb@
* bio_chain test: fix error messagetb2023-03-041-2/+2
|
* Avoid infinite loop in bio_asn1 state machinetb2023-03-041-2/+2
| | | | | | | | | | | | If the BIO_write() in the ASN1_STATE_DATA_COPY state fails, incorrect error handling will break out of the switch without changing the state, and the infinite for loop will immediately try the same write again, which is unlikely to succeed... Clearly this code intended to break out of the loop instead. Via OpenSSL 1.1 commit 723f616df81ea05f31407f7417f49eea89bb459a ok millert
* openssl/req: garbage collect a pointless EVP_MD_CTX_init()tb2023-03-041-2/+2
| | | | | | | Before do_sign_init(), the ctx is always allocated by EVP_MD_CTX_new() aka calloc(). There is no point in doing EVP_MD_CTX_init(), aka bzero(). ok jsing
* Simplify the ct Makefile slightlytb2023-03-021-7/+3
|
* Clean up the x509 regress make file a littletb2023-03-021-27/+10
|
* Remove a few more unnecessary line continuationstb2023-03-021-4/+4
|
* Nitpick error checks of BN_get_mem_data()tb2023-03-021-15/+27
| | | | | BN_get_mem_data() returns a non-positive long on error, so assigning it to a size_t and displaying that in error messages is incorrect.
* Some more Makefile cosmeticstb2023-03-021-10/+15
| | | | | The verbose evp test actually depends on the evptest binary. Use consistent spacing and indentation.
* The evp_ecx_test no longer needs static linkingtb2023-03-021-3/+1
|
* Hide the hexdumps behind a verbose flags. Should have been part oftb2023-03-021-26/+45
| | | | the previous commit.
* Simplify evp test Makefile.tb2023-03-021-18/+5
| | | | | Make evptest silent by default: these pages of hexdumps are useless noise. Add a verbose target for debugging.
* evp_pkey_check: make this test silent on successtb2023-03-021-18/+13
|
* Remove a few unnecessary line continuationstb2023-03-021-7/+7
|
* Comment out glob for JSON webcrypto tests for nowtb2023-03-011-2/+3
| | | | | Allows test to pass with the old version of the wycheproof-testvectors package.
* Link evp/cipher_method_lib.c to the buildtb2023-03-011-1/+2
| | | | ok jsing
* Convert EVP_CIPHER_meth_dup() to using calloc()tb2023-03-011-3/+2
| | | | | | | There is no reason for this to call EVP_CIPHER_meth_new(), as the flags will be copied a line later anyway. Simplify this. Requested by jsing
* Make cipher_method_lib.c compile with LibreSSLtb2023-03-011-15/+29
| | | | | | | OPENSSL_zalloc() -> calloc(), OPENSSL_free() -> free() and a few assorted cosmetic tweaks to match our style better. ok jsing
* Add EVP_CIPHER_meth_* prototypes to evp.htb2023-03-011-1/+25
| | | | | | | As usual, this will be guarded by LIBRESSL_INTERNAL || LIBRESSL_NEXT_API until the next bump. ok jsing
* Make the cleanup() method return an int againtb2023-03-014-7/+12
| | | | | | | | | This partially reverts jsing's OpenBSD commit b8185953, but without adding back the error check that potentialy results in dumb leaks. No cleanup() method in the wild returns anything but 1. Since that's the signature in the EVP_CIPHER_meth_* API, we have no choice... ok jsing
* Fix line wrapping of function pointer argumentstb2023-03-011-15/+8
| | | | ok jsing
* First KNF approximation as per knfmt(1)tb2023-03-011-60/+72
| | | | ok jsing
* Drop the EVP_CIPHER_METH_get_* functionstb2023-03-011-42/+1
| | | | | | | | Nothing interesting uses them. There's a Debian SSH-1 module and corresponding ncrack bits. That's not reason enough to have this garbage. ok jsing
* Add RCS tagtb2023-03-011-0/+1
|
* Revert OpenSSL commit aa6bb135tb2023-03-011-5/+54
| | | | | | | | | | | | This reinstates the original license on this file. Don't bother bumping the copyright year. Nothing interesting has happened in here since the initial commit. (There was one interesting commit though: "Don't care openssl_zmalloc()", which is interesting due to the lack of care, not because it's copyright worthy) ok jsing
* libcrypto: import a copy of OpenSSL 1.1's cmeth_lib.ctb2023-03-011-0/+151
| | | | | | | | | | This is the file as of OpenSSL 1.1.1 commit 82dfb986. Call the file cipher_method_lib.c since the short names in this directory are hard enough to read. This is a first step towards providing the poorly named EVP_CIPHER_meth_* API which is needed by some projects because of EVP_CIPHER opacity. ok jsing
* Rewrite/simplify BN_from_montgomery_word() and BN_from_montgomery().jsing2023-02-281-92/+85
| | | | | | | | Rename BN_from_montgomery_word() to bn_montgomery_reduce() and rewrite it to be simpler and clearer, moving further towards constant time in the process. Clean up BN_from_montgomery() in the process. ok tb@
* Explicitly skip the json_web* tests now.tb2023-02-281-1/+2
|
* Add a few missing NIDs for new Wycheproof tests.tb2023-02-281-1/+12
|
* Skip FRP256v1 curve in ECDH tests. We do not support it.tb2023-02-281-1/+6
|
* There is no reason to-be-cleared chunks cannot participate in delayedotto2023-02-271-27/+23
| | | | freeing; ok tb@
* Use separate lines instead of semicolons.bcook2023-02-251-4/+10
| | | | | | macOS aarch64 assembly dialect treats ; as comment instead of a newline ok tb@, jsing@
* Introduce X509_get0_uids() accessor functionjob2023-02-235-6/+44
| | | | | | | By introducing X509_get0_uids(), one can add RPKI profile compliance checks to conform the absence of the issuerUID and subjectUID. OK tb@ jsing@
* openssl speed: avoid bad pluraltb2023-02-231-5/+5
| | | | | | | Remedy a case of twitching eyes caused by seeing "Doing ... rsa's for 10s". If this breaks someone's script, so be it. ok jsing sthen
* Use explicit .text instead of .previous to please Windows/MinGW on amd64tb2023-02-2311-12/+12
| | | | ok miod
* Fix up the .rodata segment's name for Windows as well.tb2023-02-231-2/+3
| | | | | | | | Here we need .rdata with some alignment goo. Fortunately, this was already present for .pdata and .xdata, so the change is easy. Also, this is a code path that doesn't affect OpenBSD at all. ok jsing miod
* Adjust parentheses in mont->ri assignment.jsing2023-02-221-2/+2
| | | | Requested by tb@
* Replace bn_sub_part_words() with bn_sub().jsing2023-02-224-370/+19
| | | | | | | | Now that bn_sub() handles word arrays with potentially different lengths, we no longer need bn_sub_part_words() - call bn_sub() instead. This allows us to entirely remove the unnecessarily complex bn_sub_part_words() code. ok tb@
* Rework bn_add()/bn_sub() to operate on word arrays.jsing2023-02-223-82/+99
| | | | | | | | Rather than working on BIGNUMs, change bn_add()/bn_sub() to operate on word arrays that potentially differ in length. This matches the behaviour of s2n-bignum's bignum_add() and bignum_sub(). ok tb@
* Rewrite and simplify BN_MONT_CTX_set()jsing2023-02-222-98/+76
| | | | | | | | | | | | | | OpenSSL commit 4d524040bc8 changed BN_MONT_CTX_set() so that it computed a 64 bit N^-1 on both BN_BITS2 == 32 and BN_BITS2 == 64 platforms. However, the way in which this was done was to duplicate half the code and wrap it in #ifdef. Rewrite this code to use a single code path on all platforms, with #ifdef being limited to setting an additional word in the temporary N and storing the result on BN_BITS2 == 32 platforms. Also remove stack based BIGNUM in favour of using the already present BN_CTX. ok tb@
* perlasm: properly spell .rodata for macOS on inteltb2023-02-211-0/+3
| | | | ok jsing
* remove extra argumentbcook2023-02-211-2/+2
| | | | ok tb@
* Unifdef MONT_WORD.jsing2023-02-212-75/+5
| | | | | | | | | | | It does not make sense to use code that is slower, currently broken and prevents the use of assembly Montgomery implementations. This is the result of `unifdef -m -DMONT_WORD`, followed by some manual clean up and the removal of the Ni bignum from BN_MONT_CTX (which was only used in the non-MONT_WORD case). ok miod@ tb@
* Move BN_MONT_CTX back to bn_local.h for now. It's still used by bn_exp.ctb2023-02-192-14/+14
|
* Rewrite BN_MONT_CTX_set_locked()jsing2023-02-191-23/+27
| | | | | | | | Rewrite and simplify BN_MONT_CTX_set_locked - in particular, only hold the lock for a short period of time, rather than holding a write lock for a module across an expensive operation. ok tb@
* First pass clean up of bn_mont.c.jsing2023-02-191-31/+37
| | | | | | | | | Use calloc() rather than malloc() with manual initialisation of all struct members to zero, use memset() instead of manually initialising all struct members to zero, use consistent naming, use BN_free() instead of BN_clear_free() (since it is the same thing). ok tb@
* Move BN_MONT_CTX_copy().jsing2023-02-191-19/+19
|
* Move struct bn_mont_ctx_st from bn_local.h to bn_mont.c.jsing2023-02-192-14/+14
| | | | | | No code outside of bn_mont.c needs access to it. ok tb@