Differences From Artifact [2311d3b292]:
- File CryptoPassphrase.m — part of check-in [a703cf8d62] at 2021-03-14 00:17:32 on branch trunk — Update copyright (user: js, size: 5735) [annotate] [blame] [check-ins using]
To Artifact [10bb34008e]:
- File
CryptoPassphrase.m
— part of check-in
[007bd9985e]
at
2021-03-21 11:03:01
on branch trunk
— Allow swappable memory
Most OSes and/or ulimits do not allow allocating such large amounts of
unswappable memory. (user: js, size: 5734) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
151 152 153 154 155 156 157 | if (keyFilePath != nil) keyFile = [OFMutableData dataWithContentsOfFile: keyFilePath]; passphraseCString = getpass(promptCString); passphraseLength = strlen(passphraseCString); @try { passphrase = [OFSecureData dataWithCount: passphraseLength + 1 | | | 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | if (keyFilePath != nil) keyFile = [OFMutableData dataWithContentsOfFile: keyFilePath]; passphraseCString = getpass(promptCString); passphraseLength = strlen(passphraseCString); @try { passphrase = [OFSecureData dataWithCount: passphraseLength + 1 allowsSwappableMemory: true]; memcpy(passphrase.mutableItems, passphraseCString, passphraseLength + 1); } @finally { of_explicit_memset(passphraseCString, '\0', passphraseLength); } if (_repeat) { |
︙ | ︙ |