From b4d224b5a1b034b0c20abfec376208c5b6e2cdf0 Mon Sep 17 00:00:00 2001 From: okir Date: Wed, 17 Apr 2002 08:56:58 +0000 Subject: [PATCH] - added SC_ALGORITHM_{MD5,SHA1,PBKDF2,PBES2} and corresponding AlgorithmIdentifier parameter structs - added params pointer to struct sc_algorithm_id git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@529 c6295689-39f2-0310-b995-f0e70906c6a9 --- src/libopensc/opensc.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/libopensc/opensc.h b/src/libopensc/opensc.h index 8c4f79b8..c497ed8c 100644 --- a/src/libopensc/opensc.h +++ b/src/libopensc/opensc.h @@ -147,6 +147,16 @@ extern "C" { #define SC_ALGORITHM_DES 64 #define SC_ALGORITHM_3DES 65 +/* Hash algorithms */ +#define SC_ALGORITHM_MD5 128 +#define SC_ALGORITHM_SHA1 129 + +/* Key derivation algorithms */ +#define SC_ALGORITHM_PBKDF2 192 + +/* Key encryption algoprithms */ +#define SC_ALGORITHM_PBES2 256 + #define SC_ALGORITHM_ONBOARD_KEY_GEN 0x80000000 #define SC_ALGORITHM_SPECIFIC_FLAGS 0x0000FFFF @@ -181,6 +191,20 @@ typedef struct sc_security_env sc_security_env_t; struct sc_algorithm_id { unsigned int algorithm; struct sc_object_id obj_id; + void *params; +}; + +struct sc_pbkdf2_params { + u8 salt[16]; + size_t salt_len; + int iterations; + int key_length; + struct sc_algorithm_id hash_alg; +}; + +struct sc_pbes2_params { + struct sc_algorithm_id derivation_alg; + struct sc_algorithm_id key_encr_alg; }; struct sc_algorithm_info {