* @v first Initial X.509 certificate to fill in, or NULL
* @ret rc Return status code
*/
-int x509_validate_chain ( int ( * parse_next ) ( struct x509_certificate *cert,
- void *context ),
+int x509_validate_chain ( int ( * parse_next )
+ ( struct x509_certificate *cert,
+ const struct x509_certificate *previous,
+ void *context ),
void *context, time_t time, struct x509_root *root,
struct x509_certificate *first ) {
struct x509_certificate temp[2];
root = &root_certificates;
/* Get first certificate in chain */
- if ( ( rc = parse_next ( current, context ) ) != 0 ) {
+ if ( ( rc = parse_next ( current, NULL, context ) ) != 0 ) {
DBGC ( context, "X509 chain %p could not get first "
"certificate: %s\n", context, strerror ( rc ) );
return rc;
return 0;
/* Get next certificate in chain */
- if ( ( rc = parse_next ( next, context ) ) != 0 ) {
+ if ( ( rc = parse_next ( next, current, context ) ) != 0 ) {
DBGC ( context, "X509 chain %p could not get next "
"certificate: %s\n", context, strerror ( rc ) );
return rc;
extern int x509_validate_time ( struct x509_certificate *cert, time_t time );
extern int x509_validate_chain ( int ( * parse_next )
( struct x509_certificate *cert,
+ const struct x509_certificate *previous,
void *context ),
void *context, time_t time,
struct x509_root *root,
* Parse next certificate in TLS certificate list
*
* @v cert X.509 certificate to fill in
+ * @v previous Previous X.509 certificate, or NULL
* @v ctx Context
* @ret rc Return status code
*/
-static int tls_parse_next ( struct x509_certificate *cert, void *ctx ) {
+static int tls_parse_next ( struct x509_certificate *cert,
+ const struct x509_certificate *previous __unused,
+ void *ctx ) {
struct tls_certificate_context *context = ctx;
struct tls_session *tls = context->tls;
const struct {
* Parse next certificate in chain
*
* @v cert X.509 certificate to parse
+ * @v previous Previous X.509 certificate, or NULL
* @v ctx Chain context
* @ret rc Return status code
*/
-static int x509_test_parse_next ( struct x509_certificate *cert, void *ctx ) {
+static int
+x509_test_parse_next ( struct x509_certificate *cert,
+ const struct x509_certificate *previous __unused,
+ void *ctx ) {
struct x509_test_chain_context *context = ctx;
struct x509_test_certificate *test_cert;