summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2010-08-22 11:16:00 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-08-22 11:16:00 +0200
commitaccc6fa7aa2d52f338fa5123b28292e594b605e9 (patch)
tree25602b8489a8b1f5759b0c64dd457f8c015d3bfe
parent172a5b864f3ae6890b1cfc297cf9053b33fd8ee1 (diff)
downloadcryptodev-linux-accc6fa7aa2d52f338fa5123b28292e594b605e9.tar.gz
cryptodev-linux-accc6fa7aa2d52f338fa5123b28292e594b605e9.tar.xz
cryptodev-linux-accc6fa7aa2d52f338fa5123b28292e594b605e9.zip
When calculating algorithm strength consider 3DES as 112 bit cipher.
-rw-r--r--ncr-key.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ncr-key.c b/ncr-key.c
index 37e7854..8f74ade 100644
--- a/ncr-key.c
+++ b/ncr-key.c
@@ -557,7 +557,12 @@ int _ncr_key_get_sec_level(struct key_item_st* item)
{
int bits;
+ /* FIXME: should we move everything here into algorithm properties?
+ */
if (item->type == NCR_KEY_TYPE_SECRET) {
+ if (item->algorithm->algo == NCR_ALG_3DES_CBC)
+ return 112;
+
return item->key.secret.size*8;
} else if (item->type == NCR_KEY_TYPE_PRIVATE) {
switch(item->algorithm->algo) {