Skip to content

Commit 7c9bdaf

Browse files
committed
crypt: export mz_crypt_pbkdf2 unconditionally
Let users use the function if they implement `mz_crypt_hmac_*` API without using CommonCrypto or OpenSSL.
1 parent 7b23871 commit 7c9bdaf

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

mz_crypt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ uint32_t mz_crypt_crc32_update(uint32_t value, const uint8_t *buf, int32_t size)
9191
#endif
9292
}
9393

94-
#if defined(HAVE_WZAES)
94+
#if defined(MZ_ZIP_NO_CRYPTO)
9595
int32_t mz_crypt_pbkdf2(const uint8_t *password, int32_t password_length, const uint8_t *salt, int32_t salt_length,
9696
uint32_t iteration_count, uint8_t *key, uint16_t key_length) {
9797
void *hmac1 = NULL;

test/test_crypt.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,6 @@ TEST(crypt, hmac_sha256) {
436436
# endif
437437
}
438438

439-
# ifdef HAVE_WZAES
440439
TEST(crypt, pbkdf2) {
441440
uint16_t iteration_count = 1000;
442441
uint8_t key[MZ_HASH_SHA1_SIZE];
@@ -570,5 +569,4 @@ TEST(crypt, pbkdf2_rfc6070_v5) {
570569

571570
EXPECT_STREQ(key_hex, "56fa6aa75548099dcc37d7f03425e0c3");
572571
}
573-
# endif
574572
#endif

0 commit comments

Comments
 (0)