commit 575c6b189648443c8d9180727b46b3fca7e2575d Author: John Denker Date: Sat Sep 13 00:38:36 2014 -0700 const get_subject_name diff --git a/crypto/x509/x509.h b/crypto/x509/x509.h index 092dd74..3d2d36c 100644 --- a/crypto/x509/x509.h +++ b/crypto/x509/x509.h @@ -911,7 +911,7 @@ int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial); ASN1_INTEGER * X509_get_serialNumber(X509 *x); int X509_set_issuer_name(X509 *x, X509_NAME *name); X509_NAME * X509_get_issuer_name(X509 *a); -int X509_set_subject_name(X509 *x, X509_NAME *name); +int X509_set_subject_name(X509 const *x, X509_NAME *name); X509_NAME * X509_get_subject_name(X509 *a); int X509_set_notBefore(X509 *x, const ASN1_TIME *tm); int X509_set_notAfter(X509 *x, const ASN1_TIME *tm); diff --git a/crypto/x509/x509_set.c b/crypto/x509/x509_set.c index 4b94fc5..ca990e9 100644 --- a/crypto/x509/x509_set.c +++ b/crypto/x509/x509_set.c @@ -98,7 +98,7 @@ int X509_set_issuer_name(X509 *x, X509_NAME *name) return(X509_NAME_set(&x->cert_info->issuer,name)); } -int X509_set_subject_name(X509 *x, X509_NAME *name) +int X509_set_subject_name(X509 const *x, X509_NAME *name) { if ((x == NULL) || (x->cert_info == NULL)) return(0); return(X509_NAME_set(&x->cert_info->subject,name)); diff --git a/crypto/x509v3/v3_ncons.c b/crypto/x509v3/v3_ncons.c index 6a06cfa..80ed1a0 100644 --- a/crypto/x509v3/v3_ncons.c +++ b/crypto/x509v3/v3_ncons.c @@ -234,11 +234,7 @@ static int print_nc_ipadd(BIO *bp, ASN1_OCTET_STRING *ip) * * If the result is non-null, caller is responsible for freeing it. */ - -// should be: STACK_OF(GENERAL_NAMES) * effective_names(X509 const *x) -// but X509_get_subject_name(x) spoils it, because it's not -// declared const. -STACK_OF(GENERAL_NAME) * effective_names(X509 *x) +STACK_OF(GENERAL_NAME) * effective_names(X509 const *x) { STACK_OF(GENERAL_NAME) *rslt = NULL; GENERAL_NAME* gntmp = NULL; diff --git a/crypto/x509v3/x509v3.h b/crypto/x509v3/x509v3.h index cfe8803..609f064 100644 --- a/crypto/x509v3/x509v3.h +++ b/crypto/x509v3/x509v3.h @@ -572,7 +572,7 @@ DECLARE_ASN1_FUNCTIONS(ISSUING_DIST_POINT) int DIST_POINT_set_dpname(DIST_POINT_NAME *dpn, X509_NAME *iname); -STACK_OF(GENERAL_NAME) * effective_names(X509 *x); +STACK_OF(GENERAL_NAME) * effective_names(X509 const *x); int NAME_CONSTRAINTS_check(X509 *x, NAME_CONSTRAINTS *nc); DECLARE_ASN1_FUNCTIONS(ACCESS_DESCRIPTION)