X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=lib%2Futils_crypt.h;h=32b77cb8f7ad6c989c683589e2cab448f4e9266a;hb=322b430a2589cdc7985e98a14ec12322b91c9d5e;hp=48c819841bff0fa7e3e86e8ea8f668c3d5f18001;hpb=83f02e66827fa6fa66f9b73a009d2ba51d22352d;p=platform%2Fupstream%2Fcryptsetup.git diff --git a/lib/utils_crypt.h b/lib/utils_crypt.h index 48c8198..32b77cb 100644 --- a/lib/utils_crypt.h +++ b/lib/utils_crypt.h @@ -1,13 +1,14 @@ /* * utils_crypt - cipher utilities for cryptsetup * - * Copyright (C) 2004-2007, Clemens Fruhwirth - * Copyright (C) 2009-2012, Red Hat, Inc. All rights reserved. - * Copyright (C) 2009-2012, Milan Broz + * Copyright (C) 2004-2007 Clemens Fruhwirth + * Copyright (C) 2009-2020 Red Hat, Inc. All rights reserved. + * Copyright (C) 2009-2020 Milan Broz * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -23,29 +24,18 @@ #define _UTILS_CRYPT_H #include -#include "config.h" #define MAX_CIPHER_LEN 32 -#define MAX_CIPHER_LEN_STR "32" +#define MAX_CIPHER_LEN_STR "31" #define MAX_KEYFILES 32 -struct crypt_device; - int crypt_parse_name_and_mode(const char *s, char *cipher, int *key_nums, char *cipher_mode); - -int crypt_get_key(const char *prompt, - char **key, size_t *key_size, - size_t keyfile_offset, size_t keyfile_size_max, - const char *key_file, - int timeout, int verify, - struct crypt_device *cd); - -void *crypt_safe_alloc(size_t size); -void crypt_safe_free(void *data); -void *crypt_safe_realloc(void *data, size_t size); +int crypt_parse_hash_integrity_mode(const char *s, char *integrity); +int crypt_parse_integrity_mode(const char *s, char *integrity, + int *integrity_key_size); +int crypt_parse_pbkdf(const char *s, const char **pbkdf); ssize_t crypt_hex_to_bytes(const char *hex, char **result, int safe_alloc); -int crypt_string_to_size(struct crypt_device *cd, const char *s, uint64_t *size); #endif /* _UTILS_CRYPT_H */