make constants for algorithms, keys and instructions

This commit is contained in:
Klas Lindfors
2014-06-17 09:58:37 +02:00
parent d62430c2d5
commit 8eb955bd13
2 changed files with 16 additions and 3 deletions
+3 -3
View File
@@ -307,9 +307,9 @@ ykpiv_rc ykpiv_authenticate(ykpiv_state *state, unsigned const char *key) {
recv_len = 0xff;
memset(apdu.raw, 0, sizeof(apdu));
apdu.st.ins = 0x87;
apdu.st.p1 = 0x03; /* triple des */
apdu.st.p2 = 0x9b; /* management key */
apdu.st.ins = YKPIV_INS_AUTHENTICATE;
apdu.st.p1 = YKPIV_ALGO_3DES; /* triple des */
apdu.st.p2 = YKPIV_KEY_CARDMGM; /* management key */
*dataptr++ = 0x7c;
*dataptr++ = 20; /* 2 + 8 + 2 +8 */
*dataptr++ = 0x80;
+13
View File
@@ -62,6 +62,19 @@ extern "C"
unsigned char *data, unsigned long *recv_len, int *sw);
ykpiv_rc ykpiv_authenticate(ykpiv_state *state, const unsigned char *key);
#define YKPIV_ALGO_3DES 0x03;
#define YKPIV_ALGO_RSA1024 0x06;
#define YKPIV_ALGO_RSA2048 0x07;
#define YKPIV_ALGO_ECCP256 0x11;
#define YKPIV_KEY_AUTHENTICATION 0x9a;
#define YKPIV_KEY_CARDMGM 0x9b;
#define YKPIV_KEY_SIGNATURE 0x9c;
#define YKPIV_KEY_KEYMGM 0x9d;
#define YKPIV_KEY_CARDAUTH 0x9e;
#define YKPIV_INS_AUTHENTICATE 0x87;
#ifdef __cplusplus
}
#endif