Update Makefile and some tests

This commit is contained in:
Zhi Guan
2022-03-03 09:30:30 +08:00
parent b885a07ea2
commit cea08178a2
18 changed files with 1502 additions and 224 deletions

View File

@@ -53,7 +53,7 @@
#include <gmssl/chacha20.h>
#include "endian.h"
void chacha20_set_key(CHACHA20_STATE *state,
void chacha20_init(CHACHA20_STATE *state,
const uint8_t key[CHACHA20_KEY_SIZE],
const uint8_t nonce[CHACHA20_NONCE_SIZE],
uint32_t counter)

1171
src/cms.c

File diff suppressed because it is too large Load Diff

View File

@@ -994,6 +994,16 @@ int x509_cert_verify_by_ca_cert(const uint8_t *a, size_t alen, const uint8_t *ca
return ret;
}
int x509_cert_to_der(const uint8_t *a, size_t alen, uint8_t **out, size_t *outlen)
{
return asn1_any_to_der(a, alen, out, outlen);
}
int x509_cert_from_der(const uint8_t **a, size_t *alen, const uint8_t **in, size_t *inlen)
{
return asn1_any_from_der(a, alen, in, inlen);
}
int x509_cert_to_pem(const uint8_t *a, size_t alen, FILE *fp)
{
if (pem_write(fp, "CERTIFICATE", a, alen) != 1) {