-/* $OpenBSD: x_x509a.c,v 1.15 2018/05/01 19:01:27 tb Exp $ */
+/* $OpenBSD: x_x509a.c,v 1.16 2021/10/31 16:28:50 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
x->aux->reject = NULL;
}
}
-
-static const ASN1_TEMPLATE X509_CERT_PAIR_seq_tt[] = {
- {
- .flags = ASN1_TFLG_EXPLICIT | ASN1_TFLG_OPTIONAL,
- .tag = 0,
- .offset = offsetof(X509_CERT_PAIR, forward),
- .field_name = "forward",
- .item = &X509_it,
- },
- {
- .flags = ASN1_TFLG_EXPLICIT | ASN1_TFLG_OPTIONAL,
- .tag = 1,
- .offset = offsetof(X509_CERT_PAIR, reverse),
- .field_name = "reverse",
- .item = &X509_it,
- },
-};
-
-const ASN1_ITEM X509_CERT_PAIR_it = {
- .itype = ASN1_ITYPE_SEQUENCE,
- .utype = V_ASN1_SEQUENCE,
- .templates = X509_CERT_PAIR_seq_tt,
- .tcount = sizeof(X509_CERT_PAIR_seq_tt) / sizeof(ASN1_TEMPLATE),
- .funcs = NULL,
- .size = sizeof(X509_CERT_PAIR),
- .sname = "X509_CERT_PAIR",
-};
-
-
-X509_CERT_PAIR *
-d2i_X509_CERT_PAIR(X509_CERT_PAIR **a, const unsigned char **in, long len)
-{
- return (X509_CERT_PAIR *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
- &X509_CERT_PAIR_it);
-}
-
-int
-i2d_X509_CERT_PAIR(X509_CERT_PAIR *a, unsigned char **out)
-{
- return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_CERT_PAIR_it);
-}
-
-X509_CERT_PAIR *
-X509_CERT_PAIR_new(void)
-{
- return (X509_CERT_PAIR *)ASN1_item_new(&X509_CERT_PAIR_it);
-}
-
-void
-X509_CERT_PAIR_free(X509_CERT_PAIR *a)
-{
- ASN1_item_free((ASN1_VALUE *)a, &X509_CERT_PAIR_it);
-}
-/* $OpenBSD: pem.h,v 1.19 2018/08/24 19:51:31 tb Exp $ */
+/* $OpenBSD: pem.h,v 1.20 2021/10/31 16:28:50 tb Exp $ */
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#define PEM_STRING_X509_OLD "X509 CERTIFICATE"
#define PEM_STRING_X509 "CERTIFICATE"
-#define PEM_STRING_X509_PAIR "CERTIFICATE PAIR"
#define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE"
#define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST"
#define PEM_STRING_X509_REQ "CERTIFICATE REQUEST"
DECLARE_PEM_rw(X509_AUX, X509)
-DECLARE_PEM_rw(X509_CERT_PAIR, X509_CERT_PAIR)
-
DECLARE_PEM_rw(X509_REQ, X509_REQ)
DECLARE_PEM_write(X509_REQ_NEW, X509_REQ)
-/* $OpenBSD: pem_xaux.c,v 1.9 2016/09/04 16:10:38 jsing Exp $ */
+/* $OpenBSD: pem_xaux.c,v 1.10 2021/10/31 16:28:50 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2001.
*/
return PEM_ASN1_write_bio((i2d_of_void *)i2d_X509_AUX, PEM_STRING_X509_TRUSTED, bp,
x, NULL, NULL, 0, NULL, NULL);
}
-
-X509_CERT_PAIR *
-PEM_read_X509_CERT_PAIR(FILE *fp, X509_CERT_PAIR **x, pem_password_cb *cb, void *u)
-{
- return PEM_ASN1_read((d2i_of_void *)d2i_X509_CERT_PAIR, PEM_STRING_X509_PAIR, fp,
- (void **)x, cb, u);
-}
-
-int
-PEM_write_X509_CERT_PAIR(FILE *fp, X509_CERT_PAIR *x)
-{
- return PEM_ASN1_write((i2d_of_void *)i2d_X509_CERT_PAIR, PEM_STRING_X509_PAIR, fp,
- x, NULL, NULL, 0, NULL, NULL);
-}
-
-X509_CERT_PAIR *
-PEM_read_bio_X509_CERT_PAIR(BIO *bp, X509_CERT_PAIR **x, pem_password_cb *cb, void *u)
-{
- return PEM_ASN1_read_bio((d2i_of_void *)d2i_X509_CERT_PAIR, PEM_STRING_X509_PAIR, bp,
- (void **)x, cb, u);
-}
-
-int
-PEM_write_bio_X509_CERT_PAIR(BIO *bp, X509_CERT_PAIR *x)
-{
- return PEM_ASN1_write_bio((i2d_of_void *)i2d_X509_CERT_PAIR, PEM_STRING_X509_PAIR, bp,
- x, NULL, NULL, 0, NULL, NULL);
-}
-/* $OpenBSD: x509.h,v 1.82 2021/10/23 13:16:52 tb Exp $ */
+/* $OpenBSD: x509.h,v 1.83 2021/10/31 16:28:50 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
DECLARE_STACK_OF(X509_TRUST)
-typedef struct x509_cert_pair_st {
- X509 *forward;
- X509 *reverse;
-} X509_CERT_PAIR;
-
/* standard trust ids */
#define X509_TRUST_DEFAULT -1 /* Only valid in purpose settings */
int i2d_X509_CERT_AUX(X509_CERT_AUX *a, unsigned char **out);
extern const ASN1_ITEM X509_CERT_AUX_it;
-X509_CERT_PAIR *X509_CERT_PAIR_new(void);
-void X509_CERT_PAIR_free(X509_CERT_PAIR *a);
-X509_CERT_PAIR *d2i_X509_CERT_PAIR(X509_CERT_PAIR **a, const unsigned char **in, long len);
-int i2d_X509_CERT_PAIR(X509_CERT_PAIR *a, unsigned char **out);
-extern const ASN1_ITEM X509_CERT_PAIR_it;
-
int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
int X509_set_ex_data(X509 *r, int idx, void *arg);