From 03211015645e8357395ad9f8ecf07db5b2fa8756 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Sat, 28 Dec 2019 23:46:05 +0100 Subject: [PATCH] Adjust to ObjFW changes --- LegacyPasswordGenerator.m | 5 +++-- NewPasswordGenerator.m | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/LegacyPasswordGenerator.m b/LegacyPasswordGenerator.m index b819162..cebe02e 100644 --- a/LegacyPasswordGenerator.m +++ b/LegacyPasswordGenerator.m @@ -55,7 +55,8 @@ - (void)derivePassword { - OFSHA256Hash *siteHash = [OFSHA256Hash cryptoHash]; + OFSHA256Hash *siteHash = [OFSHA256Hash + cryptoHashWithAllowsSwappableMemory: true]; size_t passphraseLength, combinedPassphraseLength; char *combinedPassphrase; @@ -89,7 +90,7 @@ of_scrypt(8, 524288, 2, siteHash.digest, [siteHash.class digestSize], combinedPassphrase, - combinedPassphraseLength, _output, _length); + combinedPassphraseLength, _output, _length, true); } @finally { of_explicit_memset(combinedPassphrase, 0, combinedPassphraseLength); diff --git a/NewPasswordGenerator.m b/NewPasswordGenerator.m index 9d776ed..7542d5e 100644 --- a/NewPasswordGenerator.m +++ b/NewPasswordGenerator.m @@ -42,7 +42,8 @@ - (void)derivePassword { - OFSHA384Hash *siteHash = [OFSHA384Hash cryptoHash]; + OFSHA384Hash *siteHash = [OFSHA384Hash + cryptoHashWithAllowsSwappableMemory: true]; size_t passphraseLength, combinedPassphraseLength; char *combinedPassphrase; @@ -76,7 +77,7 @@ of_scrypt(8, 524288, 2, siteHash.digest, [siteHash.class digestSize], combinedPassphrase, - combinedPassphraseLength, _output, _length); + combinedPassphraseLength, _output, _length, true); } @finally { of_explicit_memset(combinedPassphrase, 0, combinedPassphraseLength);