Added more signature infrestructure.

This commit is contained in:
Alessio Di Mauro
2015-08-04 19:19:04 +02:00
parent 7ce5ea4dc2
commit d312d7a1e1
8 changed files with 293 additions and 54 deletions
+40
View File
@@ -3,8 +3,11 @@
#include "pkcs11t.h"
#include "obj_types.h"
#include "openssl_types.h"
#include "vendors.h"
#define YKCS11_OP_BUFSIZE 4096
typedef struct {
vendor_id_t vid;
CK_TOKEN_INFO info;
@@ -25,4 +28,41 @@ typedef struct {
ykcs11_slot_t *slot;
} ykcs11_session_t;
typedef enum {
YKCS11_NOOP,
YKCS11_SIGN,
YKCS11_HASH,
YKCS11_DECRYPT
} ykcs11_op_type_t;
typedef struct {
ykcs11_md_ctx_t *md_ctx;
CK_BYTE algo;
CK_ULONG key;
CK_ULONG key_len;
} sign_info_t;
typedef struct {
CK_BYTE todo;
} hash_info_t;
typedef struct {
CK_BYTE todo;
} decrypt_info_t;
typedef union {
sign_info_t sign;
hash_info_t hash;
decrypt_info_t decrypt;
} op_t;
typedef struct {
ykcs11_op_type_t type;
CK_MECHANISM mechanism;
op_t op;
CK_BYTE buf[YKCS11_OP_BUFSIZE];
CK_ULONG buf_len;
} op_info_t;
#endif