diff --git a/python/pycryptsetup.c b/python/pycryptsetup.c index 426af25a..f8dbfe24 100644 --- a/python/pycryptsetup.c +++ b/python/pycryptsetup.c @@ -1,7 +1,7 @@ /* * 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 * * 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}; char *cipher_mode = NULL, *cipher = NULL, *hashMode = NULL; - int keysize = 256; + int keysize = DEFAULT_LUKS1_KEYBITS; PyObject *keysize_object = NULL; struct crypt_params_luks1 params = {}; @@ -400,9 +400,9 @@ static PyObject *CryptSetup_luksFormat(CryptSetupObject* self, PyObject *args, P } else keysize = PyInt_AsLong(keysize_object); - // FIXME use #defined defaults 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)); }