summaryrefslogtreecommitdiffstats
path: root/base/tps/tools/raclient/RA_Conn.cpp
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2012-08-15 14:10:08 -0400
committerAde Lee <alee@redhat.com>2012-08-15 14:10:08 -0400
commit3b1ca60d799ca02305b8a2c61eb279f74787cff0 (patch)
treed1ec49f3d77cb77fc6043580b23c371508fea802 /base/tps/tools/raclient/RA_Conn.cpp
parent87b5eaa5b1409bc362867e3849fe16c8f205afa9 (diff)
parent75e1c66acb48e67951fc0ce5680328773fe837ae (diff)
downloadpki-3b1ca60d799ca02305b8a2c61eb279f74787cff0.tar.gz
pki-3b1ca60d799ca02305b8a2c61eb279f74787cff0.tar.xz
pki-3b1ca60d799ca02305b8a2c61eb279f74787cff0.zip
Merge branch 'my_tpsclient'
Diffstat (limited to 'base/tps/tools/raclient/RA_Conn.cpp')
-rw-r--r--base/tps/tools/raclient/RA_Conn.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/base/tps/tools/raclient/RA_Conn.cpp b/base/tps/tools/raclient/RA_Conn.cpp
index 17a3ed34f..8e7f30e51 100644
--- a/base/tps/tools/raclient/RA_Conn.cpp
+++ b/base/tps/tools/raclient/RA_Conn.cpp
@@ -30,6 +30,7 @@
#include "apdu/List_Objects_APDU.h"
#include "apdu/Create_Object_APDU.h"
#include "apdu/Generate_Key_APDU.h"
+#include "apdu/Generate_Key_ECC_APDU.h"
#include "apdu/External_Authenticate_APDU.h"
#include "apdu/Initialize_Update_APDU.h"
#include "apdu/Lifecycle_APDU.h"
@@ -583,7 +584,7 @@ RA_Conn::CreateAPDU (RA_Token * tok, Buffer & in_apdu_data, Buffer & mac)
}
}
- else if (((BYTE *) apdu_data)[1] == 0x0C)
+ else if ((((BYTE *) apdu_data)[1] == 0x0C) || (((BYTE *) apdu_data)[1] == 0x0D)) // for both RSA (0x0C) and ECC (0x0D)
{
/* Generate_Key_APDU */
BYTE p[2];
@@ -602,9 +603,16 @@ RA_Conn::CreateAPDU (RA_Token * tok, Buffer & in_apdu_data, Buffer & mac)
((BYTE *) apdu_data)[11 + wc_len + 1],
(unsigned int) ((BYTE *) apdu_data)[11 +
wc_len]);
- apdu =
- new Generate_Key_APDU (p[0], p[1], alg, keysize, option, type,
+ if (((BYTE *) apdu_data)[1] == 0x0D) {
+ apdu =
+ new Generate_Key_ECC_APDU (p[0], p[1], alg, keysize, option, type,
*wrapped_challenge, *key_check);
+ } else {
+ apdu =
+ new Generate_Key_APDU (p[0], p[1], alg, keysize, option, type,
+ *wrapped_challenge, *key_check);
+ }
+
if (wrapped_challenge != NULL)
{
delete wrapped_challenge;