"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/utils_crypt.c" between
cryptsetup-2.3.6.tar.xz and cryptsetup-2.4.0.tar.xz

About: cryptsetup is a utility used to conveniently setup disk encryption based on the dm-crypt kernel module. These include plain dm-crypt volumes, LUKS volumes, loop-AES and TrueCrypt compatible format.

utils_crypt.c  (cryptsetup-2.3.6.tar.xz):utils_crypt.c  (cryptsetup-2.4.0.tar.xz)
skipping to change at line 26 skipping to change at line 26
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <strings.h>
#include <unistd.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
#include "libcryptsetup.h" #include "libcryptsetup.h"
#include "utils_crypt.h" #include "utils_crypt.h"
int crypt_parse_name_and_mode(const char *s, char *cipher, int *key_nums, int crypt_parse_name_and_mode(const char *s, char *cipher, int *key_nums,
char *cipher_mode) char *cipher_mode)
{ {
if (!s || !cipher || !cipher_mode) if (!s || !cipher || !cipher_mode)
skipping to change at line 103 skipping to change at line 105
} }
int crypt_parse_integrity_mode(const char *s, char *integrity, int crypt_parse_integrity_mode(const char *s, char *integrity,
int *integrity_key_size) int *integrity_key_size)
{ {
int ks = 0, r = 0; int ks = 0, r = 0;
if (!s || !integrity) if (!s || !integrity)
return -EINVAL; return -EINVAL;
// FIXME: do not hardcode it here
/* AEAD modes */ /* AEAD modes */
if (!strcmp(s, "aead") || if (!strcmp(s, "aead") ||
!strcmp(s, "poly1305") || !strcmp(s, "poly1305") ||
!strcmp(s, "none")) { !strcmp(s, "none")) {
strncpy(integrity, s, MAX_CIPHER_LEN); strncpy(integrity, s, MAX_CIPHER_LEN);
ks = 0; ks = 0;
} else if (!strcmp(s, "hmac-sha1")) { } else if (!strcmp(s, "hmac-sha1")) {
strncpy(integrity, "hmac(sha1)", MAX_CIPHER_LEN); strncpy(integrity, "hmac(sha1)", MAX_CIPHER_LEN);
ks = 20; ks = 20;
} else if (!strcmp(s, "hmac-sha256")) { } else if (!strcmp(s, "hmac-sha256")) {
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)