summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_mont.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2025-07-16Remove bss_log.c: no longer linked to buildtb1-216/+0
2025-07-16Undocument PEM_X509_INFO_read(3), X509_PKEY_new(3) and X509_PKEY_free(3)schwarze9-144/+31
because tb@ removed them from Symbols.list rev. 1.220 today.
2025-07-16This thread-aware profiling support diff comes from Yuichiro NAITO.deraadt1-1/+5
At runtime, profiling data is stored per-thread. Upon termination, the per-thread profiling data pools are merged into a into a single record, which is then written out (using the new kernel-assisted system). I think the original gmon merging parts may have come from or been inspired by someone at NetBSD. This has been delayed because there were concerns about adding a TLS object which would require other library cranks, so this rides all the major cranks today. ok kettenis tb claudio sthen etc etc etc
2025-07-16bump major for libssl and libtls to match libcryptotb2-4/+4
2025-07-16Ride the libcrypto bump with some simple cleanup:tb8-197/+15
Remove BIO_s_log(): already unhooked in portable, completely unused. Remove X509_PKEY_new/free from public API. Remove PEM_X509_INFO_read() PEM_X509_INFO_write_bio(): all unused garbage. The simplify X509_PKEY_new/free was ok kenjiro.
2025-07-16Make the FILE object opaque. Move the __sFILE definition intoyasuoka1-1/+1
libc/hidden/_stdio.h. All programs that refer to the internal structure of the FILE object can't be compiled from now on. std{in,out,err} doesn't refer __sF[] now, but the hidden __sF along with __srget and __swbuf symbols are kept temporarily to make our transition easier. But those symbols will be deleted soon. The shared library versions are bumped for libc and all the other libraries that refer to std{in,out,err}. diff from guenther, tweak by me, tested by many ok sthen tb
2025-07-13Simplify AES-XTS implementation and remove AES-NI specific code from EVP.jsing8-132/+117
Provide aes_xts_encrypt_internal() and call that from aes_xts_cipher(). Have amd64 and i386 provide their own versions that dispatch to aesni_xts_encrypt()/aesni_xts_decrypt() as appropriate. The AESNI_CAPABLE code and methods can then be removed. ok tb@
2025-07-12add libc specific __cmtx and __rcmtx locks for internal use.dlg1-1/+55
__cmtx provides mutual exclusion using futex(2) and cas on archs that support it, or _spinlocks on the rest. __rcmtx is a recursive mutex built on top of __cmtx, so it inherits the use of futex and cas/spinlock from __cmtx. until now the options we had for locking between threads in libc were spinlocks or pthread mutexes. spinlocks use sched_yield to relax if they have to spin on a contended lock, which we are trying to minimise the use of as much as possible. pthread_mutex is relatively large in memory and offers a lot of complicated features which are unecessary for most of libc. the non cas/futex version of pthread_mutexes currently relies on __thrsleep and __thrwakeup, which we also want to deprecate. having a small futex based lock available everywhere will help us move away from overuse of spinlocks, and deprecate __thrsleep and __thrwakeup. ok kettenis@ jca@ provided his eyes too.
2025-07-12Merge the two functions from x_pkey.c into pem_info.ctb3-127/+60
It looks like those can be unexported.
2025-07-12Merge the two functions from x_info.c into pem_info.ctb3-100/+36
X509_INFO_new() isn't used directly outside of this file, so this is a bit tidier.
2025-07-12pem_info.c: more include tweakstb1-8/+3
2025-07-12pem_info.c: fix includestb1-2/+6
2025-07-11X509_sign: make variables in SYNOPSIS match the ones used in DESCRIPTIONtb1-8/+8
2025-07-10X509_verify(): sync with X509_CRL_verify()tb1-2/+6
Check X509_ALGOR_cmp() explicitly against 0 and add an explanatory comment referring to the relevant RFC 5280 sections. ok beck kenjiro
2025-07-10Add missing check to X509_CRL_verify()tb1-1/+7
When fixing CVE-2014-8275 in commit 684400ce, Henson added a check that the AlgorithmIdentifier in the certificate's signature matches the one in the tbsCertificate. A corresponding check for CRLs was missed. BoringSSL added such a check in 2022, so this should be fine for us to do as well even though OpenSSL still doesn't have it. The only caller will set an error on the stack, so we don't do it here. There's no obvious check that X509_REQ_verify() could do. ok beck kenjiro
2025-07-09libcrypto regress: add interop harness for openssl/3.5tb8-10/+75
2025-07-09libcrypto regress: move GOCACHE to obj/tb3-12/+28
While it may be acceptable for Go to fill regular users' homedirs with a compiler cache that is unable to deal with corruption and full disks, this is terrible for people running regress as root since the cache can quickly grow to hundreds of megs and can thus result in all sorts hilarity below /root. Move the GOCACHE under ${.OBJDIR} and use a cleanup target to get rid of it again. This makes these tests a bit slower for regular users as well, but so be it. Let's see how this goes before I switch libtls to the same model. discussed with claudio and jsing
2025-07-07.Lb libtls libssl libcryptoschwarze12-24/+37
OK tb@ and no objection from tedu@
2025-07-06Move aes_ecb_encrypt_internal() prototype to aes_local.h.jsing2-5/+5
2025-07-06X509_get0_signature: call out inconsistent argument order in BUGStb1-2/+9
These annoying and careless inconsistencies were introduced when const was sprinkled everywhere without rhyme or reason.
2025-07-05Add minimal regress coverage for AES-XTSjsing1-2/+183
2025-07-04fix double word; ok tb@jsg1-3/+3
2025-07-02pkcs7.h: remove whitespace before opening paren.tb1-2/+2
fixes in particular ./check_complete.pl pkcs7
2025-07-02Const correct the documentation of EVP_PKEY_get{0,1}_{DH,DSA,EC_KEY,RSA}()tb1-9/+9
2025-07-02Const correct EVP_PKEY_get{0,1}_{DH,DSA,EC_KEY,RSA}()tb2-26/+22
These are safe to call concurrently and they don't modify the memory region pointed to by the pkey - they only bump the refcount of the key hanging off of it. The returned "legacy" key has to be handled with care in threaded constexts, so it is handed back as non-const. This also matches what EVP_PKEY_get0() always had. This way our signature is identical to BoringSSL's and doesn't cause compiler warnings in code that overuses const because one of the many API incoherencies added by OpenSSL 3 was to turn get0 into a function that takes and returns const while leaving get1 as it was. dlg agrees ok kenjiro
2025-07-02Fix documented EVP_PKEY{,_base}_id() signaturetb1-4/+4
These have been taking a const pkey ever since they were added in OpenSSL 1.0.0.
2025-07-02EVP_CipherInit_ex(): normalize EVP_CIPHER_CTX_ctrl() error checktb1-2/+2
While EVP_CIPHER_CTX_ctrl() can return a negative value this can't actually happen currently as all ciphers with EVP_CIPH_CTRL_INIT set normalize the EVP_CTRL_INIT return value to boolean in their ctrl() methods. Still, this check looks weird in grep, so align it. ok beck kenjiro
2025-07-01X509_print_ex.3: document X509_FLAG_NO_IDStb1-2/+7
ok job kenjiro
2025-07-01X509_print: emit UIDs unless X509_FLAG_NO_IDS is settb1-1/+28
issuerUID and subjectUID are a curiosity introduced in X.509v2 before extensions were a thing. Their purpose is to help distinguishing certs with identical subject. They are rarely used and are MUST NOT use in the CA/BF baseline requirements. They do occasionally show up in test certificates and it is confusing that openssl x509 silently ignores them. Their encoding also makes them relatively hard to spot in the output of asn1 parsing tools. The output is identical to OpenSSL < 3 and BoringSSL, but due to some weird tweaks added leading up to OpenSSL 3 their output is no longer compatible with that. It is not entirely correct anyway. Since it is a (not further specified) bit string, you shouldn't be ignoring its unused bits... The X509_FLAG_NO_IDS flag has no effect for CSRs. discussed with beck ok job kenjiro (on an earlier version)
2025-07-01x509.h: provide X509_FLAG_NO_IDStb1-1/+2
2025-06-29make the argument to ether_ntoa const.dlg2-5/+5
this drives me nuts when i want to print something out of what's already const. casting it works, but feels gross. ok guenther@ tb@ deraadt@ enh says this is already in bionic/glibc/musl
2025-06-28Provide accelerated SHA-1 for aarch64.jsing4-2/+253
Provide an assembly implementation of SHA-1 for aarch64 using the ARM Cryptographic Extension (CE). This results in around a 2x speed up for larger block sizes. ok tb@
2025-06-28Rework gcm128 implementation selection for amd64/i386.jsing7-61/+130
Provide gcm128_amd64.c and gcm128_i386.c, which contain the appropriate gcm128 initialisation and CPU feature tests for the respective platform. This allows for all of the #define spagetti to be removed from gcm128.c and removes one of the two remaining consumers of crypto_cpu_caps_ia32(). ok tb@
2025-06-28Use a single implementation of gcm_mul()/gcm_ghash().jsing1-19/+8
Since we always initialise the gmult/ghash function pointers, use the same implementaion of gcm_mul() and gcm_ghash(), regardless of the actual underlying implementation. ok tb@
2025-06-28Remove less than useful comment.jsing1-8/+1
2025-06-28Add CLMUL and MMX to machine dependent CPU capabilities for i386.jsing2-4/+10
ok tb@
2025-06-28Add CLMUL to machine dependent CPU capabilities for amd64.jsing2-4/+7
ok tb@
2025-06-27Simplify EVP AES-GCM implementation and remove AES-NI specific code.jsing3-175/+31
Like CTR, the mode implementation for GCM has two variants - rather than using multiple variants (one for AES-NI, another for non-AES-NI), consistently use CRYPTO_gcm128_{en,de}crypt_ctr32() with the aes_ctr32_encrypt_internal() function added for CTR mode. This lets us remove the AES-NI specific code, AES-NI specific EVP_CIPHER methods and the ctr function pointer from EVP_AES_GCM_CTX. ok tb@
2025-06-27Move AES-NI from EVP to AES for CTR mode.jsing6-76/+95
The mode implementation for CTR has two variants - one takes the block function, while the other takes a "ctr32" function. The latter is expected to handle the lower 32 bits of the IV/counter, but is not expected to handle overflow. The AES-NI implementation for CTR currently uses the second variant. Provide aes_ctr32_encrypt_internal() as a function that can be replaced on a machine dependent basis, along with an aes_ctr32_encrypt_generic() function that provides the default implementation and can be used as a fallback. Wire up the AES-NI version for amd64 and i386, change AES_ctr128_encrypt() to use CRYPTO_ctr128_encrypt_ctr32() (which calls aes_ctr32_encrypt_internal()) and remove the various AES-NI specific EVP_CIPHER methods for CTR. Callers of AES_ctr128_encrypt() will now use AES-NI, if available. ok tb@
2025-06-27Remove unused defines from aes_local.h.jsing1-5/+1
MAXKB was added in OpenSSL commit deb2c1a1 and appears to have never been used, while MAXKC (originally RIJNDAEL_MAXKC) stopped being used in that same commit. MAXNR is also unused - AES_MAXNR exists in the public header. ok tb@
2025-06-27openssl-ruby-tests: prepare for ruby default switch to 3.4tb1-4/+4
2025-06-25X509_print and friends: switch from BIO_write() to BIO_printf()tb1-17/+16
Manually counting letters in const strings is ... suboptimal. ok beck jsing
2025-06-24nc: document -Talpntb1-2/+6
From David Leadbeater
2025-06-24nc: add ALPN TLS option, so you can specify -T alpn=valuetb1-2/+8
From David Leadbeater with a report_tls tweak by me ok jsing
2025-06-24sort process_tls_opt[]tb1-2/+2
requested by jsing
2025-06-23sync anton's fix for OpenSSL 3.3 interop to 3.4tb1-2/+2
2025-06-23OpenSSL is linked against pthread by now; ok tb@anton1-2/+2
2025-06-16Remove AES-NI specific EVP_CIPHER methods for CFB/CFB1/CFB8.jsing1-205/+1
These now end up in aesni_encrypt() via AES_encrypt(), when appropriate. ok tb@
2025-06-16Remove AES-NI specific EVP_CIPHER methods for OFB.jsing1-64/+1
These now end up in aesni_encrypt() via AES_encrypt(), when appropriate. ok tb@
2025-06-16Remove AES-NI specific EVP_CIPHER methods for CBC.jsing1-66/+1
These now end up in aesni_cbc_encrypt() via AES_cbc_encrypt(), when appropriate. ok tb@