On 03.11.2014 17:36, philip_at_apache.org wrote:
> Author: philip
> Date: Mon Nov 3 16:36:25 2014
> New Revision: 1636386
>
> URL: http://svn.apache.org/r1636386
> Log:
> On svn-auth-x509 branch: move static array from header to the
> only file that uses it to avoid duplicate allocation.
>
> * subversion/libsvn_subr/x509.h
> (an1_oid asn1_oids): Move to ...
>
> * subversion/libsvn_subr/x509info.c
> (an1_oid asn1_oids): ... here.
>
> Modified:
> subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509.h
> subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509info.c
>
> Modified: subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509.h
> URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509.h?rev=1636386&r1=1636385&r2=1636386&view=diff
> ==============================================================================
> --- subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509.h (original)
> +++ subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509.h Mon Nov 3 16:36:25 2014
> @@ -72,17 +72,6 @@ typedef struct asn1_oid {
> const char *long_label;
> } asn1_oid;
>
> -static asn1_oid asn1_oids[] = {
> - { SVN_X509_OID_COMMON_NAME, "CN", "commonName" },
> - { SVN_X509_OID_COUNTRY, "C", "countryName" },
> - { SVN_X509_OID_LOCALITY, "L", "localityName" },
> - { SVN_X509_OID_STATE, "ST", "stateOrProvinceName" },
> - { SVN_X509_OID_ORGANIZATION, "O", "organizationName" },
> - { SVN_X509_OID_ORG_UNIT, "OU", "organizationalUnitName"},
> - { SVN_X509_OID_EMAIL, NULL, "emailAddress" },
> - { NULL },
> -};
> -
> #define OID_SUBJECT_ALT_NAME "\x55\x1D\x11"
>
> #ifdef __cplusplus
>
> Modified: subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509info.c
> URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509info.c?rev=1636386&r1=1636385&r2=1636386&view=diff
> ==============================================================================
> --- subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509info.c (original)
> +++ subversion/branches/svn-auth-x509/subversion/libsvn_subr/x509info.c Mon Nov 3 16:36:25 2014
> @@ -102,6 +102,17 @@ svn_x509_certinfo_dup(const svn_x509_cer
> return result;
> }
>
> +static asn1_oid asn1_oids[] = {
> + { SVN_X509_OID_COMMON_NAME, "CN", "commonName" },
> + { SVN_X509_OID_COUNTRY, "C", "countryName" },
> + { SVN_X509_OID_LOCALITY, "L", "localityName" },
> + { SVN_X509_OID_STATE, "ST", "stateOrProvinceName" },
> + { SVN_X509_OID_ORGANIZATION, "O", "organizationName" },
> + { SVN_X509_OID_ORG_UNIT, "OU", "organizationalUnitName"},
> + { SVN_X509_OID_EMAIL, NULL, "emailAddress" },
> + { NULL },
> +};
Good catch. The array should be const, too.
-- Brane
Received on 2014-11-03 17:42:38 CET