commit 280abdc491b629e2d774c843d34aeae5eeac536b
parent 7335a72ec3f69d4079fe0f6987d8fc6c457557a3
Author: sin <sin@2f30.org>
Date: Thu, 17 Mar 2016 19:45:31 +0000
No intention to use salt so just get rid of it
Diffstat:
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/stun.c b/stun.c
@@ -37,14 +37,13 @@ int debug;
int sflag;
int
-aesinit(unsigned char *pw, int pwlen, unsigned char *salt,
- EVP_CIPHER_CTX *ectx, EVP_CIPHER_CTX *dctx)
+aesinit(unsigned char *pw, int pwlen, EVP_CIPHER_CTX *ectx, EVP_CIPHER_CTX *dctx)
{
unsigned char key[32], iv[32];
int ret, nrounds = 5;
ret = EVP_BytesToKey(EVP_aes_256_cbc(), EVP_sha1(),
- salt, pw, pwlen, nrounds, key, iv);
+ NULL, pw, pwlen, nrounds, key, iv);
if (ret != 32)
errx(1, "wrong key size: %d\n", ret);
EVP_CIPHER_CTX_init(ectx);
@@ -306,7 +305,7 @@ main(int argc, char *argv[])
pw = getenv("STUNPW");
if (!pw)
errx(1, "STUNPW is not set");
- if (aesinit((unsigned char *)pw, strlen(pw), NULL, &enc, &dec) < 0)
+ if (aesinit((unsigned char *)pw, strlen(pw), &enc, &dec) < 0)
errx(1, "couldn't initialize AES cipher");
explicit_bzero(pw, strlen(pw));