summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ecx_methods.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Implement X509_get_signature_info()tb2024-08-281-1/+21
| | | | | | | | | | | | | | | | This is a slightly strange combination of OBJ_find_sigid_algs() and the security level API necessary because OBJ_find_sigid_algs() on its own isn't smart enough for the special needs of RSA-PSS and EdDSA. The API extracts the hash's NID and the pubkey's NID from the certificate's signatureAlgorithm and invokes special handlers for RSA-PSS and EdDSA for retrieving the corresponding information. This isn't entirely free for RSA-PSS, but for now we don't cache this information. The security bits calculation is a bit hand-wavy, but that's something that comes along with this sort of numerology. ok jsing
* Simplify ecx_cms_sign_or_verify() using X509_ALGOR_set0_by_nid()tb2024-04-021-5/+3
| | | | ok jsing
* Implement Ed25519 signatures for CMS (RFC 8419)tb2024-03-291-1/+62
| | | | | | | | | | | | | | | | | | | | 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
* Replace .pkey_base_id with a .base_method pointertb2024-01-041-3/+3
| | | | | | | | | | | | | | | | Every EVP_PKEY_ASN1_METHOD is either an ASN.1 method or an alias. As such it resolves to an underlying ASN.1 method (in one step). This information can be stored in a base_method pointer in allusion to the pkey_base_id, which is the name for the nid (aka pkey_id aka type) of the underlying method. For an ASN.1 method, the base method is itself, so the base method is set as a pointer to itself. For an alias it is of course a pointer to the underlying method. Then obviously ameth->pkey_base_id is the same as ameth->base_method->pkey_id, so rework all ASN.1 methods to follow that. ok jsing
* Convert ecx_item_sign() to X509_ALGOR_set0_by_nid()tb2023-11-091-8/+5
| | | | ok jca
* Tweak previous. Should have been 60 instead of 64tb2023-07-221-3/+3
|
* Adapt bn_print() for EdDSA key printingtb2023-07-221-7/+40
| | | | | | | | This is essentially a reimplementation of ASN1_buf_print(). The latter was only added for these printing purposes and it will be removed again since nothing uses it. We can then simply remove t_pkey.c in the upcoming bump. ok jsing
* don't return in a void functionbcook2023-07-051-2/+2
| | | | ok tb@
* Fix return values of ecx methodstb2023-07-021-5/+5
| | | | | | | | | It is hard to get your return values right if you choose them to be a random subset of {-2, ..., 3}. The item_verify() and the digestverify() methods don't return 0 on error, but -1. Here 0 means "failed to verify", obviously. ok jsing
* Return the signature length after successful signing operationtb2023-03-151-1/+3
| | | | | | | | | This is required behavior of the EVP_DigestSign() API, but seemingly almost nothing uses this. Well, turns out ldns does. Reported by Stephane. Helpful comments by sthen. ok jsing
* Make internal header file names consistenttb2022-11-261-3/+3
| | | | | | | | | | | | | | | | 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
* Fix leaks in ecx_set_{priv,pub}_key()tb2022-11-231-9/+9
| | | | | | | | When ecx_key_set_{priv,pub}() fails, ecx_key is leaked. CID 377014 From jsing
* whitespacetb2022-11-191-2/+2
|
* Implement EVP interfaces for Ed25519 and X25519.jsing2022-11-101-0/+862
ok beck@ tb@