diff options
author | Martin Willi <martin@revosec.ch> | 2010-12-22 15:10:03 +0100 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2011-01-05 16:46:05 +0100 |
commit | b3d359e58facb9744a1fc95507fb97e970b30891 (patch) | |
tree | b03335fce01ee158aa5f993094ec076086f18c81 /src/libstrongswan/plugins/openssl/openssl_x509.c | |
parent | b1703d6cb3fb1df9df7f840d422de84ab3a0c3c7 (diff) | |
download | strongswan-b3d359e58facb9744a1fc95507fb97e970b30891.tar.bz2 strongswan-b3d359e58facb9744a1fc95507fb97e970b30891.tar.xz |
Use a generic getter for all numerical X.509 constraints
Diffstat (limited to 'src/libstrongswan/plugins/openssl/openssl_x509.c')
-rw-r--r-- | src/libstrongswan/plugins/openssl/openssl_x509.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/libstrongswan/plugins/openssl/openssl_x509.c b/src/libstrongswan/plugins/openssl/openssl_x509.c index cf83b152d..dfbebe746 100644 --- a/src/libstrongswan/plugins/openssl/openssl_x509.c +++ b/src/libstrongswan/plugins/openssl/openssl_x509.c @@ -250,16 +250,16 @@ METHOD(x509_t, get_authKeyIdentifier, chunk_t, return chunk_empty; } -METHOD(x509_t, get_pathLenConstraint, int, - private_openssl_x509_t *this) -{ - return this->pathlen; -} - -METHOD(x509_t, get_policyConstraint, int, - private_openssl_x509_t *this, bool inhibit) +METHOD(x509_t, get_constraint, int, + private_openssl_x509_t *this, x509_constraint_t type) { - return X509_NO_CONSTRAINT; + switch (type) + { + case X509_PATH_LEN: + return this->pathlen; + default: + return X509_NO_CONSTRAINT; + } } METHOD(x509_t, create_subjectAltName_enumerator, enumerator_t*, @@ -526,8 +526,7 @@ static private_openssl_x509_t *create_empty() .get_serial = _get_serial, .get_subjectKeyIdentifier = _get_subjectKeyIdentifier, .get_authKeyIdentifier = _get_authKeyIdentifier, - .get_pathLenConstraint = _get_pathLenConstraint, - .get_policyConstraint = _get_policyConstraint, + .get_constraint = _get_constraint, .create_subjectAltName_enumerator = _create_subjectAltName_enumerator, .create_crl_uri_enumerator = _create_crl_uri_enumerator, .create_ocsp_uri_enumerator = _create_ocsp_uri_enumerator, |