Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (23 sloc) 488 Bytes
#include <openssl/x509.h>
#include <openssl/bio.h>
#include <string.h>
int main(void)
{
unsigned char* buf = NULL;
const unsigned char *p;
unsigned char data[] = {
0x30, 0x80, 0x30, 0x00
};
buf = malloc(sizeof(data));
if ( buf == NULL ) {
return 0;
}
memcpy(buf, data, sizeof(data));
p = buf;
X509 *x509 = d2i_X509(NULL, &p, sizeof(data));
if ( x509 != NULL ) {
X509_free(x509);
}
free(buf);
return 0;
}
You can’t perform that action at this time.