Skip to content

Commit

Permalink
Cast characters to bytes as appropriate to cleanly compile with -Wpoi…
Browse files Browse the repository at this point in the history
…nter-sign.
  • Loading branch information
UnitedMarsupials-zz committed Feb 10, 2017
1 parent ed878b3 commit a0cfac8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pam_duress.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ sha256hash(const char* plaintext, byte* output)
static void
pbkdf2hash(const char* pass, const char* salt, byte* output)
{
PKCS5_PBKDF2_HMAC(pass, strlen(pass), salt, strlen(salt), HASH_ROUNDS, EVP_sha256(), 32, output);
PKCS5_PBKDF2_HMAC(pass, strlen(pass), (const byte *)salt, strlen(salt),
HASH_ROUNDS, EVP_sha256(), 32, output);
}

static int
Expand All @@ -80,7 +81,7 @@ decrypt(const char *input, int ofd, const char *pass, const byte *salt)

cipher = EVP_aes_256_cbc();
dgst = EVP_sha256();
EVP_BytesToKey(cipher, dgst, salt, pass, strlen(pass), 1, key, iv);
EVP_BytesToKey(cipher, dgst, salt, (const byte *)pass, strlen(pass), 1, key, iv);

EVP_CIPHER_CTX_init(&ctx);

Expand Down

0 comments on commit a0cfac8

Please sign in to comment.