This is an example of how to call the SDK verifier APIs.
#include "src/verifysig.h"
#include <stdlib.h>
#include "util/buffutil.h"
#include "util/envutil.h"
bool IsCaCertAuthorizedByRootCa(void const* data, size_t size) {
(void)data;
(void)size;
return true;
}
EpidStatus AuthenticateAndAllocateRl(
void const* buf,
size_t len,
void** new_rl, size_t* rl_len);
size_t msg_len, void const* basename, size_t basename_len,
void const* signed_priv_rl, size_t signed_priv_rl_size,
void const* signed_sig_rl, size_t signed_sig_rl_size,
void const* signed_grp_rl, size_t signed_grp_rl_size,
void const* signed_pub_key, size_t signed_pub_key_size,
size_t priv_rl_size = 0;
size_t sig_rl_size = 0;
size_t grp_rl_size = 0;
do {
cacert, &pub_key);
break;
}
if (is_precomp_init && precomp) {
break;
}
} else {
break;
}
break;
}
}
break;
}
if (signed_priv_rl) {
result = AuthenticateAndAllocateRl(signed_priv_rl, signed_priv_rl_size,
(void**)&priv_rl, &priv_rl_size);
break;
}
break;
}
}
if (signed_sig_rl) {
result = AuthenticateAndAllocateRl(signed_sig_rl, signed_sig_rl_size,
(void**)&sig_rl, &sig_rl_size);
break;
}
break;
}
}
if (signed_grp_rl) {
result = AuthenticateAndAllocateRl(signed_grp_rl, signed_grp_rl_size,
(void**)&grp_rl, &grp_rl_size);
break;
}
break;
}
}
if (ver_rl) {
break;
}
}
result =
EpidVerify(ctx, sig, sig_len, msg, msg_len, basename, basename_len);
break;
}
} while (0);
if (priv_rl) free(priv_rl);
if (sig_rl) free(sig_rl);
if (grp_rl) free(grp_rl);
return result;
}
EpidStatus AuthenticateAndAllocateRl(
void const* buf,
size_t len,
void** new_rl, size_t* rl_len) {
typedef EpidStatus (*ParseFuncType)(
void const* buf,
size_t len,
unsigned char* rl, size_t* rl_len);
void* parsed_rl = NULL;
ParseFuncType ParseFunc = NULL;
if (!buf || !cert || !new_rl || !rl_len || !name) {
}
switch (file_type) {
break;
break;
break;
default:
}
do {
size_t parsed_len = 0;
result = ParseFunc(buf, len, cert, NULL, &parsed_len);
break;
}
break;
}
parsed_rl = AllocBuffer(parsed_len);
if (!parsed_rl) {
break;
}
result = ParseFunc(buf, len, cert, parsed_rl, &parsed_len);
break;
}
*rl_len = parsed_len;
*new_rl = parsed_rl;
} while (0);
if (parsed_rl) free(parsed_rl);
}
return result;
}