Commit Graph

7 Commits (272784636112c84b57b3bd4742ab9f0235abe5b8)

Author SHA1 Message Date
Aydin Mercan 2727846361
crypto: start tinkering
Start working on "cute" signatures because why not? Cute signatures are
inspired/ripped of from the signify and minisign design:

Key (URL-Safe, padded base64):
- 2 bytes of version tag (specifies the algorithm)
- 16 bytes of key ID
- Public/Private key (size depending on the version tag)

Signature (raw):
- 2 bytes of version tag (specifies the algorithm)
- Signature depending (size depending on the version tag)

The new scheme uses libsodium and thus the work of
abstracting cryptographic operations from libcrypto should also be
completed. Also, since the key of the signature is provided in the
filename, there shouldn't be a need for ID

There is also the possibility of using epheremal keys for signatures and
sign the package's public key, signature and signing timestamp in the header
such as:

- 2 bytes of version tag
- signing timestamp
- epheremal public key used
- epheremal signature
- signature of the previous sections
2022-08-24 10:13:22 +03:00
Timo Teräs 6941aac4c6 db, audit: support sha256-160 hashes for v3 pkg compat 2021-11-03 15:37:10 +02:00
Timo Teräs 2433c9d23b openssl: explicitly ignore BIO_reset() return value
This caused some -Wall errors on certain gcc versions due
to BIO_reset() being a macro with explicit cast.
2021-06-21 13:03:16 +03:00
Timo Teräs d89c219173 reduce misuse of error codes from errno.h 2021-06-19 16:10:13 +03:00
Timo Teräs 17684141fe crypto: improve compatibility
EVP_MD_CTX_set_pkey_ctx() is fairly new openssl function, and not
existing in many alternative. Use EVP_MD_CTX_reset() which is slightly
more heavy but more portable. Add also signature buffer lengths to
work with RSA.
2021-06-19 14:43:22 +03:00
Timo Teräs 91cb2514e4 extract: new applet to extract v2 packages 2021-06-11 13:35:32 +03:00
Timo Teräs 7ce4cc4b73 add basic abstraction for cryptographic operations
- basic digesting and signing apis (subject still to fine tuning)
- update digest code, and adb signing for the thin wrapping layer
- old v1 package and database handling not updated
- default mkpkg file hash to sha256

ref #10744
2021-06-11 13:35:32 +03:00