Module Name: src
Committed By: alnsn
Date: Sun Dec 11 00:56:34 UTC 2016
Modified Files:
src/usr.sbin/sysinst: menus.mi partman.c
Log Message:
Add aes-xts to sysinst(8).
To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/sysinst/menus.mi
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/sysinst/partman.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/sysinst/menus.mi
diff -u src/usr.sbin/sysinst/menus.mi:1.10 src/usr.sbin/sysinst/menus.mi:1.11
--- src/usr.sbin/sysinst/menus.mi:1.10 Mon May 11 13:07:57 2015
+++ src/usr.sbin/sysinst/menus.mi Sun Dec 11 00:56:34 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: menus.mi,v 1.10 2015/05/11 13:07:57 martin Exp $ */
+/* $NetBSD: menus.mi,v 1.11 2016/12/11 00:56:34 alnsn Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -731,6 +731,7 @@ menu raidlevel;
option MSG_raid5, exit, action { *(int *)arg = 5; };
menu cgd_enctype;
+ option "aes-xts", exit, action { *(const char**)arg = "aes-xts"; };
option "aes-cbc", exit, action { *(const char**)arg = "aes-cbc"; };
option "3des-cbc", exit, action { *(const char**)arg = "3des-cbc"; };
option "blowfish-cbc", exit, action { *(const char**)arg = "blowfish-cbc"; };
Index: src/usr.sbin/sysinst/partman.c
diff -u src/usr.sbin/sysinst/partman.c:1.13 src/usr.sbin/sysinst/partman.c:1.14
--- src/usr.sbin/sysinst/partman.c:1.13 Mon May 30 17:03:21 2016
+++ src/usr.sbin/sysinst/partman.c Sun Dec 11 00:56:34 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: partman.c,v 1.13 2016/05/30 17:03:21 dholland Exp $ */
+/* $NetBSD: partman.c,v 1.14 2016/12/11 00:56:34 alnsn Exp $ */
/*
* Copyright 2012 Eugene Lozovoy
@@ -1023,12 +1023,19 @@ pm_cgd_set_value(menudesc *m, void *arg)
case PMC_MENU_ENCTYPE:
process_menu(MENU_cgd_enctype, &retstring);
dev_ptr->enc_type = retstring;
+ if (! strcmp(retstring, "aes-xts"))
+ dev_ptr->key_size = 256;
+ if (! strcmp(retstring, "aes-cbc"))
+ dev_ptr->key_size = 192;
if (! strcmp(retstring, "blowfish-cbc"))
dev_ptr->key_size = 128;
if (! strcmp(retstring, "3des-cbc"))
dev_ptr->key_size = 192;
return 0;
case PMC_MENU_KEYSIZE:
+ if (! strcmp(dev_ptr->enc_type, "aes-xts"))
+ dev_ptr->key_size +=
+ (dev_ptr->key_size < 512)? 256 : -256;
if (! strcmp(dev_ptr->enc_type, "aes-cbc"))
dev_ptr->key_size +=
(dev_ptr->key_size < 256)? 64 : -128;
@@ -1071,9 +1078,9 @@ pm_cgd_init(void *arg1, void *arg2)
.pm_part = 0,
.keygen_type = "pkcs5_pbkdf2/sha1",
.verify_type = "disklabel",
- .enc_type = "aes-cbc",
+ .enc_type = "aes-xts",
.iv_type = "encblkno1",
- .key_size = 192,
+ .key_size = 256,
};
if (disk_entrie != NULL) {
pm_getdevstring(disk_entrie->fullname, SSTRSIZE,