geom_eli.c (9a696dc6bb0e8e783dfd169c8299e1f33aac2935) geom_eli.c (5c420aae3b18027809507dc9142182d4290897bf)
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2004-2019 Pawel Jakub Dawidek <pawel@dawidek.net>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 791 unchanged lines hidden (view full) ---

800 if (md.md_ealgo == CRYPTO_AES_XTS &&
801 version < G_ELI_VERSION_05) {
802 gctl_error(req,
803 "AES-XTS algorithm is supported starting from version %u.",
804 G_ELI_VERSION_05);
805 return;
806 }
807 }
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2004-2019 Pawel Jakub Dawidek <pawel@dawidek.net>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 791 unchanged lines hidden (view full) ---

800 if (md.md_ealgo == CRYPTO_AES_XTS &&
801 version < G_ELI_VERSION_05) {
802 gctl_error(req,
803 "AES-XTS algorithm is supported starting from version %u.",
804 G_ELI_VERSION_05);
805 return;
806 }
807 }
808 if (md.md_flags & G_ELI_FLAG_AUTH) {
809 switch (md.md_aalgo) {
810 case CRYPTO_MD5_HMAC:
811 gctl_error(req,
812 "The %s authentication algorithm is deprecated.",
813 g_eli_algo2str(md.md_aalgo));
814 return;
815 }
816 }
817 switch (md.md_ealgo) {
818 case CRYPTO_3DES_CBC:
819 case CRYPTO_BLF_CBC:
820 gctl_error(req, "The %s encryption algorithm is deprecated.",
821 g_eli_algo2str(md.md_aalgo));
822 return;
823 }
808 val = gctl_get_intmax(req, "keylen");
809 md.md_keylen = val;
810 md.md_keylen = g_eli_keylen(md.md_ealgo, md.md_keylen);
811 if (md.md_keylen == 0) {
812 gctl_error(req, "Invalid key length.");
813 return;
814 }
815

--- 1160 unchanged lines hidden ---
824 val = gctl_get_intmax(req, "keylen");
825 md.md_keylen = val;
826 md.md_keylen = g_eli_keylen(md.md_ealgo, md.md_keylen);
827 if (md.md_keylen == 0) {
828 gctl_error(req, "Invalid key length.");
829 return;
830 }
831

--- 1160 unchanged lines hidden ---