Removing cvcerts.h dependency.

A python script gets the public key of the device (EF_EE_DEV) and requests to our PKI for a CVC. Once got, it is updated to EF_TERMCA (0x2f02).
termca_pk is now on EF_KEY_DEV and termca is on EF_TERMCA (concat with DICA).

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2022-08-18 13:29:24 +02:00
parent 4e01a78286
commit fec02ca733
8 changed files with 45 additions and 39 deletions

View File

@@ -20,7 +20,6 @@
#include "cvc.h"
#include "kek.h"
#include "files.h"
#include "cvcerts.h"
uint8_t get_key_domain(file_t *fkey) {
size_t tag_len = 0;
@@ -110,7 +109,10 @@ int cmd_key_domain() {
else if (p1 == 0x2) { //XKEK Key Domain creation
if (apdu.nc > 0) {
size_t pub_len = 0;
const uint8_t *pub = cvc_get_pub(termca+2, (termca[1] << 8 | termca[0]), &pub_len);
file_t *fterm = search_by_fid(EF_TERMCA, NULL, SPECIFY_EF);
if (!fterm)
return SW_EXEC_ERROR();
const uint8_t *pub = cvc_get_pub(file_get_data(fterm), file_get_size(fterm), &pub_len);
if (!pub)
return SW_EXEC_ERROR();
size_t t86_len = 0;