Update X509

This commit is contained in:
Zhi Guan
2023-01-09 18:33:17 +08:00
parent 4b100b38d1
commit cdd57c6385
2 changed files with 16 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 The GmSSL Project. All Rights Reserved.
* Copyright 2014-2023 The GmSSL Project. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
@@ -327,6 +327,10 @@ int x509_certs_get_cert_by_index(const uint8_t *d, size_t dlen, int index, const
int x509_certs_get_cert_by_subject(const uint8_t *d, size_t dlen, const uint8_t *subject, size_t subject_len, const uint8_t **cert, size_t *certlen);
int x509_certs_get_last(const uint8_t *d, size_t dlen, const uint8_t **cert, size_t *certlen);
int x509_certs_get_cert_by_subject_and_key_identifier(const uint8_t *d, size_t dlen,
const uint8_t *subject, size_t subject_len,
const uint8_t *key_id, size_t key_id_len,
const uint8_t **cert, size_t *certlen);
int x509_certs_get_cert_by_issuer_and_serial_number(
const uint8_t *certs, size_t certs_len,
const uint8_t *issuer, size_t issuer_len,

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 The GmSSL Project. All Rights Reserved.
* Copyright 2014-2023 The GmSSL Project. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
@@ -1442,6 +1442,16 @@ int x509_certs_get_cert_by_subject(const uint8_t *d, size_t dlen,
return 0;
}
int x509_certs_get_cert_by_subject_and_key_identifier(const uint8_t *d, size_t dlen,
const uint8_t *subject, size_t subject_len,
const uint8_t *key_id, size_t key_id_len, // AuthorityKeyIdentifier.keyIdentifier
const uint8_t **cert, size_t *certlen)
{
// TODO: implement this
error_print();
return -1;
}
int x509_certs_get_cert_by_issuer_and_serial_number(
const uint8_t *certs, size_t certs_len,
const uint8_t *issuer, size_t issuer_len,