aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/plugins/x509/x509_cert.c
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2009-09-11 15:35:10 +0200
committerMartin Willi <martin@strongswan.org>2009-09-11 15:39:35 +0200
commit3b878dae7e7bb00f8d886426dc4f75bf45b8113f (patch)
treebe56294135f3b29788390b4695de1c973b454302 /src/libstrongswan/plugins/x509/x509_cert.c
parent3a7bd9bd49685c96313038436b770115651b7caa (diff)
downloadstrongswan-3b878dae7e7bb00f8d886426dc4f75bf45b8113f.tar.bz2
strongswan-3b878dae7e7bb00f8d886426dc4f75bf45b8113f.tar.xz
Removed chunk_from_buf() in favor of a simpler chunk_from_chars() macro
Diffstat (limited to 'src/libstrongswan/plugins/x509/x509_cert.c')
-rw-r--r--src/libstrongswan/plugins/x509/x509_cert.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/libstrongswan/plugins/x509/x509_cert.c b/src/libstrongswan/plugins/x509/x509_cert.c
index 0d9411fc0..a4bd628c8 100644
--- a/src/libstrongswan/plugins/x509/x509_cert.c
+++ b/src/libstrongswan/plugins/x509/x509_cert.c
@@ -171,10 +171,9 @@ struct private_x509_cert_t {
refcount_t ref;
};
-static u_char ASN1_sAN_oid_buf[] = {
+static const chunk_t ASN1_subjectAltName_oid = chunk_from_chars(
0x06, 0x03, 0x55, 0x1D, 0x11
-};
-static const chunk_t ASN1_subjectAltName_oid = chunk_from_buf(ASN1_sAN_oid_buf);
+);
/**
* ASN.1 definition of a basicConstraints extension
@@ -1341,16 +1340,16 @@ static bool generate(private_x509_cert_t *cert, certificate_t *sign_cert,
if (cert->flags & X509_CA)
{
- chunk_t yes, keyid;
+ chunk_t keyid;
- yes = chunk_alloca(1);
- yes.ptr[0] = 0xFF;
basicConstraints = asn1_wrap(ASN1_SEQUENCE, "mmm",
asn1_build_known_oid(OID_BASIC_CONSTRAINTS),
- asn1_wrap(ASN1_BOOLEAN, "c", yes),
+ asn1_wrap(ASN1_BOOLEAN, "c",
+ chunk_from_chars(0xFF)),
asn1_wrap(ASN1_OCTET_STRING, "m",
asn1_wrap(ASN1_SEQUENCE, "m",
- asn1_wrap(ASN1_BOOLEAN, "c", yes))));
+ asn1_wrap(ASN1_BOOLEAN, "c",
+ chunk_from_chars(0xFF)))));
/* add subjectKeyIdentifier to CA certificates */
if (cert->public_key->get_fingerprint(cert->public_key,
KEY_ID_PUBKEY_SHA1, &keyid))