mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-11 19:00:02 +01:00
Used LUKS1 compiled-in defaults also in Python wrapper.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Python bindings to libcryptsetup
|
* Python bindings to libcryptsetup
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2014, Red Hat, Inc. All rights reserved.
|
* Copyright (C) 2009-2017, Red Hat, Inc. All rights reserved.
|
||||||
* Written by Martin Sivak
|
* Written by Martin Sivak
|
||||||
*
|
*
|
||||||
* This file is free software; you can redistribute it and/or
|
* This file is free software; you can redistribute it and/or
|
||||||
@@ -376,7 +376,7 @@ static PyObject *CryptSetup_luksFormat(CryptSetupObject* self, PyObject *args, P
|
|||||||
{
|
{
|
||||||
static const char *kwlist[] = {"cipher", "cipherMode", "keysize", "hashMode", NULL};
|
static const char *kwlist[] = {"cipher", "cipherMode", "keysize", "hashMode", NULL};
|
||||||
char *cipher_mode = NULL, *cipher = NULL, *hashMode = NULL;
|
char *cipher_mode = NULL, *cipher = NULL, *hashMode = NULL;
|
||||||
int keysize = 256;
|
int keysize = DEFAULT_LUKS1_KEYBITS;
|
||||||
PyObject *keysize_object = NULL;
|
PyObject *keysize_object = NULL;
|
||||||
struct crypt_params_luks1 params = {};
|
struct crypt_params_luks1 params = {};
|
||||||
|
|
||||||
@@ -400,9 +400,9 @@ static PyObject *CryptSetup_luksFormat(CryptSetupObject* self, PyObject *args, P
|
|||||||
} else
|
} else
|
||||||
keysize = PyInt_AsLong(keysize_object);
|
keysize = PyInt_AsLong(keysize_object);
|
||||||
|
|
||||||
// FIXME use #defined defaults
|
|
||||||
return PyObjectResult(crypt_format(self->device, CRYPT_LUKS1,
|
return PyObjectResult(crypt_format(self->device, CRYPT_LUKS1,
|
||||||
cipher ?: "aes", cipher_mode ?: "cbc-essiv:sha256",
|
cipher ?: DEFAULT_LUKS1_CIPHER,
|
||||||
|
cipher_mode ?: DEFAULT_LUKS1_MODE,
|
||||||
NULL, NULL, keysize / 8, ¶ms));
|
NULL, NULL, keysize / 8, ¶ms));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user