Add Windows and Visual Studio support

This commit is contained in:
Zhi Guan
2022-10-03 11:36:03 +08:00
parent 75155a4c37
commit 5e38788659
45 changed files with 1147 additions and 67 deletions

View File

@@ -1,4 +1,4 @@
/*
/*
* Copyright 2014-2022 The GmSSL Project. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the License); you may
@@ -28,11 +28,16 @@
int x509_exts_add_sequence(uint8_t *exts, size_t *extslen, size_t maxlen,
int oid, int critical, const uint8_t *d, size_t dlen)
{
uint8_t val[32 + dlen];
uint8_t *val = NULL;
uint8_t *p = val;
size_t curlen = *extslen;
size_t vlen = 0;
if (!(val = malloc(32 + dlen))) {
error_print();
return -1;
}
exts += *extslen;
if (asn1_sequence_to_der(d, dlen, &p, &vlen) != 1
|| x509_ext_to_der(oid, critical, val, vlen, NULL, &curlen) != 1