Implement "INTERNAL AUTHENTICATE" command.

This commit is contained in:
NIIBE Yutaka
2010-10-16 09:22:18 +09:00
parent 7ea6e2089a
commit 8a88c279bf
6 changed files with 166 additions and 36 deletions

View File

@@ -28,6 +28,8 @@
#include "polarssl/config.h"
#include "polarssl/rsa.h"
#define RSA_SIGNATURE_LENGTH 256 /* 256 byte == 2048-bit */
static rsa_context rsa_ctx;
int
@@ -76,6 +78,9 @@ rsa_sign (const uint8_t *raw_message, uint8_t *output, int msg_len)
}
else
{
res_APDU[RSA_SIGNATURE_LENGTH] = 0x90;
res_APDU[RSA_SIGNATURE_LENGTH+1] = 0x00;
res_APDU_size = RSA_SIGNATURE_LENGTH + 2;
DEBUG_INFO ("done.\r\n");
return 0;
}
@@ -165,7 +170,6 @@ rsa_decrypt (const uint8_t *input, uint8_t *output, int msg_len)
res_APDU[output_len] = 0x90;
res_APDU[output_len+1] = 0x00;
res_APDU_size = output_len + 2;
DEBUG_INFO ("done.\r\n");
return 0;
}