diff options
author | Mattias Andrée <maandree@kth.se> | 2023-06-23 19:36:52 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2023-06-23 19:38:23 +0200 |
commit | 5d432bac33fe533c6f200b0acab1d33491bf6e0e (patch) | |
tree | 93d027fe7e46910a7e7c208b408d4dc3415ad314 /crypt.c | |
parent | Use libar2simplified instead of crypt as crypt has a verily limited imput size, and add -h to key2root-addkey, and add key2root-crypt (diff) | |
download | key2root-5d432bac33fe533c6f200b0acab1d33491bf6e0e.tar.gz key2root-5d432bac33fe533c6f200b0acab1d33491bf6e0e.tar.bz2 key2root-5d432bac33fe533c6f200b0acab1d33491bf6e0e.tar.xz |
Add pepper
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | crypt.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -10,6 +10,15 @@ extern char *argv0; +static unsigned char pepper[] = { + /* DO NOT MODIFY !!! */ + 0x45, 0xf3, 0x4d, 0x3d, 0x14, 0xf9, 0x4b, 0x9a, + 0x56, 0xda, 0x12, 0xd5, 0x45, 0x35, 0x94, 0x74, + 0x93, 0x1d, 0x04, 0xb1, 0xea, 0x9e, 0x20, 0x49, + 0xce, 0x5d, 0xdc, 0x58, 0x82, 0x90, 0xed, 0xff +}; + + char * key2root_crypt(char *msg, size_t msglen, const char *paramstr, int autoerase) { @@ -20,6 +29,7 @@ key2root_crypt(char *msg, size_t msglen, const char *paramstr, int autoerase) libar2simplified_init_context(&ctx); ctx.autoerase_message = (unsigned char)autoerase; + ctx.autoerase_secret = 0; if (!paramstr) paramstr = libar2simplified_recommendation(0); @@ -34,6 +44,9 @@ key2root_crypt(char *msg, size_t msglen, const char *paramstr, int autoerase) goto out; } + params->key = pepper; + params->keylen = sizeof(pepper); + size = libar2_hash_buf_size(params); if (!size) abort(); |