summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/cms (follow)
Commit message (Collapse)AuthorAgeFilesLines
* More include sweeping in cms.tb2024-11-013-17/+26
|
* Fix includes in cms_env.ctb2024-11-011-9/+10
|
* Only include cryptlib.h where it's neededtb2024-11-012-16/+14
| | | | Clean up the other includes while there.
* cms_att.c: tidy includes and add x509_local.h for upcoming changetb2024-08-271-5/+5
|
* Inline a few trivial X509at_* calls in cmstb2024-07-261-7/+7
| | | | ok jsing
* Hide global _it symbola in cms.hbeck2024-07-091-1/+3
| | | | ok tb@
* libcrypto: constify most error string tablestb2024-06-241-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | These constitute the bulk of the remaining global mutable state in libcrypto. This commit moves most of them into data.rel.ro, leaving out ERR_str_{functs,libraries,reasons} (which require a slightly different approach) and SYS_str_reasons which is populated on startup. The main observation is that if ERR_load_strings() is called with a 0 lib argument, the ERR_STRING_DATA argument is not actually modified. We could use this fact to cast away const on the caller side and be done with it. We can make this cleaner by adding a helper ERR_load_const_strings() which explicitly avoids the assignment to str->error overriding the error code already set in the table. In order for this to work, we need to sprinkle some const in err/err.c. CMS called ERR_load_strings() with non-0 lib argument, but this didn't actually modify the error data since it ored in the value already stored in the table. Annoyingly, we need to cast const away once, namely in the call to lh_insert() in int_err_set_item(). Fixing this would require changing the public API and is going to be tricky since it requires that the LHASH_DOALL_FN_* types adjust. ok jsing
* remove prototypes with no matching functionjsg2024-05-191-6/+1
| | | | feedback and ok tb@
* Remove more unnecessary GOST codetb2024-04-201-11/+1
| | | | ok jsing
* Rework CMS_add_simple_smimecap()tb2024-04-071-24/+43
| | | | | | | | | | | | | | | This is an API to add an OID attribute to the set of SMIMECapabilities. While attributes are complicated in general, this only supports simple capabilities encoded as an OID with an optional integer parameter (e.g., the key size of a cipher). Make this API transactional, i.e., don't leave a new empty set behind on failure or leak the key size if setting the parameter on the X509_ALGOR fails. Also convert to single exit and add a doc comment with a reference. ok beck
* Hide symbols in CMSjoshua2024-03-303-3/+12
| | | | ok jsing
* Remove pointless guard in cms headerjoshua2024-03-301-4/+2
| | | | ok jsing
* Implement Ed25519 signatures for CMS (RFC 8419)tb2024-03-291-20/+64
| | | | | | | | | | | | | | | | | | | | This adds support for Edwards curve digital signature algorithms in the cryptographic message syntax, as specified in RFC 8419. Only Ed25519 is supported since that is the only EdDSA algorithm that LibreSSL supports (this is unlikely to change ever, but, as they say - never is a very long time). This has the usual curly interactions between EVP and CMS with poorly documented interfaces and lots of confusing magic return values and controls. This improves upon existing control handlers by documenting what is being done and why. Unlike other (draft) implementations we also happen to use the correct hashing algorithm. There are no plans to implement RFC 8418. joint work with job at p2k23 ok jsing
* Stop playing #ifdef HEADER_PEM_H games in cms.h.jsing2024-03-291-3/+4
| | | | | | | | Rather than making prototypes appear and disappear depending on whether or not you've included pem.h before cms.h, just include pem.h from cms.h itself. ok joshua@ tb@
* Ignore EVP_MD_CTX_reset() return valuetb2024-02-021-6/+4
| | | | Also drop now unnecessary NULL checks before it.
* Ignore EVP_CIPHER_CTX_reset() return value, it can't failtb2024-02-021-2/+2
|
* Tidy a few more includes in cms/tb2024-01-144-8/+13
|
* Clean up includes in cms_smime.ctb2023-12-221-7/+14
|
* Clean up includes in cms_pwri.ctb2023-12-201-8/+10
|
* Tidy includestb2023-10-261-2/+2
|
* Use X509_ALGOR_set_evp_md() in CMS_add1_signer()tb2023-10-181-16/+24
| | | | | | | | | | Contrary to X509_ALGOR_set_md() this allows for error checking. Avoid local complications by freeing in the exit path and use a const version of X509_ALGOR for walking a STACK_OF() to avoid a bad free. Clean up includes ok jsing
* cms_DigestedData_create() use X509_ALGOR_set_evp_md()tb2023-10-181-6/+8
| | | | | | | | | Our internal version allows for error checking and this avoids a silent failure leading to corruption later on. Clean up includes while there. ok jsing
* Small cleanups in cms_sd_asn1_ctrl():tb2023-09-111-6/+6
| | | | Compare explicitly against NULL and use ret instead of i.
* Rewrite CMS_SignerInfo_{sign,verify}()tb2023-09-111-61/+55
| | | | | | | | | Convert to using one-shot signing and verification. This is simpler than doing Init/Update/Final and necessary for Ed25519 support (RFC 8419). Use a single exit idiom, don't reuse the same buffer for decoding and signing and simplify a few other things. ok jsing
* cms_content_bio() is not used outside of cms_lib.ctb2023-08-242-5/+3
| | | | | Make it a static function and remove its prototype from the internal header.
* Some tweaking of cms_content_bio()tb2023-08-241-10/+10
| | | | | | | More idiomatic error checking and drop an always false test for !*pos. Use a slightly closer approximation to actual English sentences in comments. ok jsing
* Better names for the BIOs in CMS_dataInit()tb2023-08-241-14/+14
| | | | | | Rename cmsbio into cms_bio and use {,in_}content_bio for {,i}cont. ok jsing
* Pull the NULL check for cmsbio into the switchtb2023-08-221-14/+10
| | | | ok jsing
* Plug a leak of cont in CMS_dataInit()tb2023-08-221-11/+12
| | | | | | This and ts/ts_rsp_sign.c r1.32 were part of OpenSSL 309e73df. ok jsing
* Provide CMS{,_SignerInfo}_get_versiontb2023-07-282-2/+48
| | | | | | | Add accessors for the syntax versions of ContentInfo and SignerInfo. These will be used soon in rpki-client for some more compliance checks. ok job jsing
* Hide symbols in cms, comp, conf, and bufferbeck2023-07-0812-12/+129
| | | | ok jsing@
* Remove symbols already declared in the public headertb2023-07-071-6/+1
| | | | ok bcook beck jsing
* Unifdef ZLIBtb2023-06-113-186/+2
| | | | | | | This has long been unused code and compilation with -DZLIB was broken for a long time after BIO was made opaque. ok jsing
* Fix typo in comment: exta -> extratb2023-06-061-2/+2
|
* cms_asn1.c: zap stray tabstb2023-05-231-8/+1
|
* KNF nittb2023-04-261-2/+3
|
* Move low level BIO_new_NDEF API to internal-onlytb2023-04-251-1/+2
|
* cms_io: sort includestb2023-04-211-3/+4
|
* cms_io: reverse polarity of an if statement to unindenttb2023-04-211-10/+12
|
* cms_io: Remove a stupid else branchtb2023-04-211-4/+2
| | | | | If you can initialize with functions, you can also initialize with constants...
* Rewrap some lines. No binary changetb2023-04-211-10/+10
|
* Unwrap a linetb2023-04-211-3/+2
|
* pk7_cb() and cms_cb()tb2023-03-121-4/+6
| | | | | | Add and fix FALLTHROUGH statement. I was confused for way too long since I hadn't noticed that this case fell through to the next. Also add and move some empty lines in the cms_cb() to make this resemble KNF more.
* Make header guards of internal headers consistenttb2022-11-261-4/+4
| | | | | Not all of them, only those that didn't leak into a public header... Yes.
* Make internal header file names consistenttb2022-11-2614-35/+35
| | | | | | | | | | | | | | | | Libcrypto currently has a mess of *_lcl.h, *_locl.h, and *_local.h names used for internal headers. Move all these headers we inherited from OpenSSL to *_local.h, reserving the name *_internal.h for our own code. Similarly, move dtls_locl.h and ssl_locl.h to dtls_local and ssl_local.h. constant_time_locl.h is moved to constant_time.h since it's special. Adjust all .c files in libcrypto, libssl and regress. The diff is mechanical with the exception of tls13_quic.c, where #include <ssl_locl.h> was fixed manually. discussed with jsing, no objection bcook
* Plug memory leak in CMS_add_simple_smimecap() in the unlikely event thattb2022-08-281-3/+6
| | | | | | ASN1_INTEGER_set() fails. ok jsing
* Remove mkerr.pl remnants from LibreSSLkn2022-07-121-2/+1
| | | | | | | This script is not used at all and files are edited by hand instead. Thus remove misleading comments incl. the obsolete script/config. Feedback OK jsing tb
* Add check for EVP_CIPHER_CTX_set_key_length return valueinoguchi2022-01-201-2/+2
| | | | | | It returns 1 on success and 0 for failure, never negative value. ok jsing@ millert@ tb@
* Check return value from EVP_CIPHER_CTX_new in cms_pwri.cinoguchi2022-01-191-2/+4
| | | | | | CID 345137 ok jsing@ tb@
* Garbage collect the app_items field of ASN1_ADBtb2022-01-141-2/+1
| | | | | | | This is unused and was removed in OpenSSL 5b70372d when it was replaced with an ASN.1 ADB callback (which we don't support). ok inoguchi jsing