Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Jun 2007 17:31:58 +0900 (JST)
From:      Yoshisato YANAGISAWA <yanagisawa@csg.is.titech.ac.jp>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        Pawel Jakub Dawidek <pjd@FreeBSD.org>
Subject:   kern/113790: [patch] enable the Camellia block cipher on GEOM ELI (geli).
Message-ID:  <200706170831.l5H8Vwt1017711@mana.csg.is.titech.ac.jp>
Resent-Message-ID: <200706170840.l5H8e3wW070503@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         113790
>Category:       kern
>Synopsis:       [patch] enable the Camellia block cipher on GEOM ELI (geli).
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jun 17 08:40:02 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Yoshisato YANAGISAWA
>Release:        7.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD gemma.pv.csg.is.titech.ac.jp 7.0-CURRENT FreeBSD 7.0-CURRENT #2: Sat Jun 16 13:59:33 JST 2007     yanagisawa@gemma.pv.csg.is.titech.ac.jp:/usr/obj/usr/src/sys/GENERIC  i386


	
>Description:

I made a small patch to enable the Camellia block cipher on GEOM ELI (geli).
FreeBSD project integrates support for the cipher recently.
http://www.emediawire.com/releases/2007/6/emw531216.htm
If you can, will you import this code into the base tree?

Thank you in advance.
Maintainer is cc'd.

diff -ruN src.bak/sbin/geom/class/eli/geli.8 src/sbin/geom/class/eli/geli.8
--- src.bak/sbin/geom/class/eli/geli.8	2007-03-05 21:39:49.000000000 +0900
+++ src/sbin/geom/class/eli/geli.8	2007-06-16 13:48:37.000000000 +0900
@@ -146,7 +146,8 @@
 .It
 Supports many cryptographic algorithms (currently
 .Nm AES ,
-.Nm Blowfish
+.Nm Blowfish ,
+.Nm Camellia
 and
 .Nm 3DES ) .
 .It
@@ -227,7 +228,8 @@
 Encryption algorithm to use.
 Currently supported algorithms are:
 .Nm AES ,
-.Nm Blowfish
+.Nm Blowfish ,
+.Nm Camellia
 and
 .Nm 3DES .
 The default is
@@ -260,7 +262,9 @@
 128 for
 .Nm AES ,
 128 for
-.Nm Blowfish
+.Nm Blowfish ,
+128 for
+.Nm Camellia
 and 192 for
 .Nm 3DES .
 .It Fl s Ar sectorsize
diff -ruN src.bak/sys/geom/eli/g_eli.h src/sys/geom/eli/g_eli.h
--- src.bak/sys/geom/eli/g_eli.h	2006-09-16 19:43:17.000000000 +0900
+++ src/sys/geom/eli/g_eli.h	2007-06-16 13:50:23.000000000 +0900
@@ -286,6 +286,8 @@
 		return (CRYPTO_AES_CBC);
 	else if (strcasecmp("blowfish", name) == 0)
 		return (CRYPTO_BLF_CBC);
+	else if (strcasecmp("camellia", name) == 0)
+		return (CRYPTO_CAMELLIA_CBC);
 	else if (strcasecmp("3des", name) == 0)
 		return (CRYPTO_3DES_CBC);
 	return (CRYPTO_ALGORITHM_MIN - 1);
@@ -321,6 +323,8 @@
 		return ("AES-CBC");
 	case CRYPTO_BLF_CBC:
 		return ("Blowfish-CBC");
+	case CRYPTO_CAMELLIA_CBC:
+		return ("CAMELLIA-CBC");
 	case CRYPTO_3DES_CBC:
 		return ("3DES-CBC");
 	case CRYPTO_MD5_HMAC:
@@ -390,7 +394,8 @@
 				keylen = 0;
 		}
 		return (keylen);
-	case CRYPTO_AES_CBC:
+	case CRYPTO_AES_CBC: /* FALLTHROUGH */
+	case CRYPTO_CAMELLIA_CBC:
 		switch (keylen) {
 		case 0:
 			return (128);
diff -ruN src.bak/sys/geom/eli/g_eli_crypto.c src/sys/geom/eli/g_eli_crypto.c
--- src.bak/sys/geom/eli/g_eli_crypto.c	2007-03-21 12:42:50.000000000 +0900
+++ src/sys/geom/eli/g_eli_crypto.c	2007-06-16 13:51:23.000000000 +0900
@@ -158,6 +158,21 @@
 	case CRYPTO_BLF_CBC:
 		type = EVP_bf_cbc();
 		break;
+	case CRYPTO_CAMELLIA_CBC:
+		switch (keysize) {
+		case 128:
+			type = EVP_camellia_128_cbc();
+			break;
+		case 192:
+			type = EVP_camellia_192_cbc();
+			break;
+		case 256:
+			type = EVP_camellia_256_cbc();
+			break;
+		default:
+			return (EINVAL);
+		}
+		break;
 	case CRYPTO_3DES_CBC:
 		type = EVP_des_ede3_cbc();
 		break;

	
>How-To-Repeat:
	
>Fix:

	


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706170831.l5H8Vwt1017711>