summaryrefslogtreecommitdiff
path: root/src/lib (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* rsa_priv_encode: plug leak on PKCS8_pkey_set0() failuretb2023-08-101-15/+19
| | | | | | Change the code to use safer idioms and avoid nested function calls. ok jsing
* Improve byte order handling in gcm128.jsing2023-08-101-329/+44
| | | | | | Replace a pile of byte order handling mess with htobe*() and be*toh(). ok tb@
* Remove MD32_REG_T.jsing2023-08-106-48/+16
| | | | | | | | | This is a hack that is only enabled on a handful of 64 bit platforms, as a workaround for poor compiler optimisation. If you're running an archiac compiler on an archiac architecture, then you can deal with slightly lower performance. ok tb@
* Add the forgotten .In lineschwarze2023-08-091-3/+4
| | | | and fix a typo: s/content objects/content octets/.
* In objects.h rev. 1.14 and 1.15 (Jan 2022), tb@ providedschwarze2023-08-091-5/+65
| | | | | OBJ_get0_data(3) and OBJ_length(3). Document them. Feedback and OK tb@.
* Rework BN_BLINDING to use pthread_t directlytb2023-08-093-28/+18
| | | | | | | | | | Instead of CRYPTO_THREADID, which passes pthread_via through unsigned long, we can use pthread_self() and pthread_equal() directly. This commit keeps using the awkward 'local' nomenclature as that is used throughout the rsa code. This will be changed after the blinding code will have been fully merged into rsa_blinding.c. ok jsing
* Merge remainder of rsa_crpt.c into rsa_eay.ctb2023-08-093-130/+55
| | | | | Most of these are one line wrappers around methods implemented in rsa_eay.c by default.
* Move RSA blinding API from rsa_crpt.c to rsa_blinding.ctb2023-08-092-102/+102
|
* Move RSA_blinding_{on,off}() to the bottom of the filetb2023-08-091-29/+29
|
* Move bn_blind.c to rsa_blinding.ctb2023-08-094-13/+14
| | | | discussed with jsing
* Make declaration and definition of BN_BLINDING_new() match.tb2023-08-092-4/+4
| | | | Also, make mod const.
* Merge BN_BLINDING_create_param() into BN_BLINDING_new()tb2023-08-093-33/+16
|
* Set up the blinding factors on first usetb2023-08-091-27/+14
| | | | | | | Only call BN_BLINDING_setup() from BN_BLINDING_update(). This allows another simplification of the counter logic. ok jsing
* Remove retry loop in BN_BLINDING_setup()tb2023-08-091-24/+5
| | | | | | | If we generate a non-invertible blinding, we have accidentally factored the modulus. This won't happen, so get rid of this ugly complication. ok jsing
* Compute a square using BN_mod_sqr() instead of BN_mod_mul()tb2023-08-091-3/+3
| | | | ok jsing
* Simplify BN_BLINDING_invert()tb2023-08-091-14/+5
| | | | | | | If the blinding is non-NULL, Ai is set on it, so no need to check for that. Also, we can get away with a single call to BN_mod_mul(). ok jsing
* Unwrap a linetb2023-08-091-3/+2
|
* Unwrap a linetb2023-08-081-3/+2
|
* Drop the unused BN_BLINDING argument of BN_BLINDING_create_param()tb2023-08-083-14/+11
|
* Rename ret into b in BN_BLINDING_setup()tb2023-08-081-8/+8
|
* Factor the actual setup step for the blinding into a helpertb2023-08-081-30/+43
| | | | ok jsing
* Make BN_BLINDING respect some invariantstb2023-08-081-48/+17
| | | | | | | | | | | | Pass e and mod into BN_BLINDING_new() for now and unconditionally allocate A and Ai. This way non-NULL blindings always have these four members set. This allows removing several unnecessary checks in the update, convert and parameter creation code paths. Fix exit BN_BLINDING_create_param() so as to signal errors to the caller if a non-NULL blinding was passed. This fixes a long standing bug. ok jsing
* Simplify RSA_setup_blinding()tb2023-08-081-21/+16
| | | | | | | Make this look a bit more like other code we cleaned up avoiding nesting and unnecessary else branches. ok jsing
* Remove ECDSA nonce padding kludgetb2023-08-081-22/+1
| | | | | | | | | | | This was a workaround due to the historically non-constant time scalar multiplication in the EC code. Since Brumley and Tuveri implemented the Montgomery ladder, this is no longer useful and should have been removed a long time ago, as it now does more harm than good. Keep the preallocations as they still help hiding some timing info. ok jsing
* Fix two leaks in BIO_dup_chain()tb2023-08-071-19/+17
| | | | | | | | If CRYPTO_dup_ex_data() fails, the new_bio is leaked. If an error occurs after the first iteration, all members of the new chain except the head are leaked. ok jsing
* Add missing space before =tb2023-08-071-2/+2
|
* remove trailing comma in NAME;jmc2023-08-051-3/+3
|
* Move the ENGINE_new() prototype a line downtb2023-08-041-2/+2
|
* Make the bn_rand_interval() API a bit more ergonomictb2023-08-0310-47/+52
| | | | | | | | | | | | | | | | | | Provide bn_rand_in_range() which is a slightly tweaked version of what was previously called bn_rand_range(). The way bn_rand_range() is called in libcrypto, the lower bound is always expressible as a word. In fact, most of the time it is 1, the DH code uses a 2, the MR tests in BPSW use 3 and an exceptinally high number appears in the Tonelli-Shanks implementation where we use 32. Converting these lower bounds to BIGNUMs on the call site is annoying so let bn_rand_interval() do that internally and route that through bn_rand_in_range(). This way we can avoid using BN_sub_word(). Adjust the bn_isqrt() test to use bn_rand_in_range() since that's the only caller that uses actual BIGNUMs as lower bounds. ok jsing
* Remove unused sk/lh macrostb2023-08-031-170/+1
| | | | ok jsing miod
* More whitespace fixes from knfmttb2023-08-021-7/+7
|
* Remove extraneous parentheses and fix weird whitespace.tb2023-08-021-16/+15
|
* Drop the _ex from BN_BLINDING_{convert,invert}_ex()tb2023-08-023-12/+12
|
* Remove the unused BN_BLINDING_{convert,invert}()tb2023-08-022-16/+2
| | | | ok jsing
* Make BN_BLINDING_{new,update}() static in bn_blind.ctb2023-08-022-6/+4
| | | | ok jsing
* Remove the unused flags member of BN_BLINDINGtb2023-08-022-10/+4
| | | | | | | Nothing sets this, so remove it along with BN_BLINDING_NO_{UPDATE,RECREATE} and some checks that are always true. ok jsing
* Remove the unused flags accessors for BN_BLINDINGtb2023-08-022-16/+2
| | | | ok jsing
* Remove a 16 year old confusing lietb2023-08-021-2/+2
| | | | | The mod member of BN_BLINDING hasn't been /* just a reference */ since the branch prediction mitigations in OpenSSL bd31fb21 from March 2007.
* Remove more *_options() stufftb2023-07-315-50/+5
| | | | | | | The public symbols were removed. Some prototypes and in the case of DES even the implementation remained. ok jsing
* Move HAVE_FUNOPEN out of !NOPICtb2023-07-291-5/+1
| | | | | | | | Due to some historic accident, HAVE_FUNOPEN was grouped with DSO_DLFCN and HAVE_DLFCN_H inside !defined(NOPIC). While the two DLFCN bits belong there, HAVE_FUNOPEN doesn't. ok jsing, millert agrees
* Garbage collect rodata only used by RC4_options()tb2023-07-291-5/+0
| | | | build tested by miod
* Add _libre_CMS_{,SignerInfo}_get_versiontb2023-07-291-0/+2
|
* Remove {BN,idea}_options() leftoverstb2023-07-293-6/+2
| | | | | Some *_options() prototypes were left behind in headers. I will remove them after my amd64 ports bulk completes.
* Remove BF_options() documentationtb2023-07-291-9/+3
|
* reinstate KNF for commenttb2023-07-291-2/+2
|
* Also remove ecdh.h use from libssltb2023-07-281-2/+1
|
* Stop including ecdsa.h and ecdh.h internallytb2023-07-288-21/+9
| | | | | | | | These headers are now reduced to #include <openssl/ec.h> and are provided for compatiblity only. There's no point in using them. At the same time garbage collect the last uses of OPENSSL_NO_{ECDSA,ECDH} in our tree. ok jsing
* The CRYPTO_EX_DATA type is not opaquetb2023-07-281-5/+2
| | | | | | | | | By API misdesign, it cannot be opaque. The incorrect documentation was added as a part of a huge commit with a lot of churn. CRYPTO_EX_DATA typically lives as an embedded struct of an opaque struct, but it can also be used by applications, for example to initialize libssl. documentation error pointed out by jsing
* remove X509_ATTRIBUTE_SET_itjsg2023-07-281-14/+1
| | | | | public symbol removed in April ok tb@
* Combine ripemd into a single C file.jsing2023-07-283-84/+20
|