aboutsummaryrefslogtreecommitdiffstats
path: root/util-src/crypto.c
Commit message (Collapse)AuthorAgeFilesLines
* 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.