summaryrefslogtreecommitdiffstats
path: root/ncr-int.h
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2010-09-05 11:32:30 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-09-05 11:32:30 +0200
commita0e8e636aad06ad1d3d4f2460ee5a7cdf30c393b (patch)
treefb390ecba5daa4e3512ab6ac9f914fe29e4590ad /ncr-int.h
parent7f4d9adf958f00805e60a353d2779434aca36fe2 (diff)
downloadcryptodev-linux-a0e8e636aad06ad1d3d4f2460ee5a7cdf30c393b.tar.gz
cryptodev-linux-a0e8e636aad06ad1d3d4f2460ee5a7cdf30c393b.tar.xz
cryptodev-linux-a0e8e636aad06ad1d3d4f2460ee5a7cdf30c393b.zip
Rationalized the key wrapping format. It currently is:
PackedData ::= SEQUENCE { version INTEGER { v1(0) } algorithm OBJECT IDENTIFIER, type INTEGER { secret_key(0), public(1), private(2) }, data OCTET STRING } Unfortunately there are not assigned OIDs for all algorithms we support.
Diffstat (limited to 'ncr-int.h')
-rw-r--r--ncr-int.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/ncr-int.h b/ncr-int.h
index 87964b0..c413f84 100644
--- a/ncr-int.h
+++ b/ncr-int.h
@@ -25,19 +25,33 @@ enum ncr_algorithm {
NCR_ALG_NULL,
NCR_ALG_3DES_CBC,
-
- NCR_ALG_MD5,
+ NCR_ALG_3DES_ECB,
+
+ NCR_ALG_AES_ECB,
+ NCR_ALG_AES_CBC,
+ NCR_ALG_AES_CTR,
+
+ NCR_ALG_CAMELIA_ECB,
+ NCR_ALG_CAMELIA_CBC,
+ NCR_ALG_CAMELIA_CTR,
+
+ NCR_ALG_MD5=60,
NCR_ALG_SHA1,
NCR_ALG_SHA2_224,
NCR_ALG_SHA2_256,
NCR_ALG_SHA2_384,
NCR_ALG_SHA2_512,
- NCR_ALG_RSA,
+ NCR_ALG_RSA=120,
NCR_ALG_DSA,
NCR_ALG_DH,
};
+struct algo_oid_st {
+ oid_st oid;
+ int key_size;
+};
+
struct algo_properties_st {
enum ncr_algorithm algo;
const char *kstr;
@@ -56,6 +70,7 @@ struct algo_properties_st {
* NCR_KEY_TYPE_PUBLIC for a public key algorithm.
*/
ncr_key_type_t key_type;
+ const struct algo_oid_st *oids;
};
struct key_item_st {
@@ -192,6 +207,8 @@ int key_to_storage_data( uint8_t** data, size_t * data_size, const struct key_it
const struct algo_properties_st *_ncr_algo_to_properties(const char *algo);
const struct algo_properties_st *_ncr_nla_to_properties(const struct nlattr *nla);
int _ncr_key_get_sec_level(struct key_item_st* item);
+const struct algo_properties_st *_ncr_oid_to_properties(oid_st* oid);
+const oid_st* _ncr_properties_to_oid(const struct algo_properties_st * prop, int key_size);
/* CONFIG_COMPAT handling */