aboutsummaryrefslogtreecommitdiffstats
path: root/crypt.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-06-23 19:36:52 +0200
committerMattias Andrée <maandree@kth.se>2023-06-23 19:38:23 +0200
commit5d432bac33fe533c6f200b0acab1d33491bf6e0e (patch)
tree93d027fe7e46910a7e7c208b408d4dc3415ad314 /crypt.c
parentUse libar2simplified instead of crypt as crypt has a verily limited imput size, and add -h to key2root-addkey, and add key2root-crypt (diff)
downloadkey2root-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 'crypt.c')
-rw-r--r--crypt.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/crypt.c b/crypt.c
index ca3626d..2886cf3 100644
--- a/crypt.c
+++ b/crypt.c
@@ -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();