From d0dd0374630db83322297b823169afd08c116b70 Mon Sep 17 00:00:00 2001 From: antona Date: Sat, 6 Aug 2005 06:11:56 +0000 Subject: [PATCH] Set password to NULL instead of empty string "" so GNU TLS assumes it is not encrypted. --- ntfsprogs/ntfsdecrypt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ntfsprogs/ntfsdecrypt.c b/ntfsprogs/ntfsdecrypt.c index b08e6ff3..214a7cd8 100644 --- a/ntfsprogs/ntfsdecrypt.c +++ b/ntfsprogs/ntfsdecrypt.c @@ -1139,10 +1139,14 @@ int main(int argc, char *argv[]) ntfs_crypto_deinit(); return 1; } + /* If password is empty string set it to NULL. */ + if (!strlen(password)) + password = NULL; /* Obtain the user's private RSA key from the key file. */ rsa_key = ntfs_pkcs12_extract_rsa_key(pfx_buf, pfx_size, password); /* Destroy the password. */ - memset(password, 0, strlen(password)); + if (password) + memset(password, 0, strlen(password)); /* No longer need the pfx file contents. */ free(pfx_buf); if (!rsa_key) {