From 9868232ae1c0aaac34e0f96643031d68a5e417d3 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Sat, 27 Nov 1999 01:14:04 +0000 Subject: Initial trust code: allow setting of trust checking functions in a table. Doesn't do too much yet. Make the - options in 'x509' affect all relevant options. Change the name of the 'notrust' options to 'reject' as this causes less confusion and is a better description of the effect. A few constification changes. --- crypto/asn1/x_x509a.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'crypto/asn1/x_x509a.c') diff --git a/crypto/asn1/x_x509a.c b/crypto/asn1/x_x509a.c index d8409fbbff..1b95764251 100644 --- a/crypto/asn1/x_x509a.c +++ b/crypto/asn1/x_x509a.c @@ -80,12 +80,12 @@ X509_CERT_AUX *d2i_X509_CERT_AUX(X509_CERT_AUX **a, unsigned char **pp, long len M_ASN1_D2I_get_opt(ret->trust, d2i_ASN1_BIT_STRING, V_ASN1_BIT_STRING); - M_ASN1_D2I_get_IMP_opt(ret->notrust, d2i_ASN1_BIT_STRING,0, + M_ASN1_D2I_get_IMP_opt(ret->reject, d2i_ASN1_BIT_STRING,0, V_ASN1_BIT_STRING); M_ASN1_D2I_get_seq_opt_type(ASN1_OBJECT, ret->othertrust, d2i_ASN1_OBJECT, ASN1_OBJECT_free); - M_ASN1_D2I_get_IMP_set_opt_type(ASN1_OBJECT, ret->othernotrust, + M_ASN1_D2I_get_IMP_set_opt_type(ASN1_OBJECT, ret->otherreject, d2i_ASN1_OBJECT, ASN1_OBJECT_free, 1); M_ASN1_D2I_get_opt(ret->alias, d2i_ASN1_UTF8STRING, V_ASN1_UTF8STRING); M_ASN1_D2I_get_opt(ret->other, d2i_ASN1_TYPE, V_ASN1_SEQUENCE); @@ -99,9 +99,9 @@ X509_CERT_AUX *X509_CERT_AUX_new() ASN1_CTX c; M_ASN1_New_Malloc(ret, X509_CERT_AUX); ret->trust = NULL; - ret->notrust = NULL; + ret->reject = NULL; ret->othertrust = NULL; - ret->othernotrust = NULL; + ret->otherreject = NULL; ret->alias = NULL; ret->other = NULL; return(ret); @@ -112,9 +112,9 @@ void X509_CERT_AUX_free(X509_CERT_AUX *a) { if(a == NULL) return; ASN1_BIT_STRING_free(a->trust); - ASN1_BIT_STRING_free(a->notrust); + ASN1_BIT_STRING_free(a->reject); sk_ASN1_OBJECT_pop_free(a->othertrust, ASN1_OBJECT_free); - sk_ASN1_OBJECT_pop_free(a->othernotrust, ASN1_OBJECT_free); + sk_ASN1_OBJECT_pop_free(a->otherreject, ASN1_OBJECT_free); ASN1_UTF8STRING_free(a->alias); ASN1_TYPE_free(a->other); Free((char *)a); @@ -125,10 +125,10 @@ int i2d_X509_CERT_AUX(X509_CERT_AUX *a, unsigned char **pp) M_ASN1_I2D_vars(a); M_ASN1_I2D_len(a->trust, i2d_ASN1_BIT_STRING); - M_ASN1_I2D_len_IMP_opt(a->notrust, i2d_ASN1_BIT_STRING); + M_ASN1_I2D_len_IMP_opt(a->reject, i2d_ASN1_BIT_STRING); M_ASN1_I2D_len_SEQUENCE_opt_type(ASN1_OBJECT, a->othertrust, i2d_ASN1_OBJECT); - M_ASN1_I2D_len_IMP_SEQUENCE_opt_type(ASN1_OBJECT, a->othernotrust, i2d_ASN1_OBJECT, 1); + M_ASN1_I2D_len_IMP_SEQUENCE_opt_type(ASN1_OBJECT, a->otherreject, i2d_ASN1_OBJECT, 1); M_ASN1_I2D_len(a->alias, i2d_ASN1_UTF8STRING); M_ASN1_I2D_len(a->other, i2d_ASN1_TYPE); @@ -136,10 +136,10 @@ int i2d_X509_CERT_AUX(X509_CERT_AUX *a, unsigned char **pp) M_ASN1_I2D_seq_total(); M_ASN1_I2D_put(a->trust, i2d_ASN1_BIT_STRING); - M_ASN1_I2D_put_IMP_opt(a->notrust, i2d_ASN1_BIT_STRING, 0); + M_ASN1_I2D_put_IMP_opt(a->reject, i2d_ASN1_BIT_STRING, 0); M_ASN1_I2D_put_SEQUENCE_opt_type(ASN1_OBJECT, a->othertrust, i2d_ASN1_OBJECT); - M_ASN1_I2D_put_IMP_SEQUENCE_opt_type(ASN1_OBJECT, a->othernotrust, i2d_ASN1_OBJECT, 1); + M_ASN1_I2D_put_IMP_SEQUENCE_opt_type(ASN1_OBJECT, a->otherreject, i2d_ASN1_OBJECT, 1); M_ASN1_I2D_put(a->alias, i2d_ASN1_UTF8STRING); M_ASN1_I2D_put(a->other, i2d_ASN1_TYPE); @@ -184,19 +184,19 @@ int X509_trust_set_bit(X509 *x, int bit, int value) return ASN1_BIT_STRING_set_bit(aux->trust, bit, value); } -int X509_notrust_set_bit(X509 *x, int bit, int value) +int X509_reject_set_bit(X509 *x, int bit, int value) { X509_CERT_AUX *aux; if(bit == -1) { - if(x->aux && x->aux->notrust) { - ASN1_BIT_STRING_free(x->aux->notrust); - x->aux->notrust = NULL; + if(x->aux && x->aux->reject) { + ASN1_BIT_STRING_free(x->aux->reject); + x->aux->reject = NULL; } return 1; } if(!(aux = aux_get(x))) return 0; - if(!aux->notrust && !(aux->notrust = ASN1_BIT_STRING_new())) return 0; - return ASN1_BIT_STRING_set_bit(aux->notrust, bit, value); + if(!aux->reject && !(aux->reject = ASN1_BIT_STRING_new())) return 0; + return ASN1_BIT_STRING_set_bit(aux->reject, bit, value); } int X509_add_trust_object(X509 *x, ASN1_OBJECT *obj) @@ -208,12 +208,12 @@ int X509_add_trust_object(X509 *x, ASN1_OBJECT *obj) return sk_ASN1_OBJECT_push(aux->othertrust, obj); } -int X509_add_notrust_object(X509 *x, ASN1_OBJECT *obj) +int X509_add_reject_object(X509 *x, ASN1_OBJECT *obj) { X509_CERT_AUX *aux; if(!(aux = aux_get(x))) return 0; - if(!aux->othernotrust - && !(aux->othernotrust = sk_ASN1_OBJECT_new_null())) return 0; - return sk_ASN1_OBJECT_push(aux->othernotrust, obj); + if(!aux->otherreject + && !(aux->otherreject = sk_ASN1_OBJECT_new_null())) return 0; + return sk_ASN1_OBJECT_push(aux->otherreject, obj); } -- cgit v1.2.3