Skip to content

Commit

Permalink
Add support for LUKS2 volumes
Browse files Browse the repository at this point in the history
  • Loading branch information
glv2 committed Nov 17, 2019
1 parent faea3bc commit 2f9325b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/bruteforce-luks.c
Expand Up @@ -34,6 +34,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "version.h"


#ifndef CRYPT_LUKS
/* Passing NULL to crypt_load will default to LUKS1 on older libcryptsetup versions. */
#define CRYPT_LUKS NULL
#endif

#define LAST_PASS_MAX_SHOWN_LENGTH 256

unsigned char *default_charset = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
Expand Down Expand Up @@ -282,7 +287,7 @@ void * decryption_func(void *arg)

/* Load the LUKS volume header */
crypt_init(&cd, path);
crypt_load(cd, CRYPT_LUKS1, NULL);
crypt_load(cd, CRYPT_LUKS, NULL);
crypt_set_log_callback(cd, &logger, &ret);

do
Expand Down Expand Up @@ -527,7 +532,7 @@ int check_path(char *path)
if(ret < 0)
return(0);

ret = crypt_load(cd, CRYPT_LUKS1, NULL);
ret = crypt_load(cd, CRYPT_LUKS, NULL);
if(ret < 0)
{
crypt_free(cd);
Expand Down

0 comments on commit 2f9325b

Please sign in to comment.