aboutsummaryrefslogtreecommitdiffstats
path: root/util-src/crypto.c
Commit message (Collapse)AuthorAgeFilesLines
* util.crypto: Add more ECC methodsStephen Paul Weber2024-10-291-0/+116
| | | | | | | pkey_meth_derive: to derive a shared symmetric key from two ECC keys pkey_meth_public_raw: to get the raw form of the public key import_public_ec_raw: to import the raw form of the public key generate_p256_keypair: key generation for the P-256 curve
* util: Add compat for prosody module name change to C sourcesKim Alvefur2023-03-171-1/+5
|
* util.crypto: Preemptively silence 'strict-prototypes' warningKim Alvefur2023-01-311-1/+1
| | | | | | | | With `gcc-12 -Wstrict-prototypes` the following warning is shown: crypto.c:43:13: warning: function declaration isn't a prototype [-Wstrict-prototypes] 43 | static BIO* new_memory_BIO() { | ^~~~~~~~~~~~~~
* util.crypto: Add support for AES-256-CTRMatthew Wild2023-01-131-21/+44
| | | | This is required by PASETO v3.local
* util.crypto, util.jwt: Generate consistent signature sizes (via padding)Matthew Wild2022-09-291-10/+17
| | | | | | This fixes the signature parsing and building to work correctly. Sometimes a signature was one or two bytes too short, and needed to be padded. OpenSSL can do this for us.
* util.crypto: Use Lua 5.2 API for predictable buffer sizeKim Alvefur2022-07-111-6/+1
| | | | | | | | In Lua 5.3 LUAL_BUFFERSIZE is a macro computed from sizeof and is thus not known at pre-processing time, so this does not work. Since Lua 5.1 is no longer supported, we can use luaL_prepbuffsize() which is available from Lua 5.2
* util.crypto: Use stack space buffersKim Alvefur2022-07-111-14/+11
| | | | | | | | | Removes assumption that LUAL_BUFFERSIZE is known at pre-processing time, which it is not in Lua 5.3 and 5.4, where it is a computed macro based on sizeof. Allocation of stack space is safer and faster, no need to worry about luaL_prepbuffer failing to allocate memory and skipping free()
* util.crypto: More digests for sign/verify, use macros for clarity/consistencyMatthew Wild2022-07-021-32/+40
|
* util.crypto: Friendlier error message on incorrect key typesMatthew Wild2022-07-021-1/+6
|
* util.crypto: Add support for RSA signatures (PKCS1-v1.5 + PSS)Matthew Wild2022-07-021-3/+31
| | | | These are used by the RS*** and PS*** family of JOSE algorithms (e.g. in JWTs)
* util.crypto: New wrapper for some operations in OpenSSL's libcryptoMatthew Wild2022-06-241-0/+555
Specifically, ED25519 key generation/import/export, sign/verify operations, and AES encrypt/decrypt.