summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_transcript.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-02-03Rework the exit path of tls13_handshake_recv_action()tb1-12/+14
If an error occurs in action->recv() for a handshake that needs to downgrade to legacy TLS, the artistic exit path led to hiding the error under TLS13_IO_USE_LEGACY. Rework the exit path to be easier to follow, preserving behavior except that the error can no longer be masked. Detailed analysis and initial diff by Masaru Masuda. Fixes https://github.com/libressl/openbsd/issues/146 ok beck
2024-02-03Remove last peeking at TLS1_FLAGS_SKIP_CERT_VERIFYtb1-7/+1
This was used for some GOST weirdness. The flag is unused in ports and there is no user in Debian's codesearch. ok beck
2024-02-03Zap a trailing blank that snuck into ssl3_get_client_hello()tb1-2/+2
2024-02-03Remove GOST and STREEBOG support from libssl.beck21-871/+148
This version of GOST is old and not anywhere close to compliant with modern GOST standards. It is also very intrusive in libssl and makes a mess everywhere. Efforts to entice a suitably minded anyone to care about it have been unsuccessful. At this point it is probably best to remove this, and if someone ever showed up who truly needed a working version, it should be a clean implementation from scratch, and have it use something closer to the typical API in libcrypto so it would integrate less painfully here. This removes it from libssl in preparation for it's removal from libcrypto with a future major bump ok tb@
2024-02-02Ignore EVP_MD_CTX_reset() return valuetb1-6/+4
Also drop now unnecessary NULL checks before it.
2024-02-02Ignore EVP_CIPHER_CTX_reset() return value, it can't failtb1-2/+2
2024-02-02Reimplement BIO_dump_indent() with CBS/CBB and BIO_printf()tb1-64/+115
Instead of heaps of unchecked strlcpy/strlcat/snprintf doing hard to follow gymnastics, use a byte string, a somewhat comprehensible computation of the number of bytes to dump per output line and write using checked BIO_printf() directly to the BIO. Longer strings will still overflow the terminal width of 80 and even longer strings will still overflow the return value (undefined behavior). I don't care much about the former but the latter should be fixed in a later pass. ok beck
2024-02-02bio_dump: fix indenttb1-32/+32
2024-02-02bio_dump: add one more testcasetb1-2/+36
This one covers the silly minuses between the hexdump and the ASCII dump when dumping eight bytes per line.
2024-02-02Add regress coverage for BIO_dump()tb2-1/+745
2024-02-01Fix the verifier to use the trust storebeck1-1/+13
the trust store is yet another obscure way to add a trust anchor
2024-02-01Inline EVP_PBE_find() in its last two callerstb1-140/+69
This API was already cleaned up quite a bit, but it is unused in the ecosystem and the two internal callers can be simplified a lot when inlining the lookups. EVP_PBE_CipherInit() can walk the table of "outer" PBEs and reach into the matching pbe for its cipher_nid, md_nid and keygen(). PKCS5_v2_PBKDF2_keyivgen() uses EVP_PBE_find() as a way to mapping a PRF (given by the nid of an HMAC with some digest) to the digest's nid. This can be done by a simple switch. Move MD5 to the top and GOST to the end in that switch and wrap the latter in OPENSSL_NO_GOST, so it will go away once we define OPENSSL_NO_GOST. ok beck
2024-02-01Prepare to remove the _cb() and _fp() versions of BIO_dump()tb1-33/+30
apache-httpd uses BIO_dump(), libssl uses BIO_dump_indent(), and the openssl(1) app uses both. Otherwise this is unused. This is horribly bad code even by libcrypto standards. By doing away with the callbacks fixes incorrect error checking for fwrite() but there is a lot more wrong in here. This can be cleaned up in a later pass, the only concern here is to be able to remove the unused variants in the next major bump. ok beck
2024-01-31Merge OBJ_NAME_do_all*(3) into EVP_CIPHER_do_all(3)tb5-63/+96
This is the only OBJ_NAME API that will remain after the next major bump. The API is misnamed and really is about EVP, so move it to an EVP manual documenting another API doing essentially the same thing. Remove most cross references to OBJ_NAME_*.
2024-01-30Remove now unnecessary NULL check before EVP_CIPHER_CTX_cleanup()tb1-3/+2
2024-01-30Make EVP_{CIPHER,MD}_CTX_{cleanup,reset}() NULL-safetb2-3/+8
We have a bunch of code that relies on this. Surely there is code out there in the wider ecosystem that relies on these being NULL-safe by now since upstream sprinkles NULL checks wherever they can. ok beck joshua
2024-01-30Restore SSL_shutdown() two step sequence.jsing1-1/+3
Change SSL_shutdown() such that it will return 0 after sending a close-notify, before potentially returning 1 (indicating that a close-notify has been sent and received) on a subsequent call. Some software depends on this behaviour, even though there are cases where the first call could immediately return 1 (for example, when the peer has already sent a close-notify prior to SSL_shutdown() being called). ok tb@
2024-01-30Add a shutdown sequence regress test.jsing1-3/+133
Some software relies on SSL_shutdown() returning 0 (indicating close-notify sent) before returning 1 on a subsequent call (indicating close-notify sent and received). It is worth noting that there is no guarantee that this will occur in normal operation, as the peer could send a close-notify prior to SSL_shutdown() being called. This is currently failing for TLSv1.3.
2024-01-29Add id-ct-rpkiSignedPrefixList NIDjob1-0/+1
References: https://datatracker.ietf.org/doc/draft-ietf-sidrops-rpki-prefixlist/ https://www.iana.org/assignments/smi-numbers/smi-numbers.xhtml#security-smime-1 OK tb@
2024-01-29Add id-ct-rpkiSignedPrefixList OIDjob1-0/+1
References: https://datatracker.ietf.org/doc/draft-ietf-sidrops-rpki-prefixlist/ https://www.iana.org/assignments/smi-numbers/smi-numbers.xhtml#security-smime-1 OK tb@
2024-01-29Curious to see if explicitly ignoring the return value appeases Coveritytb1-2/+2
2024-01-28The KNF script didn't grok LHASH_OF(), STACK_OF()tb1-9/+9
2024-01-28Avoid calling EVP_CIPHER_CTX_reset() on a NULL ctxtb1-2/+3
2024-01-28Clean up EVP_CIPHER_CTX_init() usage in cmac.cjoshua1-25/+33
This replaces usage of EVP_CIPHER_CTX_init() with EVEP_CIPHER_CTX_new(), and EVP_CIPHER_CTX_cleanup() with EVP_CIPHER_CTX_reset(). This also replaces usage of malloc with calloc, and free with freezero. ok tb@
2024-01-28Clean up EVP_MD_CTX_{init,cleanup}() usage in ASN1_item_verify()joshua1-9/+10
ok tb@
2024-01-27Dynamic EVP_PKEY_METHODs are a thing from the pasttb1-3/+1
2024-01-27Add a few aliases for ECDSA and DSA for security/xcatb1-1/+143
ok jsing
2024-01-27Use ret instead of rv in a few keyivgen functionstb1-11/+11
2024-01-27Fold keyivgen functions into evp_pbe.ctb5-599/+387
These are only used by the EVP_PBE routines and will become internal in the next major bump.
2024-01-27Make some comments and some whitespace less uglytb1-13/+14
2024-01-27Whitespace tweaktb1-2/+4
2024-01-27Throw PKCS5_PBE_add() into the trash bin at the end of evp_pbe.ctb2-10/+7
This has been a noop since forever and will be removed in the next bump.
2024-01-27Mark the functions at the end of this file for removaltb1-1/+5
2024-01-27Support HMAC with SHA-3 as a PBE PRFtb1-1/+21
ok jsing
2024-01-27Support HMAC with truncated SHA-2 as a PBE PRFtb1-1/+11
ok jsing
2024-01-27Teach OBJ_find_sigid_{,by_}algs(3) about ECDSA with SHA-3tb1-1/+21
This allows signing and verifying ASN.1 "items" using the ECDSA with SHA-3 signature algorithms. With this diff, ECDSA certificates and CMS products using ECDSA with SHA-3 can be generated using the openssl command line tool. ok jsing
2024-01-27Enable for TLSv1.3 now that shutdown behaviour matches the legacy stack.jsing1-3/+1
2024-01-27Rework tls13_legacy_shutdown() to match the legacy stack behaviour.jsing1-18/+19
Respect the ssl->shutdown flags rather than what has actually happened, return -1 for all EOF errors and completely ignore the return value when attempting to read a close-notify from the wire. ok tb@
2024-01-27Make tls13_legacy_return_code() static.jsing2-4/+3
2024-01-27Add message callbacks for alerts in the TLSv1.3 stack.jsing3-10/+49
This will make it easier to regress test shutdown behaviour in the TLSv1.3 stack. Additionally, `openssl -msg` now shows alerts for TLSv1.3 connections. ok tb@
2024-01-27Allocate a fixed NID for the acmeIdentifer OIDtb1-0/+1
ok job jsing
2024-01-27Add data for the RFC 8737 acmeIdentifiertb1-0/+1
This teaches the object database OID, long and short names for the ACME identifier X.509v3 extension defined in RFC 8737. ok job jsing
2024-01-26Add 'openssl x509 -new' functionality to the libcrypto CLI utilityjob3-15/+121
The ability to generate a new certificate is useful for testing and experimentation with rechaining PKIs. While there, alias '-key' to '-signkey' for compatibility. with and OK tb@
2024-01-25Plug a few leaks and perform some other code hygienetb1-34/+59
Closing this directory now until the daily Coverity run throws a hissy fit. ok jsing
2024-01-25This table no longer needs to be sortedtb1-5/+1
2024-01-25p12_npas.c: hoist some helpers from the bottom to the top in reverse ordertb1-64/+53
2024-01-25p12_npas.c: maclen -> mac_lentb1-4/+4
2024-01-25p12_npas.c: Use slightly less awkward variable namestb1-21/+21
2024-01-25Fix various NULL dereferences in PKCS #12tb5-15/+37
The PKCS #7 ContentInfo has a mandatory contentType, but the content itself is OPTIONAL. Various unpacking API assumed presence of the content type is enough to access members of the content, resulting in crashes. Reported by Bahaa Naamneh on libressl-security, many thanks ok jsing
2024-01-25Merge PKCS12_newpass() and newpass_p12()tb1-37/+20
With the previous refactoring, newpass_p12() became simple enough that it doesn't require a separate function anymore. Merge the public API into it and move it below (most of) the things it calls. ok jsing