Skip to content

Commit

Permalink
cmp_msg.c: test external library for attestation
Browse files Browse the repository at this point in the history
  • Loading branch information
rajeev-0 committed Feb 2, 2024
1 parent 561f96c commit 637ac78
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions crypto/cmp/cmp_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
#include <openssl/crmf.h>
#include <openssl/err.h>
#include <openssl/x509.h>
#if 1
#include <evidence.h>
#endif

OSSL_CMP_MSG *OSSL_CMP_MSG_new(OSSL_LIB_CTX *libctx, const char *propq)
{
Expand Down Expand Up @@ -282,17 +285,22 @@ static X509_EXTENSIONS *getattestationExt(void)
X509_EXTENSIONS *exts = NULL;
X509_EXTENSION *ext = NULL;
unsigned char *der_data = NULL, *evidence = NULL;
int der_len = 0, ret = 0;
int der_len = 0, ret = 0, len = EVIDENCE_LEN;
ASN1_OCTET_STRING oct;

#if 1
fprintf(stdout, "generate_evidence_string");
generate_evidence_string(&evidence, &len);
#else
/* TODO: get evidence from library */
evidence = OPENSSL_malloc(EVIDENCE_LEN);
if (evidence == NULL)
return NULL;
memset(evidence, 0xAA, EVIDENCE_LEN);
#endif

oct.data = evidence;
oct.length = EVIDENCE_LEN;
oct.length = len;
oct.flags = 0;

der_len = i2d_ASN1_OCTET_STRING(&oct, &der_data);
Expand Down

0 comments on commit 637ac78

Please sign in to comment.