Add support for Camellia encryption algorithm.
PR: kern/113790 Submitted by: Yoshisato YANAGISAWA <yanagisawa@csg.is.titech.ac.jp> Approved by: re (bmah)
This commit is contained in:
parent
6bc581fcf0
commit
864cba9669
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=172031
@ -146,7 +146,8 @@ will make use of it automatically.
|
|||||||
.It
|
.It
|
||||||
Supports many cryptographic algorithms (currently
|
Supports many cryptographic algorithms (currently
|
||||||
.Nm AES ,
|
.Nm AES ,
|
||||||
.Nm Blowfish
|
.Nm Blowfish ,
|
||||||
|
.Nm Camellia
|
||||||
and
|
and
|
||||||
.Nm 3DES ) .
|
.Nm 3DES ) .
|
||||||
.It
|
.It
|
||||||
@ -227,7 +228,8 @@ If the option is not given, there will be no authentication, only encryption.
|
|||||||
Encryption algorithm to use.
|
Encryption algorithm to use.
|
||||||
Currently supported algorithms are:
|
Currently supported algorithms are:
|
||||||
.Nm AES ,
|
.Nm AES ,
|
||||||
.Nm Blowfish
|
.Nm Blowfish ,
|
||||||
|
.Nm Camellia
|
||||||
and
|
and
|
||||||
.Nm 3DES .
|
.Nm 3DES .
|
||||||
The default is
|
The default is
|
||||||
@ -260,7 +262,9 @@ If not given, the default key length for the given algorithm is used, which is:
|
|||||||
128 for
|
128 for
|
||||||
.Nm AES ,
|
.Nm AES ,
|
||||||
128 for
|
128 for
|
||||||
.Nm Blowfish
|
.Nm Blowfish ,
|
||||||
|
128 for
|
||||||
|
.Nm Camellia
|
||||||
and 192 for
|
and 192 for
|
||||||
.Nm 3DES .
|
.Nm 3DES .
|
||||||
.It Fl s Ar sectorsize
|
.It Fl s Ar sectorsize
|
||||||
@ -652,5 +656,9 @@ The
|
|||||||
.Nm
|
.Nm
|
||||||
utility appeared in
|
utility appeared in
|
||||||
.Fx 6.0 .
|
.Fx 6.0 .
|
||||||
|
Support for
|
||||||
|
.Nm Camellia
|
||||||
|
block cipher is implemented by Yoshisato Yanagisawa in
|
||||||
|
.Fx 7.0 .
|
||||||
.Sh AUTHORS
|
.Sh AUTHORS
|
||||||
.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
|
.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
|
||||||
|
@ -286,6 +286,8 @@ g_eli_str2ealgo(const char *name)
|
|||||||
return (CRYPTO_AES_CBC);
|
return (CRYPTO_AES_CBC);
|
||||||
else if (strcasecmp("blowfish", name) == 0)
|
else if (strcasecmp("blowfish", name) == 0)
|
||||||
return (CRYPTO_BLF_CBC);
|
return (CRYPTO_BLF_CBC);
|
||||||
|
else if (strcasecmp("camellia", name) == 0)
|
||||||
|
return (CRYPTO_CAMELLIA_CBC);
|
||||||
else if (strcasecmp("3des", name) == 0)
|
else if (strcasecmp("3des", name) == 0)
|
||||||
return (CRYPTO_3DES_CBC);
|
return (CRYPTO_3DES_CBC);
|
||||||
return (CRYPTO_ALGORITHM_MIN - 1);
|
return (CRYPTO_ALGORITHM_MIN - 1);
|
||||||
@ -321,6 +323,8 @@ g_eli_algo2str(u_int algo)
|
|||||||
return ("AES-CBC");
|
return ("AES-CBC");
|
||||||
case CRYPTO_BLF_CBC:
|
case CRYPTO_BLF_CBC:
|
||||||
return ("Blowfish-CBC");
|
return ("Blowfish-CBC");
|
||||||
|
case CRYPTO_CAMELLIA_CBC:
|
||||||
|
return ("CAMELLIA-CBC");
|
||||||
case CRYPTO_3DES_CBC:
|
case CRYPTO_3DES_CBC:
|
||||||
return ("3DES-CBC");
|
return ("3DES-CBC");
|
||||||
case CRYPTO_MD5_HMAC:
|
case CRYPTO_MD5_HMAC:
|
||||||
@ -390,7 +394,8 @@ g_eli_keylen(u_int algo, u_int keylen)
|
|||||||
keylen = 0;
|
keylen = 0;
|
||||||
}
|
}
|
||||||
return (keylen);
|
return (keylen);
|
||||||
case CRYPTO_AES_CBC:
|
case CRYPTO_AES_CBC: /* FALLTHROUGH */
|
||||||
|
case CRYPTO_CAMELLIA_CBC:
|
||||||
switch (keylen) {
|
switch (keylen) {
|
||||||
case 0:
|
case 0:
|
||||||
return (128);
|
return (128);
|
||||||
|
@ -158,6 +158,21 @@ g_eli_crypto_cipher(u_int algo, int enc, u_char *data, size_t datasize,
|
|||||||
case CRYPTO_BLF_CBC:
|
case CRYPTO_BLF_CBC:
|
||||||
type = EVP_bf_cbc();
|
type = EVP_bf_cbc();
|
||||||
break;
|
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:
|
case CRYPTO_3DES_CBC:
|
||||||
type = EVP_des_ede3_cbc();
|
type = EVP_des_ede3_cbc();
|
||||||
break;
|
break;
|
||||||
|
@ -6,14 +6,15 @@ no=45
|
|||||||
sectors=100
|
sectors=100
|
||||||
keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1
|
keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1
|
||||||
|
|
||||||
echo "1..540"
|
echo "1..660"
|
||||||
|
|
||||||
i=1
|
i=1
|
||||||
for cipher in aes:0 aes:128 aes:192 aes:256 \
|
for cipher in aes:0 aes:128 aes:192 aes:256 \
|
||||||
3des:0 3des:192 \
|
3des:0 3des:192 \
|
||||||
blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \
|
blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \
|
||||||
blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \
|
blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \
|
||||||
blowfish:416 blowfish:448; do
|
blowfish:416 blowfish:448 \
|
||||||
|
camellia:0 camellia:128 camellia:192 camellia:256; do
|
||||||
ealgo=${cipher%%:*}
|
ealgo=${cipher%%:*}
|
||||||
keylen=${cipher##*:}
|
keylen=${cipher##*:}
|
||||||
for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do
|
for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do
|
||||||
|
@ -6,14 +6,15 @@ no=45
|
|||||||
sectors=100
|
sectors=100
|
||||||
keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1
|
keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1
|
||||||
|
|
||||||
echo "1..180"
|
echo "1..220"
|
||||||
|
|
||||||
i=1
|
i=1
|
||||||
for cipher in aes:0 aes:128 aes:192 aes:256 \
|
for cipher in aes:0 aes:128 aes:192 aes:256 \
|
||||||
3des:0 3des:192 \
|
3des:0 3des:192 \
|
||||||
blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \
|
blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \
|
||||||
blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \
|
blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \
|
||||||
blowfish:416 blowfish:448; do
|
blowfish:416 blowfish:448 \
|
||||||
|
camellia:0 camellia:128 camellia:192 camellia:256; do
|
||||||
ealgo=${cipher%%:*}
|
ealgo=${cipher%%:*}
|
||||||
keylen=${cipher##*:}
|
keylen=${cipher##*:}
|
||||||
for secsize in 512 1024 2048 4096 8192; do
|
for secsize in 512 1024 2048 4096 8192; do
|
||||||
|
@ -7,14 +7,15 @@ sectors=100
|
|||||||
keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1
|
keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1
|
||||||
sector=`mktemp /tmp/$base.XXXXXX` || exit 1
|
sector=`mktemp /tmp/$base.XXXXXX` || exit 1
|
||||||
|
|
||||||
echo "1..2160"
|
echo "1..2640"
|
||||||
|
|
||||||
i=1
|
i=1
|
||||||
for cipher in aes:0 aes:128 aes:192 aes:256 \
|
for cipher in aes:0 aes:128 aes:192 aes:256 \
|
||||||
3des:0 3des:192 \
|
3des:0 3des:192 \
|
||||||
blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \
|
blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \
|
||||||
blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \
|
blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \
|
||||||
blowfish:416 blowfish:448; do
|
blowfish:416 blowfish:448 \
|
||||||
|
camellia:0 camellia:128 camellia:192 camellia:256; do
|
||||||
ealgo=${cipher%%:*}
|
ealgo=${cipher%%:*}
|
||||||
keylen=${cipher##*:}
|
keylen=${cipher##*:}
|
||||||
for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do
|
for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do
|
||||||
|
@ -7,14 +7,15 @@ sectors=100
|
|||||||
keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1
|
keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1
|
||||||
sector=`mktemp /tmp/$base.XXXXXX` || exit 1
|
sector=`mktemp /tmp/$base.XXXXXX` || exit 1
|
||||||
|
|
||||||
echo "1..1080"
|
echo "1..1320"
|
||||||
|
|
||||||
i=1
|
i=1
|
||||||
for cipher in aes:0 aes:128 aes:192 aes:256 \
|
for cipher in aes:0 aes:128 aes:192 aes:256 \
|
||||||
3des:0 3des:192 \
|
3des:0 3des:192 \
|
||||||
blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \
|
blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \
|
||||||
blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \
|
blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \
|
||||||
blowfish:416 blowfish:448; do
|
blowfish:416 blowfish:448 \
|
||||||
|
camellia:0 camellia:128 camellia:192 camellia:256; do
|
||||||
ealgo=${cipher%%:*}
|
ealgo=${cipher%%:*}
|
||||||
keylen=${cipher##*:}
|
keylen=${cipher##*:}
|
||||||
for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do
|
for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do
|
||||||
|
@ -7,14 +7,15 @@ sectors=100
|
|||||||
keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1
|
keyfile=`mktemp /tmp/$base.XXXXXX` || exit 1
|
||||||
sector=`mktemp /tmp/$base.XXXXXX` || exit 1
|
sector=`mktemp /tmp/$base.XXXXXX` || exit 1
|
||||||
|
|
||||||
echo "1..1080"
|
echo "1..1320"
|
||||||
|
|
||||||
i=1
|
i=1
|
||||||
for cipher in aes:0 aes:128 aes:192 aes:256 \
|
for cipher in aes:0 aes:128 aes:192 aes:256 \
|
||||||
3des:0 3des:192 \
|
3des:0 3des:192 \
|
||||||
blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \
|
blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \
|
||||||
blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \
|
blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \
|
||||||
blowfish:416 blowfish:448; do
|
blowfish:416 blowfish:448 \
|
||||||
|
camellia:0 camellia:128 camellia:192 camellia:256; do
|
||||||
ealgo=${cipher%%:*}
|
ealgo=${cipher%%:*}
|
||||||
keylen=${cipher##*:}
|
keylen=${cipher##*:}
|
||||||
for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do
|
for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do
|
||||||
|
@ -5,14 +5,15 @@ base=`basename $0`
|
|||||||
no=45
|
no=45
|
||||||
sectors=100
|
sectors=100
|
||||||
|
|
||||||
echo "1..540"
|
echo "1..660"
|
||||||
|
|
||||||
i=1
|
i=1
|
||||||
for cipher in aes:0 aes:128 aes:192 aes:256 \
|
for cipher in aes:0 aes:128 aes:192 aes:256 \
|
||||||
3des:0 3des:192 \
|
3des:0 3des:192 \
|
||||||
blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \
|
blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \
|
||||||
blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \
|
blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \
|
||||||
blowfish:416 blowfish:448; do
|
blowfish:416 blowfish:448 \
|
||||||
|
camellia:0 camellia:128 camellia:192 camellia:256; do
|
||||||
ealgo=${cipher%%:*}
|
ealgo=${cipher%%:*}
|
||||||
keylen=${cipher##*:}
|
keylen=${cipher##*:}
|
||||||
for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do
|
for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 hmac/sha384 hmac/sha512; do
|
||||||
|
@ -5,14 +5,15 @@ base=`basename $0`
|
|||||||
no=45
|
no=45
|
||||||
sectors=100
|
sectors=100
|
||||||
|
|
||||||
echo "1..180"
|
echo "1..220"
|
||||||
|
|
||||||
i=1
|
i=1
|
||||||
for cipher in aes:0 aes:128 aes:192 aes:256 \
|
for cipher in aes:0 aes:128 aes:192 aes:256 \
|
||||||
3des:0 3des:192 \
|
3des:0 3des:192 \
|
||||||
blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \
|
blowfish:0 blowfish:128 blowfish:160 blowfish:192 blowfish:224 \
|
||||||
blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \
|
blowfish:256 blowfish:288 blowfish:320 blowfish:352 blowfish:384 \
|
||||||
blowfish:416 blowfish:448; do
|
blowfish:416 blowfish:448 \
|
||||||
|
camellia:0 camellia:128 camellia:192 camellia:256; do
|
||||||
ealgo=${cipher%%:*}
|
ealgo=${cipher%%:*}
|
||||||
keylen=${cipher##*:}
|
keylen=${cipher##*:}
|
||||||
for secsize in 512 1024 2048 4096 8192; do
|
for secsize in 512 1024 2048 4096 8192; do
|
||||||
|
Loading…
Reference in New Issue
Block a user