mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-13 11:50:10 +01:00
Allow using passphrase provided in options struct for LuksOpen (thanks to Waldemar Brodkorb).
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@85 36d66b0a-2a48-0410-832c-cd162a569da5
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
2009-08-17 Milan Broz <mbroz@redhat.com>
|
2009-08-17 Milan Broz <mbroz@redhat.com>
|
||||||
* Fix PBKDF2 speed calculation for large passhrases
|
* Fix PBKDF2 speed calculation for large passhrases.
|
||||||
|
* Allow using passphrase provided in options struct for LuksOpen.
|
||||||
|
|
||||||
2009-07-30 Milan Broz <mbroz@redhat.com>
|
2009-07-30 Milan Broz <mbroz@redhat.com>
|
||||||
* Fix errors when compiled with LUKS_DEBUG.
|
* Fix errors when compiled with LUKS_DEBUG.
|
||||||
|
|||||||
@@ -555,7 +555,12 @@ static int __crypt_luks_open(int arg, struct setup_backend *backend, struct cryp
|
|||||||
start:
|
start:
|
||||||
mk=NULL;
|
mk=NULL;
|
||||||
|
|
||||||
if(get_key(prompt, &password, &passwordLen, 0, options->key_file, options->passphrase_fd, options->timeout, options->flags))
|
if(options->passphrase) {
|
||||||
|
passwordLen = strlen(options->passphrase);
|
||||||
|
password = safe_alloc(passwordLen + 1);
|
||||||
|
strncpy(password, options->passphrase, passwordLen + 1);
|
||||||
|
tries = 0;
|
||||||
|
} else if(get_key(prompt, &password, &passwordLen, 0, options->key_file, options->passphrase_fd, options->timeout, options->flags))
|
||||||
tries--;
|
tries--;
|
||||||
else
|
else
|
||||||
tries = 0;
|
tries = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user