summaryrefslogtreecommitdiff
path: root/src/libstrongswan
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan')
-rw-r--r--src/libstrongswan/Android.mk5
-rw-r--r--src/libstrongswan/Makefile.am2
-rw-r--r--src/libstrongswan/Makefile.in17
-rw-r--r--src/libstrongswan/asn1/asn1.c65
-rw-r--r--src/libstrongswan/asn1/oid.c549
-rw-r--r--src/libstrongswan/asn1/oid.h292
-rw-r--r--src/libstrongswan/asn1/oid.txt13
-rw-r--r--src/libstrongswan/chunk.h2
-rw-r--r--src/libstrongswan/credentials/cred_encoding.c7
-rw-r--r--src/libstrongswan/credentials/ietf_attributes/ietf_attributes.c6
-rw-r--r--src/libstrongswan/crypto/crypto_tester.c6
-rw-r--r--src/libstrongswan/crypto/crypto_tester.h2
-rw-r--r--src/libstrongswan/crypto/proposal/proposal_keywords.c141
-rw-r--r--src/libstrongswan/crypto/proposal/proposal_keywords.txt2
-rw-r--r--src/libstrongswan/crypto/transform.c5
-rw-r--r--src/libstrongswan/crypto/transform.h13
-rw-r--r--src/libstrongswan/eap/eap.c21
-rw-r--r--src/libstrongswan/eap/eap.h15
-rw-r--r--src/libstrongswan/fetcher/fetcher.c33
-rw-r--r--src/libstrongswan/fetcher/fetcher.h51
-rw-r--r--src/libstrongswan/fetcher/fetcher_manager.c73
-rw-r--r--src/libstrongswan/fetcher/fetcher_manager.h9
-rw-r--r--src/libstrongswan/plugins/aes/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/aes/aes_crypter.c1
-rw-r--r--src/libstrongswan/plugins/aes/aes_plugin.c12
-rw-r--r--src/libstrongswan/plugins/af_alg/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/af_alg/af_alg_crypter.c5
-rw-r--r--src/libstrongswan/plugins/af_alg/af_alg_crypter.h4
-rw-r--r--src/libstrongswan/plugins/af_alg/af_alg_hasher.c4
-rw-r--r--src/libstrongswan/plugins/af_alg/af_alg_hasher.h4
-rw-r--r--src/libstrongswan/plugins/af_alg/af_alg_ops.c2
-rw-r--r--src/libstrongswan/plugins/af_alg/af_alg_ops.h2
-rw-r--r--src/libstrongswan/plugins/af_alg/af_alg_plugin.c16
-rw-r--r--src/libstrongswan/plugins/af_alg/af_alg_prf.c4
-rw-r--r--src/libstrongswan/plugins/af_alg/af_alg_prf.h4
-rw-r--r--src/libstrongswan/plugins/af_alg/af_alg_signer.c4
-rw-r--r--src/libstrongswan/plugins/af_alg/af_alg_signer.h4
-rw-r--r--src/libstrongswan/plugins/agent/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/agent/agent_plugin.c8
-rw-r--r--src/libstrongswan/plugins/blowfish/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/blowfish/blowfish_crypter.c1
-rw-r--r--src/libstrongswan/plugins/blowfish/blowfish_plugin.c12
-rw-r--r--src/libstrongswan/plugins/ccm/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/ccm/ccm_plugin.c28
-rw-r--r--src/libstrongswan/plugins/constraints/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/constraints/constraints_plugin.c8
-rw-r--r--src/libstrongswan/plugins/ctr/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/ctr/ctr_plugin.c14
-rw-r--r--src/libstrongswan/plugins/curl/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/curl/curl_fetcher.c46
-rw-r--r--src/libstrongswan/plugins/curl/curl_plugin.c8
-rw-r--r--src/libstrongswan/plugins/des/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/des/des_crypter.c1
-rw-r--r--src/libstrongswan/plugins/des/des_plugin.c16
-rw-r--r--src/libstrongswan/plugins/dnskey/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/dnskey/dnskey_plugin.c8
-rw-r--r--src/libstrongswan/plugins/fips_prf/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/fips_prf/fips_prf_plugin.c12
-rw-r--r--src/libstrongswan/plugins/gcm/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/gcm/gcm_plugin.c22
-rw-r--r--src/libstrongswan/plugins/gcrypt/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c76
-rw-r--r--src/libstrongswan/plugins/gmp/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/gmp/gmp_plugin.c34
-rw-r--r--src/libstrongswan/plugins/hmac/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/hmac/hmac.c4
-rw-r--r--src/libstrongswan/plugins/hmac/hmac_plugin.c40
-rw-r--r--src/libstrongswan/plugins/ldap/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/ldap/ldap_fetcher.c3
-rw-r--r--src/libstrongswan/plugins/ldap/ldap_plugin.c8
-rw-r--r--src/libstrongswan/plugins/md4/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/md4/md4_plugin.c12
-rw-r--r--src/libstrongswan/plugins/md5/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/md5/md5_plugin.c12
-rw-r--r--src/libstrongswan/plugins/mysql/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/mysql/mysql_plugin.c8
-rw-r--r--src/libstrongswan/plugins/openssl/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/openssl/openssl_crypter.c2
-rw-r--r--src/libstrongswan/plugins/openssl/openssl_ec_diffie_hellman.c2
-rw-r--r--src/libstrongswan/plugins/openssl/openssl_plugin.c82
-rw-r--r--src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c2
-rw-r--r--src/libstrongswan/plugins/padlock/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/padlock/padlock_aes_crypter.c4
-rw-r--r--src/libstrongswan/plugins/padlock/padlock_plugin.c20
-rw-r--r--src/libstrongswan/plugins/pem/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/pem/pem_plugin.c8
-rw-r--r--src/libstrongswan/plugins/pgp/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/pgp/pgp_plugin.c8
-rw-r--r--src/libstrongswan/plugins/pkcs1/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/pkcs1/pkcs1_builder.c2
-rw-r--r--src/libstrongswan/plugins/pkcs1/pkcs1_plugin.c8
-rw-r--r--src/libstrongswan/plugins/pkcs11/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/pkcs11/pkcs11_manager.c2
-rw-r--r--src/libstrongswan/plugins/pkcs11/pkcs11_plugin.c22
-rw-r--r--src/libstrongswan/plugins/plugin.h16
-rw-r--r--src/libstrongswan/plugins/plugin_loader.c111
-rw-r--r--src/libstrongswan/plugins/plugin_loader.h12
-rw-r--r--src/libstrongswan/plugins/pubkey/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/pubkey/pubkey_plugin.c8
-rw-r--r--src/libstrongswan/plugins/random/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/random/random_plugin.c14
-rw-r--r--src/libstrongswan/plugins/revocation/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/revocation/revocation_plugin.c8
-rw-r--r--src/libstrongswan/plugins/sha1/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/sha1/sha1_plugin.c14
-rw-r--r--src/libstrongswan/plugins/sha2/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/sha2/sha2_plugin.c18
-rw-r--r--src/libstrongswan/plugins/soup/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/soup/soup_fetcher.c55
-rw-r--r--src/libstrongswan/plugins/soup/soup_plugin.c8
-rw-r--r--src/libstrongswan/plugins/sqlite/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/sqlite/sqlite_plugin.c8
-rw-r--r--src/libstrongswan/plugins/test_vectors/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/test_vectors/test_vectors/des.c2
-rw-r--r--src/libstrongswan/plugins/test_vectors/test_vectors_plugin.c8
-rw-r--r--src/libstrongswan/plugins/x509/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/x509/x509_cert.c8
-rw-r--r--src/libstrongswan/plugins/x509/x509_ocsp_response.c2
-rw-r--r--src/libstrongswan/plugins/x509/x509_plugin.c8
-rw-r--r--src/libstrongswan/plugins/xcbc/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/xcbc/xcbc.c4
-rw-r--r--src/libstrongswan/plugins/xcbc/xcbc_plugin.c18
-rw-r--r--src/libstrongswan/processing/jobs/callback_job.c59
-rw-r--r--src/libstrongswan/processing/jobs/callback_job.h17
-rw-r--r--src/libstrongswan/processing/processor.c80
-rw-r--r--src/libstrongswan/processing/scheduler.c57
-rw-r--r--src/libstrongswan/settings.c113
-rw-r--r--src/libstrongswan/settings.h16
-rw-r--r--src/libstrongswan/threading/thread.c19
-rw-r--r--src/libstrongswan/utils.c10
-rw-r--r--src/libstrongswan/utils.h45
-rw-r--r--src/libstrongswan/utils/backtrace.c2
-rw-r--r--src/libstrongswan/utils/host.c1
-rw-r--r--src/libstrongswan/utils/identification.c54
-rw-r--r--src/libstrongswan/utils/leak_detective.c2
-rw-r--r--src/libstrongswan/utils/linked_list.c1
136 files changed, 1796 insertions, 1045 deletions
diff --git a/src/libstrongswan/Android.mk b/src/libstrongswan/Android.mk
index 431543151..259f0a375 100644
--- a/src/libstrongswan/Android.mk
+++ b/src/libstrongswan/Android.mk
@@ -32,8 +32,7 @@ credentials/keys/private_key.c credentials/keys/private_key.h \
credentials/keys/public_key.c credentials/keys/public_key.h \
credentials/keys/shared_key.c credentials/keys/shared_key.h \
credentials/certificates/certificate.c credentials/certificates/certificate.h \
-credentials/certificates/x509.h credentials/certificates/x509.c \
-credentials/certificates/ac.h \
+credentials/certificates/x509.h credentials/certificates/ac.h \
credentials/certificates/crl.h credentials/certificates/crl.c \
credentials/certificates/pkcs10.h \
credentials/certificates/ocsp_request.h \
@@ -49,7 +48,7 @@ credentials/sets/callback_cred.c credentials/sets/callback_cred.h \
credentials/auth_cfg.c credentials/auth_cfg.h credentials/credential_set.h \
credentials/cert_validator.h \
database/database.h database/database_factory.h database/database_factory.c \
-fetcher/fetcher.h fetcher/fetcher_manager.h fetcher/fetcher_manager.c \
+fetcher/fetcher.h fetcher/fetcher.c fetcher/fetcher_manager.h fetcher/fetcher_manager.c \
eap/eap.h eap/eap.c \
plugins/plugin_loader.c plugins/plugin_loader.h plugins/plugin.h \
processing/jobs/job.h \
diff --git a/src/libstrongswan/Makefile.am b/src/libstrongswan/Makefile.am
index 6a29d8eea..b6c70daea 100644
--- a/src/libstrongswan/Makefile.am
+++ b/src/libstrongswan/Makefile.am
@@ -46,7 +46,7 @@ credentials/sets/callback_cred.c credentials/sets/callback_cred.h \
credentials/auth_cfg.c credentials/auth_cfg.h credentials/credential_set.h \
credentials/cert_validator.h \
database/database.h database/database_factory.h database/database_factory.c \
-fetcher/fetcher.h fetcher/fetcher_manager.h fetcher/fetcher_manager.c \
+fetcher/fetcher.h fetcher/fetcher.c fetcher/fetcher_manager.h fetcher/fetcher_manager.c \
eap/eap.h eap/eap.c \
plugins/plugin_loader.c plugins/plugin_loader.h plugins/plugin.h \
processing/jobs/job.h \
diff --git a/src/libstrongswan/Makefile.in b/src/libstrongswan/Makefile.in
index 76b4f70c6..c9ae8992e 100644
--- a/src/libstrongswan/Makefile.in
+++ b/src/libstrongswan/Makefile.in
@@ -216,7 +216,7 @@ am__libstrongswan_la_SOURCES_DIST = library.c library.h chunk.c \
credentials/auth_cfg.h credentials/credential_set.h \
credentials/cert_validator.h database/database.h \
database/database_factory.h database/database_factory.c \
- fetcher/fetcher.h fetcher/fetcher_manager.h \
+ fetcher/fetcher.h fetcher/fetcher.c fetcher/fetcher_manager.h \
fetcher/fetcher_manager.c eap/eap.h eap/eap.c \
plugins/plugin_loader.c plugins/plugin_loader.h \
plugins/plugin.h processing/jobs/job.h \
@@ -247,7 +247,7 @@ am_libstrongswan_la_OBJECTS = library.lo chunk.lo debug.lo enum.lo \
crl.lo ocsp_response.lo ietf_attributes.lo \
credential_manager.lo auth_cfg_wrapper.lo \
ocsp_response_wrapper.lo cert_cache.lo mem_cred.lo \
- callback_cred.lo auth_cfg.lo database_factory.lo \
+ callback_cred.lo auth_cfg.lo database_factory.lo fetcher.lo \
fetcher_manager.lo eap.lo plugin_loader.lo callback_job.lo \
processor.lo scheduler.lo traffic_selector.lo thread.lo \
thread_value.lo mutex.lo rwlock.lo utils.lo host.lo \
@@ -460,6 +460,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -483,6 +485,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
@@ -537,7 +540,7 @@ libstrongswan_la_SOURCES = library.c library.h chunk.c chunk.h debug.c \
credentials/auth_cfg.h credentials/credential_set.h \
credentials/cert_validator.h database/database.h \
database/database_factory.h database/database_factory.c \
- fetcher/fetcher.h fetcher/fetcher_manager.h \
+ fetcher/fetcher.h fetcher/fetcher.c fetcher/fetcher_manager.h \
fetcher/fetcher_manager.c eap/eap.h eap/eap.c \
plugins/plugin_loader.c plugins/plugin_loader.h \
plugins/plugin.h processing/jobs/job.h \
@@ -724,6 +727,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eap.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enum.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enumerator.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fetcher.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fetcher_manager.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hasher.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashtable.Plo@am__quote@
@@ -1021,6 +1025,13 @@ database_factory.lo: database/database_factory.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o database_factory.lo `test -f 'database/database_factory.c' || echo '$(srcdir)/'`database/database_factory.c
+fetcher.lo: fetcher/fetcher.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fetcher.lo -MD -MP -MF $(DEPDIR)/fetcher.Tpo -c -o fetcher.lo `test -f 'fetcher/fetcher.c' || echo '$(srcdir)/'`fetcher/fetcher.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/fetcher.Tpo $(DEPDIR)/fetcher.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fetcher/fetcher.c' object='fetcher.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o fetcher.lo `test -f 'fetcher/fetcher.c' || echo '$(srcdir)/'`fetcher/fetcher.c
+
fetcher_manager.lo: fetcher/fetcher_manager.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT fetcher_manager.lo -MD -MP -MF $(DEPDIR)/fetcher_manager.Tpo -c -o fetcher_manager.lo `test -f 'fetcher/fetcher_manager.c' || echo '$(srcdir)/'`fetcher/fetcher_manager.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/fetcher_manager.Tpo $(DEPDIR)/fetcher_manager.Plo
diff --git a/src/libstrongswan/asn1/asn1.c b/src/libstrongswan/asn1/asn1.c
index f80c2b93b..4466b37a4 100644
--- a/src/libstrongswan/asn1/asn1.c
+++ b/src/libstrongswan/asn1/asn1.c
@@ -129,10 +129,10 @@ chunk_t asn1_build_known_oid(int n)
chunk_t asn1_oid_from_string(char *str)
{
enumerator_t *enumerator;
- u_char buf[32];
+ u_char buf[64];
char *end;
- int i = 0, pos = 0;
- u_int val, first = 0;
+ int i = 0, pos = 0, shift;
+ u_int val, shifted_val, first = 0;
enumerator = enumerator_create_token(str, ".", "");
while (enumerator->enumerate(enumerator, &str))
@@ -152,16 +152,17 @@ chunk_t asn1_oid_from_string(char *str)
buf[pos++] = first * 40 + val;
break;
default:
- if (val < 128)
+ shift = 28; /* sufficient to handle 32 bit node numbers */
+ while (shift)
{
- buf[pos++] = val;
+ shifted_val = val >> shift;
+ shift -= 7;
+ if (shifted_val) /* do not encode leading zeroes */
+ {
+ buf[pos++] = 0x80 | (shifted_val & 0x7F);
+ }
}
- else
- {
- buf[pos++] = 128 | (val >> 7);
- buf[pos++] = (val % 256) & 0x7F;
- }
- break;
+ buf[pos++] = val & 0x7F;
}
}
enumerator->destroy(enumerator);
@@ -183,38 +184,32 @@ char *asn1_oid_to_string(chunk_t oid)
return NULL;
}
val = oid.ptr[0] / 40;
- len = snprintf(buf, sizeof(buf), "%d.%d", val, oid.ptr[0] - val * 40);
+ len = snprintf(buf, sizeof(buf), "%u.%u", val, oid.ptr[0] - val * 40);
oid = chunk_skip(oid, 1);
if (len < 0 || len >= sizeof(buf))
{
return NULL;
}
pos += len;
+ val = 0;
while (oid.len)
{
+ val = (val << 7) + (u_int)(oid.ptr[0] & 0x7f);
+
if (oid.ptr[0] < 128)
{
- len = snprintf(pos, sizeof(buf) + buf - pos, ".%d", oid.ptr[0]);
- oid = chunk_skip(oid, 1);
- }
- else
- {
- if (oid.len == 1)
+ len = snprintf(pos, sizeof(buf) + buf - pos, ".%u", val);
+ if (len < 0 || len >= sizeof(buf) + buf - pos)
{
return NULL;
}
- val = ((u_int)(oid.ptr[0] & 0x7F) << 7) + oid.ptr[1];
- len = snprintf(pos, sizeof(buf) + buf - pos, ".%d", val);
- oid = chunk_skip(oid, 2);
- }
- if (len < 0 || len >= sizeof(buf) + buf - pos)
- {
- return NULL;
+ pos += len;
+ val = 0;
}
- pos += len;
+ oid = chunk_skip(oid, 1);
}
- return strdup(buf);
+ return (val == 0) ? strdup(buf) : NULL;
}
/*
@@ -468,12 +463,22 @@ void asn1_debug_simple_object(chunk_t object, asn1_t type, bool private)
{
case ASN1_OID:
oid = asn1_known_oid(object);
- if (oid != OID_UNKNOWN)
+ if (oid == OID_UNKNOWN)
+ {
+ char *oid_str = asn1_oid_to_string(object);
+
+ if (!oid_str)
+ {
+ break;
+ }
+ DBG2(DBG_LIB, " %s", oid_str);
+ free(oid_str);
+ }
+ else
{
DBG2(DBG_LIB, " '%s'", oid_names[oid].name);
- return;
}
- break;
+ return;
case ASN1_UTF8STRING:
case ASN1_IA5STRING:
case ASN1_PRINTABLESTRING:
diff --git a/src/libstrongswan/asn1/oid.c b/src/libstrongswan/asn1/oid.c
index 57a00a39e..6af088fd2 100644
--- a/src/libstrongswan/asn1/oid.c
+++ b/src/libstrongswan/asn1/oid.c
@@ -74,7 +74,7 @@ const oid_t oid_names[] = {
{ 0x36, 62, 0, 2, "inhibitAnyPolicy" }, /* 61 */
{ 0x37, 63, 0, 2, "targetInformation" }, /* 62 */
{ 0x38, 0, 0, 2, "noRevAvail" }, /* 63 */
- {0x2A, 161, 1, 0, "" }, /* 64 */
+ {0x2A, 163, 1, 0, "" }, /* 64 */
{ 0x83, 77, 1, 1, "" }, /* 65 */
{ 0x08, 0, 1, 2, "jp" }, /* 66 */
{ 0x8C, 0, 1, 3, "" }, /* 67 */
@@ -89,7 +89,7 @@ const oid_t oid_names[] = {
{ 0x04, 0, 0, 10, "camellia256-cbc" }, /* 76 */
{ 0x86, 0, 1, 1, "" }, /* 77 */
{ 0x48, 0, 1, 2, "us" }, /* 78 */
- { 0x86, 120, 1, 3, "" }, /* 79 */
+ { 0x86, 122, 1, 3, "" }, /* 79 */
{ 0xF6, 85, 1, 4, "" }, /* 80 */
{ 0x7D, 0, 1, 5, "NortelNetworks" }, /* 81 */
{ 0x07, 0, 1, 6, "Entrust" }, /* 82 */
@@ -97,276 +97,285 @@ const oid_t oid_names[] = {
{ 0x00, 0, 0, 8, "entrustVersInfo" }, /* 84 */
{ 0xF7, 0, 1, 4, "" }, /* 85 */
{ 0x0D, 0, 1, 5, "RSADSI" }, /* 86 */
- { 0x01, 115, 1, 6, "PKCS" }, /* 87 */
- { 0x01, 97, 1, 7, "PKCS-1" }, /* 88 */
+ { 0x01, 117, 1, 6, "PKCS" }, /* 87 */
+ { 0x01, 99, 1, 7, "PKCS-1" }, /* 88 */
{ 0x01, 90, 0, 8, "rsaEncryption" }, /* 89 */
{ 0x02, 91, 0, 8, "md2WithRSAEncryption" }, /* 90 */
{ 0x04, 92, 0, 8, "md5WithRSAEncryption" }, /* 91 */
{ 0x05, 93, 0, 8, "sha-1WithRSAEncryption" }, /* 92 */
- { 0x0B, 94, 0, 8, "sha256WithRSAEncryption" }, /* 93 */
- { 0x0C, 95, 0, 8, "sha384WithRSAEncryption" }, /* 94 */
- { 0x0D, 96, 0, 8, "sha512WithRSAEncryption" }, /* 95 */
- { 0x0E, 0, 0, 8, "sha224WithRSAEncryption" }, /* 96 */
- { 0x07, 104, 1, 7, "PKCS-7" }, /* 97 */
- { 0x01, 99, 0, 8, "data" }, /* 98 */
- { 0x02, 100, 0, 8, "signedData" }, /* 99 */
- { 0x03, 101, 0, 8, "envelopedData" }, /* 100 */
- { 0x04, 102, 0, 8, "signedAndEnvelopedData" }, /* 101 */
- { 0x05, 103, 0, 8, "digestedData" }, /* 102 */
- { 0x06, 0, 0, 8, "encryptedData" }, /* 103 */
- { 0x09, 0, 1, 7, "PKCS-9" }, /* 104 */
- { 0x01, 106, 0, 8, "E" }, /* 105 */
- { 0x02, 107, 0, 8, "unstructuredName" }, /* 106 */
- { 0x03, 108, 0, 8, "contentType" }, /* 107 */
- { 0x04, 109, 0, 8, "messageDigest" }, /* 108 */
- { 0x05, 110, 0, 8, "signingTime" }, /* 109 */
- { 0x06, 111, 0, 8, "counterSignature" }, /* 110 */
- { 0x07, 112, 0, 8, "challengePassword" }, /* 111 */
- { 0x08, 113, 0, 8, "unstructuredAddress" }, /* 112 */
- { 0x0E, 114, 0, 8, "extensionRequest" }, /* 113 */
- { 0x0F, 0, 0, 8, "S/MIME Capabilities" }, /* 114 */
- { 0x02, 118, 1, 6, "digestAlgorithm" }, /* 115 */
- { 0x02, 117, 0, 7, "md2" }, /* 116 */
- { 0x05, 0, 0, 7, "md5" }, /* 117 */
- { 0x03, 0, 1, 6, "encryptionAlgorithm" }, /* 118 */
- { 0x07, 0, 0, 7, "3des-ede-cbc" }, /* 119 */
- { 0xCE, 0, 1, 3, "" }, /* 120 */
- { 0x3D, 0, 1, 4, "ansi-X9-62" }, /* 121 */
- { 0x02, 124, 1, 5, "id-publicKeyType" }, /* 122 */
- { 0x01, 0, 0, 6, "id-ecPublicKey" }, /* 123 */
- { 0x03, 154, 1, 5, "ellipticCurve" }, /* 124 */
- { 0x00, 146, 1, 6, "c-TwoCurve" }, /* 125 */
- { 0x01, 127, 0, 7, "c2pnb163v1" }, /* 126 */
- { 0x02, 128, 0, 7, "c2pnb163v2" }, /* 127 */
- { 0x03, 129, 0, 7, "c2pnb163v3" }, /* 128 */
- { 0x04, 130, 0, 7, "c2pnb176w1" }, /* 129 */
- { 0x05, 131, 0, 7, "c2tnb191v1" }, /* 130 */
- { 0x06, 132, 0, 7, "c2tnb191v2" }, /* 131 */
- { 0x07, 133, 0, 7, "c2tnb191v3" }, /* 132 */
- { 0x08, 134, 0, 7, "c2onb191v4" }, /* 133 */
- { 0x09, 135, 0, 7, "c2onb191v5" }, /* 134 */
- { 0x0A, 136, 0, 7, "c2pnb208w1" }, /* 135 */
- { 0x0B, 137, 0, 7, "c2tnb239v1" }, /* 136 */
- { 0x0C, 138, 0, 7, "c2tnb239v2" }, /* 137 */
- { 0x0D, 139, 0, 7, "c2tnb239v3" }, /* 138 */
- { 0x0E, 140, 0, 7, "c2onb239v4" }, /* 139 */
- { 0x0F, 141, 0, 7, "c2onb239v5" }, /* 140 */
- { 0x10, 142, 0, 7, "c2pnb272w1" }, /* 141 */
- { 0x11, 143, 0, 7, "c2pnb304w1" }, /* 142 */
- { 0x12, 144, 0, 7, "c2tnb359v1" }, /* 143 */
- { 0x13, 145, 0, 7, "c2pnb368w1" }, /* 144 */
- { 0x14, 0, 0, 7, "c2tnb431r1" }, /* 145 */
- { 0x01, 0, 1, 6, "primeCurve" }, /* 146 */
- { 0x01, 148, 0, 7, "prime192v1" }, /* 147 */
- { 0x02, 149, 0, 7, "prime192v2" }, /* 148 */
- { 0x03, 150, 0, 7, "prime192v3" }, /* 149 */
- { 0x04, 151, 0, 7, "prime239v1" }, /* 150 */
- { 0x05, 152, 0, 7, "prime239v2" }, /* 151 */
- { 0x06, 153, 0, 7, "prime239v3" }, /* 152 */
- { 0x07, 0, 0, 7, "prime256v1" }, /* 153 */
- { 0x04, 0, 1, 5, "id-ecSigType" }, /* 154 */
- { 0x01, 156, 0, 6, "ecdsa-with-SHA1" }, /* 155 */
- { 0x03, 0, 1, 6, "ecdsa-with-Specified" }, /* 156 */
- { 0x01, 158, 0, 7, "ecdsa-with-SHA224" }, /* 157 */
- { 0x02, 159, 0, 7, "ecdsa-with-SHA256" }, /* 158 */
- { 0x03, 160, 0, 7, "ecdsa-with-SHA384" }, /* 159 */
- { 0x04, 0, 0, 7, "ecdsa-with-SHA512" }, /* 160 */
- {0x2B, 312, 1, 0, "" }, /* 161 */
- { 0x06, 226, 1, 1, "dod" }, /* 162 */
- { 0x01, 0, 1, 2, "internet" }, /* 163 */
- { 0x04, 186, 1, 3, "private" }, /* 164 */
- { 0x01, 0, 1, 4, "enterprise" }, /* 165 */
- { 0x82, 179, 1, 5, "" }, /* 166 */
- { 0x37, 176, 1, 6, "Microsoft" }, /* 167 */
- { 0x0A, 172, 1, 7, "" }, /* 168 */
- { 0x03, 0, 1, 8, "" }, /* 169 */
- { 0x03, 171, 0, 9, "msSGC" }, /* 170 */
- { 0x04, 0, 0, 9, "msEncryptingFileSystem" }, /* 171 */
- { 0x14, 0, 1, 7, "msEnrollmentInfrastructure"}, /* 172 */
- { 0x02, 0, 1, 8, "msCertificateTypeExtension"}, /* 173 */
- { 0x02, 175, 0, 9, "msSmartcardLogon" }, /* 174 */
- { 0x03, 0, 0, 9, "msUPN" }, /* 175 */
- { 0xA0, 0, 1, 6, "" }, /* 176 */
- { 0x2A, 0, 1, 7, "ITA" }, /* 177 */
- { 0x01, 0, 0, 8, "strongSwan" }, /* 178 */
- { 0x89, 0, 1, 5, "" }, /* 179 */
- { 0x31, 0, 1, 6, "" }, /* 180 */
- { 0x01, 0, 1, 7, "" }, /* 181 */
- { 0x01, 0, 1, 8, "" }, /* 182 */
- { 0x02, 0, 1, 9, "" }, /* 183 */
- { 0x02, 0, 1, 10, "" }, /* 184 */
- { 0x4B, 0, 0, 11, "TCGID" }, /* 185 */
- { 0x05, 0, 1, 3, "security" }, /* 186 */
- { 0x05, 0, 1, 4, "mechanisms" }, /* 187 */
- { 0x07, 0, 1, 5, "id-pkix" }, /* 188 */
- { 0x01, 193, 1, 6, "id-pe" }, /* 189 */
- { 0x01, 191, 0, 7, "authorityInfoAccess" }, /* 190 */
- { 0x03, 192, 0, 7, "qcStatements" }, /* 191 */
- { 0x07, 0, 0, 7, "ipAddrBlocks" }, /* 192 */
- { 0x02, 196, 1, 6, "id-qt" }, /* 193 */
- { 0x01, 195, 0, 7, "cps" }, /* 194 */
- { 0x02, 0, 0, 7, "unotice" }, /* 195 */
- { 0x03, 206, 1, 6, "id-kp" }, /* 196 */
- { 0x01, 198, 0, 7, "serverAuth" }, /* 197 */
- { 0x02, 199, 0, 7, "clientAuth" }, /* 198 */
- { 0x03, 200, 0, 7, "codeSigning" }, /* 199 */
- { 0x04, 201, 0, 7, "emailProtection" }, /* 200 */
- { 0x05, 202, 0, 7, "ipsecEndSystem" }, /* 201 */
- { 0x06, 203, 0, 7, "ipsecTunnel" }, /* 202 */
- { 0x07, 204, 0, 7, "ipsecUser" }, /* 203 */
- { 0x08, 205, 0, 7, "timeStamping" }, /* 204 */
- { 0x09, 0, 0, 7, "ocspSigning" }, /* 205 */
- { 0x08, 208, 1, 6, "id-otherNames" }, /* 206 */
- { 0x05, 0, 0, 7, "xmppAddr" }, /* 207 */
- { 0x0A, 213, 1, 6, "id-aca" }, /* 208 */
- { 0x01, 210, 0, 7, "authenticationInfo" }, /* 209 */
- { 0x02, 211, 0, 7, "accessIdentity" }, /* 210 */
- { 0x03, 212, 0, 7, "chargingIdentity" }, /* 211 */
- { 0x04, 0, 0, 7, "group" }, /* 212 */
- { 0x0B, 214, 0, 6, "subjectInfoAccess" }, /* 213 */
- { 0x30, 0, 1, 6, "id-ad" }, /* 214 */
- { 0x01, 223, 1, 7, "ocsp" }, /* 215 */
- { 0x01, 217, 0, 8, "basic" }, /* 216 */
- { 0x02, 218, 0, 8, "nonce" }, /* 217 */
- { 0x03, 219, 0, 8, "crl" }, /* 218 */
- { 0x04, 220, 0, 8, "response" }, /* 219 */
- { 0x05, 221, 0, 8, "noCheck" }, /* 220 */
- { 0x06, 222, 0, 8, "archiveCutoff" }, /* 221 */
- { 0x07, 0, 0, 8, "serviceLocator" }, /* 222 */
- { 0x02, 224, 0, 7, "caIssuers" }, /* 223 */
- { 0x03, 225, 0, 7, "timeStamping" }, /* 224 */
- { 0x05, 0, 0, 7, "caRepository" }, /* 225 */
- { 0x0E, 232, 1, 1, "oiw" }, /* 226 */
- { 0x03, 0, 1, 2, "secsig" }, /* 227 */
- { 0x02, 0, 1, 3, "algorithms" }, /* 228 */
- { 0x07, 230, 0, 4, "des-cbc" }, /* 229 */
- { 0x1A, 231, 0, 4, "sha-1" }, /* 230 */
- { 0x1D, 0, 0, 4, "sha-1WithRSASignature" }, /* 231 */
- { 0x24, 278, 1, 1, "TeleTrusT" }, /* 232 */
- { 0x03, 0, 1, 2, "algorithm" }, /* 233 */
- { 0x03, 0, 1, 3, "signatureAlgorithm" }, /* 234 */
- { 0x01, 239, 1, 4, "rsaSignature" }, /* 235 */
- { 0x02, 237, 0, 5, "rsaSigWithripemd160" }, /* 236 */
- { 0x03, 238, 0, 5, "rsaSigWithripemd128" }, /* 237 */
- { 0x04, 0, 0, 5, "rsaSigWithripemd256" }, /* 238 */
- { 0x02, 0, 1, 4, "ecSign" }, /* 239 */
- { 0x01, 241, 0, 5, "ecSignWithsha1" }, /* 240 */
- { 0x02, 242, 0, 5, "ecSignWithripemd160" }, /* 241 */
- { 0x03, 243, 0, 5, "ecSignWithmd2" }, /* 242 */
- { 0x04, 244, 0, 5, "ecSignWithmd5" }, /* 243 */
- { 0x05, 261, 1, 5, "ttt-ecg" }, /* 244 */
- { 0x01, 249, 1, 6, "fieldType" }, /* 245 */
- { 0x01, 0, 1, 7, "characteristictwoField" }, /* 246 */
- { 0x01, 0, 1, 8, "basisType" }, /* 247 */
- { 0x01, 0, 0, 9, "ipBasis" }, /* 248 */
- { 0x02, 251, 1, 6, "keyType" }, /* 249 */
- { 0x01, 0, 0, 7, "ecgPublicKey" }, /* 250 */
- { 0x03, 252, 0, 6, "curve" }, /* 251 */
- { 0x04, 259, 1, 6, "signatures" }, /* 252 */
- { 0x01, 254, 0, 7, "ecgdsa-with-RIPEMD160" }, /* 253 */
- { 0x02, 255, 0, 7, "ecgdsa-with-SHA1" }, /* 254 */
- { 0x03, 256, 0, 7, "ecgdsa-with-SHA224" }, /* 255 */
- { 0x04, 257, 0, 7, "ecgdsa-with-SHA256" }, /* 256 */
- { 0x05, 258, 0, 7, "ecgdsa-with-SHA384" }, /* 257 */
- { 0x06, 0, 0, 7, "ecgdsa-with-SHA512" }, /* 258 */
- { 0x05, 0, 1, 6, "module" }, /* 259 */
- { 0x01, 0, 0, 7, "1" }, /* 260 */
- { 0x08, 0, 1, 5, "ecStdCurvesAndGeneration" }, /* 261 */
- { 0x01, 0, 1, 6, "ellipticCurve" }, /* 262 */
- { 0x01, 0, 1, 7, "versionOne" }, /* 263 */
- { 0x01, 265, 0, 8, "brainpoolP160r1" }, /* 264 */
- { 0x02, 266, 0, 8, "brainpoolP160t1" }, /* 265 */
- { 0x03, 267, 0, 8, "brainpoolP192r1" }, /* 266 */
- { 0x04, 268, 0, 8, "brainpoolP192t1" }, /* 267 */
- { 0x05, 269, 0, 8, "brainpoolP224r1" }, /* 268 */
- { 0x06, 270, 0, 8, "brainpoolP224t1" }, /* 269 */
- { 0x07, 271, 0, 8, "brainpoolP256r1" }, /* 270 */
- { 0x08, 272, 0, 8, "brainpoolP256t1" }, /* 271 */
- { 0x09, 273, 0, 8, "brainpoolP320r1" }, /* 272 */
- { 0x0A, 274, 0, 8, "brainpoolP320t1" }, /* 273 */
- { 0x0B, 275, 0, 8, "brainpoolP384r1" }, /* 274 */
- { 0x0C, 276, 0, 8, "brainpoolP384t1" }, /* 275 */
- { 0x0D, 277, 0, 8, "brainpoolP512r1" }, /* 276 */
- { 0x0E, 0, 0, 8, "brainpoolP512t1" }, /* 277 */
- { 0x81, 0, 1, 1, "" }, /* 278 */
- { 0x04, 0, 1, 2, "Certicom" }, /* 279 */
- { 0x00, 0, 1, 3, "curve" }, /* 280 */
- { 0x01, 282, 0, 4, "sect163k1" }, /* 281 */
- { 0x02, 283, 0, 4, "sect163r1" }, /* 282 */
- { 0x03, 284, 0, 4, "sect239k1" }, /* 283 */
- { 0x04, 285, 0, 4, "sect113r1" }, /* 284 */
- { 0x05, 286, 0, 4, "sect113r2" }, /* 285 */
- { 0x06, 287, 0, 4, "secp112r1" }, /* 286 */
- { 0x07, 288, 0, 4, "secp112r2" }, /* 287 */
- { 0x08, 289, 0, 4, "secp160r1" }, /* 288 */
- { 0x09, 290, 0, 4, "secp160k1" }, /* 289 */
- { 0x0A, 291, 0, 4, "secp256k1" }, /* 290 */
- { 0x0F, 292, 0, 4, "sect163r2" }, /* 291 */
- { 0x10, 293, 0, 4, "sect283k1" }, /* 292 */
- { 0x11, 294, 0, 4, "sect283r1" }, /* 293 */
- { 0x16, 295, 0, 4, "sect131r1" }, /* 294 */
- { 0x17, 296, 0, 4, "sect131r2" }, /* 295 */
- { 0x18, 297, 0, 4, "sect193r1" }, /* 296 */
- { 0x19, 298, 0, 4, "sect193r2" }, /* 297 */
- { 0x1A, 299, 0, 4, "sect233k1" }, /* 298 */
- { 0x1B, 300, 0, 4, "sect233r1" }, /* 299 */
- { 0x1C, 301, 0, 4, "secp128r1" }, /* 300 */
- { 0x1D, 302, 0, 4, "secp128r2" }, /* 301 */
- { 0x1E, 303, 0, 4, "secp160r2" }, /* 302 */
- { 0x1F, 304, 0, 4, "secp192k1" }, /* 303 */
- { 0x20, 305, 0, 4, "secp224k1" }, /* 304 */
- { 0x21, 306, 0, 4, "secp224r1" }, /* 305 */
- { 0x22, 307, 0, 4, "secp384r1" }, /* 306 */
- { 0x23, 308, 0, 4, "secp521r1" }, /* 307 */
- { 0x24, 309, 0, 4, "sect409k1" }, /* 308 */
- { 0x25, 310, 0, 4, "sect409r1" }, /* 309 */
- { 0x26, 311, 0, 4, "sect571k1" }, /* 310 */
- { 0x27, 0, 0, 4, "sect571r1" }, /* 311 */
- {0x60, 0, 1, 0, "" }, /* 312 */
- { 0x86, 0, 1, 1, "" }, /* 313 */
- { 0x48, 0, 1, 2, "" }, /* 314 */
- { 0x01, 0, 1, 3, "organization" }, /* 315 */
- { 0x65, 334, 1, 4, "gov" }, /* 316 */
- { 0x03, 0, 1, 5, "csor" }, /* 317 */
- { 0x04, 0, 1, 6, "nistalgorithm" }, /* 318 */
- { 0x01, 329, 1, 7, "aes" }, /* 319 */
- { 0x02, 321, 0, 8, "id-aes128-CBC" }, /* 320 */
- { 0x06, 322, 0, 8, "id-aes128-GCM" }, /* 321 */
- { 0x07, 323, 0, 8, "id-aes128-CCM" }, /* 322 */
- { 0x16, 324, 0, 8, "id-aes192-CBC" }, /* 323 */
- { 0x1A, 325, 0, 8, "id-aes192-GCM" }, /* 324 */
- { 0x1B, 326, 0, 8, "id-aes192-CCM" }, /* 325 */
- { 0x2A, 327, 0, 8, "id-aes256-CBC" }, /* 326 */
- { 0x2E, 328, 0, 8, "id-aes256-GCM" }, /* 327 */
- { 0x2F, 0, 0, 8, "id-aes256-CCM" }, /* 328 */
- { 0x02, 0, 1, 7, "hashalgs" }, /* 329 */
- { 0x01, 331, 0, 8, "id-SHA-256" }, /* 330 */
- { 0x02, 332, 0, 8, "id-SHA-384" }, /* 331 */
- { 0x03, 333, 0, 8, "id-SHA-512" }, /* 332 */
- { 0x04, 0, 0, 8, "id-SHA-224" }, /* 333 */
- { 0x86, 0, 1, 4, "" }, /* 334 */
- { 0xf8, 0, 1, 5, "" }, /* 335 */
- { 0x42, 348, 1, 6, "netscape" }, /* 336 */
- { 0x01, 343, 1, 7, "" }, /* 337 */
- { 0x01, 339, 0, 8, "nsCertType" }, /* 338 */
- { 0x03, 340, 0, 8, "nsRevocationUrl" }, /* 339 */
- { 0x04, 341, 0, 8, "nsCaRevocationUrl" }, /* 340 */
- { 0x08, 342, 0, 8, "nsCaPolicyUrl" }, /* 341 */
- { 0x0d, 0, 0, 8, "nsComment" }, /* 342 */
- { 0x03, 346, 1, 7, "directory" }, /* 343 */
- { 0x01, 0, 1, 8, "" }, /* 344 */
- { 0x03, 0, 0, 9, "employeeNumber" }, /* 345 */
- { 0x04, 0, 1, 7, "policy" }, /* 346 */
- { 0x01, 0, 0, 8, "nsSGC" }, /* 347 */
- { 0x45, 0, 1, 6, "verisign" }, /* 348 */
- { 0x01, 0, 1, 7, "pki" }, /* 349 */
- { 0x09, 0, 1, 8, "attributes" }, /* 350 */
- { 0x02, 352, 0, 9, "messageType" }, /* 351 */
- { 0x03, 353, 0, 9, "pkiStatus" }, /* 352 */
- { 0x04, 354, 0, 9, "failInfo" }, /* 353 */
- { 0x05, 355, 0, 9, "senderNonce" }, /* 354 */
- { 0x06, 356, 0, 9, "recipientNonce" }, /* 355 */
- { 0x07, 357, 0, 9, "transID" }, /* 356 */
- { 0x08, 358, 0, 9, "extensionReq" }, /* 357 */
- { 0x08, 0, 0, 9, "extensionReq" } /* 358 */
+ { 0x07, 94, 0, 8, "id-RSAES-OAEP" }, /* 93 */
+ { 0x09, 95, 0, 8, "id-pSpecified" }, /* 94 */
+ { 0x0B, 96, 0, 8, "sha256WithRSAEncryption" }, /* 95 */
+ { 0x0C, 97, 0, 8, "sha384WithRSAEncryption" }, /* 96 */
+ { 0x0D, 98, 0, 8, "sha512WithRSAEncryption" }, /* 97 */
+ { 0x0E, 0, 0, 8, "sha224WithRSAEncryption" }, /* 98 */
+ { 0x07, 106, 1, 7, "PKCS-7" }, /* 99 */
+ { 0x01, 101, 0, 8, "data" }, /* 100 */
+ { 0x02, 102, 0, 8, "signedData" }, /* 101 */
+ { 0x03, 103, 0, 8, "envelopedData" }, /* 102 */
+ { 0x04, 104, 0, 8, "signedAndEnvelopedData" }, /* 103 */
+ { 0x05, 105, 0, 8, "digestedData" }, /* 104 */
+ { 0x06, 0, 0, 8, "encryptedData" }, /* 105 */
+ { 0x09, 0, 1, 7, "PKCS-9" }, /* 106 */
+ { 0x01, 108, 0, 8, "E" }, /* 107 */
+ { 0x02, 109, 0, 8, "unstructuredName" }, /* 108 */
+ { 0x03, 110, 0, 8, "contentType" }, /* 109 */
+ { 0x04, 111, 0, 8, "messageDigest" }, /* 110 */
+ { 0x05, 112, 0, 8, "signingTime" }, /* 111 */
+ { 0x06, 113, 0, 8, "counterSignature" }, /* 112 */
+ { 0x07, 114, 0, 8, "challengePassword" }, /* 113 */
+ { 0x08, 115, 0, 8, "unstructuredAddress" }, /* 114 */
+ { 0x0E, 116, 0, 8, "extensionRequest" }, /* 115 */
+ { 0x0F, 0, 0, 8, "S/MIME Capabilities" }, /* 116 */
+ { 0x02, 120, 1, 6, "digestAlgorithm" }, /* 117 */
+ { 0x02, 119, 0, 7, "md2" }, /* 118 */
+ { 0x05, 0, 0, 7, "md5" }, /* 119 */
+ { 0x03, 0, 1, 6, "encryptionAlgorithm" }, /* 120 */
+ { 0x07, 0, 0, 7, "3des-ede-cbc" }, /* 121 */
+ { 0xCE, 0, 1, 3, "" }, /* 122 */
+ { 0x3D, 0, 1, 4, "ansi-X9-62" }, /* 123 */
+ { 0x02, 126, 1, 5, "id-publicKeyType" }, /* 124 */
+ { 0x01, 0, 0, 6, "id-ecPublicKey" }, /* 125 */
+ { 0x03, 156, 1, 5, "ellipticCurve" }, /* 126 */
+ { 0x00, 148, 1, 6, "c-TwoCurve" }, /* 127 */
+ { 0x01, 129, 0, 7, "c2pnb163v1" }, /* 128 */
+ { 0x02, 130, 0, 7, "c2pnb163v2" }, /* 129 */
+ { 0x03, 131, 0, 7, "c2pnb163v3" }, /* 130 */
+ { 0x04, 132, 0, 7, "c2pnb176w1" }, /* 131 */
+ { 0x05, 133, 0, 7, "c2tnb191v1" }, /* 132 */
+ { 0x06, 134, 0, 7, "c2tnb191v2" }, /* 133 */
+ { 0x07, 135, 0, 7, "c2tnb191v3" }, /* 134 */
+ { 0x08, 136, 0, 7, "c2onb191v4" }, /* 135 */
+ { 0x09, 137, 0, 7, "c2onb191v5" }, /* 136 */
+ { 0x0A, 138, 0, 7, "c2pnb208w1" }, /* 137 */
+ { 0x0B, 139, 0, 7, "c2tnb239v1" }, /* 138 */
+ { 0x0C, 140, 0, 7, "c2tnb239v2" }, /* 139 */
+ { 0x0D, 141, 0, 7, "c2tnb239v3" }, /* 140 */
+ { 0x0E, 142, 0, 7, "c2onb239v4" }, /* 141 */
+ { 0x0F, 143, 0, 7, "c2onb239v5" }, /* 142 */
+ { 0x10, 144, 0, 7, "c2pnb272w1" }, /* 143 */
+ { 0x11, 145, 0, 7, "c2pnb304w1" }, /* 144 */
+ { 0x12, 146, 0, 7, "c2tnb359v1" }, /* 145 */
+ { 0x13, 147, 0, 7, "c2pnb368w1" }, /* 146 */
+ { 0x14, 0, 0, 7, "c2tnb431r1" }, /* 147 */
+ { 0x01, 0, 1, 6, "primeCurve" }, /* 148 */
+ { 0x01, 150, 0, 7, "prime192v1" }, /* 149 */
+ { 0x02, 151, 0, 7, "prime192v2" }, /* 150 */
+ { 0x03, 152, 0, 7, "prime192v3" }, /* 151 */
+ { 0x04, 153, 0, 7, "prime239v1" }, /* 152 */
+ { 0x05, 154, 0, 7, "prime239v2" }, /* 153 */
+ { 0x06, 155, 0, 7, "prime239v3" }, /* 154 */
+ { 0x07, 0, 0, 7, "prime256v1" }, /* 155 */
+ { 0x04, 0, 1, 5, "id-ecSigType" }, /* 156 */
+ { 0x01, 158, 0, 6, "ecdsa-with-SHA1" }, /* 157 */
+ { 0x03, 0, 1, 6, "ecdsa-with-Specified" }, /* 158 */
+ { 0x01, 160, 0, 7, "ecdsa-with-SHA224" }, /* 159 */
+ { 0x02, 161, 0, 7, "ecdsa-with-SHA256" }, /* 160 */
+ { 0x03, 162, 0, 7, "ecdsa-with-SHA384" }, /* 161 */
+ { 0x04, 0, 0, 7, "ecdsa-with-SHA512" }, /* 162 */
+ {0x2B, 314, 1, 0, "" }, /* 163 */
+ { 0x06, 228, 1, 1, "dod" }, /* 164 */
+ { 0x01, 0, 1, 2, "internet" }, /* 165 */
+ { 0x04, 188, 1, 3, "private" }, /* 166 */
+ { 0x01, 0, 1, 4, "enterprise" }, /* 167 */
+ { 0x82, 181, 1, 5, "" }, /* 168 */
+ { 0x37, 178, 1, 6, "Microsoft" }, /* 169 */
+ { 0x0A, 174, 1, 7, "" }, /* 170 */
+ { 0x03, 0, 1, 8, "" }, /* 171 */
+ { 0x03, 173, 0, 9, "msSGC" }, /* 172 */
+ { 0x04, 0, 0, 9, "msEncryptingFileSystem" }, /* 173 */
+ { 0x14, 0, 1, 7, "msEnrollmentInfrastructure"}, /* 174 */
+ { 0x02, 0, 1, 8, "msCertificateTypeExtension"}, /* 175 */
+ { 0x02, 177, 0, 9, "msSmartcardLogon" }, /* 176 */
+ { 0x03, 0, 0, 9, "msUPN" }, /* 177 */
+ { 0xA0, 0, 1, 6, "" }, /* 178 */
+ { 0x2A, 0, 1, 7, "ITA" }, /* 179 */
+ { 0x01, 0, 0, 8, "strongSwan" }, /* 180 */
+ { 0x89, 0, 1, 5, "" }, /* 181 */
+ { 0x31, 0, 1, 6, "" }, /* 182 */
+ { 0x01, 0, 1, 7, "" }, /* 183 */
+ { 0x01, 0, 1, 8, "" }, /* 184 */
+ { 0x02, 0, 1, 9, "" }, /* 185 */
+ { 0x02, 0, 1, 10, "" }, /* 186 */
+ { 0x4B, 0, 0, 11, "TCGID" }, /* 187 */
+ { 0x05, 0, 1, 3, "security" }, /* 188 */
+ { 0x05, 0, 1, 4, "mechanisms" }, /* 189 */
+ { 0x07, 0, 1, 5, "id-pkix" }, /* 190 */
+ { 0x01, 195, 1, 6, "id-pe" }, /* 191 */
+ { 0x01, 193, 0, 7, "authorityInfoAccess" }, /* 192 */
+ { 0x03, 194, 0, 7, "qcStatements" }, /* 193 */
+ { 0x07, 0, 0, 7, "ipAddrBlocks" }, /* 194 */
+ { 0x02, 198, 1, 6, "id-qt" }, /* 195 */
+ { 0x01, 197, 0, 7, "cps" }, /* 196 */
+ { 0x02, 0, 0, 7, "unotice" }, /* 197 */
+ { 0x03, 208, 1, 6, "id-kp" }, /* 198 */
+ { 0x01, 200, 0, 7, "serverAuth" }, /* 199 */
+ { 0x02, 201, 0, 7, "clientAuth" }, /* 200 */
+ { 0x03, 202, 0, 7, "codeSigning" }, /* 201 */
+ { 0x04, 203, 0, 7, "emailProtection" }, /* 202 */
+ { 0x05, 204, 0, 7, "ipsecEndSystem" }, /* 203 */
+ { 0x06, 205, 0, 7, "ipsecTunnel" }, /* 204 */
+ { 0x07, 206, 0, 7, "ipsecUser" }, /* 205 */
+ { 0x08, 207, 0, 7, "timeStamping" }, /* 206 */
+ { 0x09, 0, 0, 7, "ocspSigning" }, /* 207 */
+ { 0x08, 210, 1, 6, "id-otherNames" }, /* 208 */
+ { 0x05, 0, 0, 7, "xmppAddr" }, /* 209 */
+ { 0x0A, 215, 1, 6, "id-aca" }, /* 210 */
+ { 0x01, 212, 0, 7, "authenticationInfo" }, /* 211 */
+ { 0x02, 213, 0, 7, "accessIdentity" }, /* 212 */
+ { 0x03, 214, 0, 7, "chargingIdentity" }, /* 213 */
+ { 0x04, 0, 0, 7, "group" }, /* 214 */
+ { 0x0B, 216, 0, 6, "subjectInfoAccess" }, /* 215 */
+ { 0x30, 0, 1, 6, "id-ad" }, /* 216 */
+ { 0x01, 225, 1, 7, "ocsp" }, /* 217 */
+ { 0x01, 219, 0, 8, "basic" }, /* 218 */
+ { 0x02, 220, 0, 8, "nonce" }, /* 219 */
+ { 0x03, 221, 0, 8, "crl" }, /* 220 */
+ { 0x04, 222, 0, 8, "response" }, /* 221 */
+ { 0x05, 223, 0, 8, "noCheck" }, /* 222 */
+ { 0x06, 224, 0, 8, "archiveCutoff" }, /* 223 */
+ { 0x07, 0, 0, 8, "serviceLocator" }, /* 224 */
+ { 0x02, 226, 0, 7, "caIssuers" }, /* 225 */
+ { 0x03, 227, 0, 7, "timeStamping" }, /* 226 */
+ { 0x05, 0, 0, 7, "caRepository" }, /* 227 */
+ { 0x0E, 234, 1, 1, "oiw" }, /* 228 */
+ { 0x03, 0, 1, 2, "secsig" }, /* 229 */
+ { 0x02, 0, 1, 3, "algorithms" }, /* 230 */
+ { 0x07, 232, 0, 4, "des-cbc" }, /* 231 */
+ { 0x1A, 233, 0, 4, "sha-1" }, /* 232 */
+ { 0x1D, 0, 0, 4, "sha-1WithRSASignature" }, /* 233 */
+ { 0x24, 280, 1, 1, "TeleTrusT" }, /* 234 */
+ { 0x03, 0, 1, 2, "algorithm" }, /* 235 */
+ { 0x03, 0, 1, 3, "signatureAlgorithm" }, /* 236 */
+ { 0x01, 241, 1, 4, "rsaSignature" }, /* 237 */
+ { 0x02, 239, 0, 5, "rsaSigWithripemd160" }, /* 238 */
+ { 0x03, 240, 0, 5, "rsaSigWithripemd128" }, /* 239 */
+ { 0x04, 0, 0, 5, "rsaSigWithripemd256" }, /* 240 */
+ { 0x02, 0, 1, 4, "ecSign" }, /* 241 */
+ { 0x01, 243, 0, 5, "ecSignWithsha1" }, /* 242 */
+ { 0x02, 244, 0, 5, "ecSignWithripemd160" }, /* 243 */
+ { 0x03, 245, 0, 5, "ecSignWithmd2" }, /* 244 */
+ { 0x04, 246, 0, 5, "ecSignWithmd5" }, /* 245 */
+ { 0x05, 263, 1, 5, "ttt-ecg" }, /* 246 */
+ { 0x01, 251, 1, 6, "fieldType" }, /* 247 */
+ { 0x01, 0, 1, 7, "characteristictwoField" }, /* 248 */
+ { 0x01, 0, 1, 8, "basisType" }, /* 249 */
+ { 0x01, 0, 0, 9, "ipBasis" }, /* 250 */
+ { 0x02, 253, 1, 6, "keyType" }, /* 251 */
+ { 0x01, 0, 0, 7, "ecgPublicKey" }, /* 252 */
+ { 0x03, 254, 0, 6, "curve" }, /* 253 */
+ { 0x04, 261, 1, 6, "signatures" }, /* 254 */
+ { 0x01, 256, 0, 7, "ecgdsa-with-RIPEMD160" }, /* 255 */
+ { 0x02, 257, 0, 7, "ecgdsa-with-SHA1" }, /* 256 */
+ { 0x03, 258, 0, 7, "ecgdsa-with-SHA224" }, /* 257 */
+ { 0x04, 259, 0, 7, "ecgdsa-with-SHA256" }, /* 258 */
+ { 0x05, 260, 0, 7, "ecgdsa-with-SHA384" }, /* 259 */
+ { 0x06, 0, 0, 7, "ecgdsa-with-SHA512" }, /* 260 */
+ { 0x05, 0, 1, 6, "module" }, /* 261 */
+ { 0x01, 0, 0, 7, "1" }, /* 262 */
+ { 0x08, 0, 1, 5, "ecStdCurvesAndGeneration" }, /* 263 */
+ { 0x01, 0, 1, 6, "ellipticCurve" }, /* 264 */
+ { 0x01, 0, 1, 7, "versionOne" }, /* 265 */
+ { 0x01, 267, 0, 8, "brainpoolP160r1" }, /* 266 */
+ { 0x02, 268, 0, 8, "brainpoolP160t1" }, /* 267 */
+ { 0x03, 269, 0, 8, "brainpoolP192r1" }, /* 268 */
+ { 0x04, 270, 0, 8, "brainpoolP192t1" }, /* 269 */
+ { 0x05, 271, 0, 8, "brainpoolP224r1" }, /* 270 */
+ { 0x06, 272, 0, 8, "brainpoolP224t1" }, /* 271 */
+ { 0x07, 273, 0, 8, "brainpoolP256r1" }, /* 272 */
+ { 0x08, 274, 0, 8, "brainpoolP256t1" }, /* 273 */
+ { 0x09, 275, 0, 8, "brainpoolP320r1" }, /* 274 */
+ { 0x0A, 276, 0, 8, "brainpoolP320t1" }, /* 275 */
+ { 0x0B, 277, 0, 8, "brainpoolP384r1" }, /* 276 */
+ { 0x0C, 278, 0, 8, "brainpoolP384t1" }, /* 277 */
+ { 0x0D, 279, 0, 8, "brainpoolP512r1" }, /* 278 */
+ { 0x0E, 0, 0, 8, "brainpoolP512t1" }, /* 279 */
+ { 0x81, 0, 1, 1, "" }, /* 280 */
+ { 0x04, 0, 1, 2, "Certicom" }, /* 281 */
+ { 0x00, 0, 1, 3, "curve" }, /* 282 */
+ { 0x01, 284, 0, 4, "sect163k1" }, /* 283 */
+ { 0x02, 285, 0, 4, "sect163r1" }, /* 284 */
+ { 0x03, 286, 0, 4, "sect239k1" }, /* 285 */
+ { 0x04, 287, 0, 4, "sect113r1" }, /* 286 */
+ { 0x05, 288, 0, 4, "sect113r2" }, /* 287 */
+ { 0x06, 289, 0, 4, "secp112r1" }, /* 288 */
+ { 0x07, 290, 0, 4, "secp112r2" }, /* 289 */
+ { 0x08, 291, 0, 4, "secp160r1" }, /* 290 */
+ { 0x09, 292, 0, 4, "secp160k1" }, /* 291 */
+ { 0x0A, 293, 0, 4, "secp256k1" }, /* 292 */
+ { 0x0F, 294, 0, 4, "sect163r2" }, /* 293 */
+ { 0x10, 295, 0, 4, "sect283k1" }, /* 294 */
+ { 0x11, 296, 0, 4, "sect283r1" }, /* 295 */
+ { 0x16, 297, 0, 4, "sect131r1" }, /* 296 */
+ { 0x17, 298, 0, 4, "sect131r2" }, /* 297 */
+ { 0x18, 299, 0, 4, "sect193r1" }, /* 298 */
+ { 0x19, 300, 0, 4, "sect193r2" }, /* 299 */
+ { 0x1A, 301, 0, 4, "sect233k1" }, /* 300 */
+ { 0x1B, 302, 0, 4, "sect233r1" }, /* 301 */
+ { 0x1C, 303, 0, 4, "secp128r1" }, /* 302 */
+ { 0x1D, 304, 0, 4, "secp128r2" }, /* 303 */
+ { 0x1E, 305, 0, 4, "secp160r2" }, /* 304 */
+ { 0x1F, 306, 0, 4, "secp192k1" }, /* 305 */
+ { 0x20, 307, 0, 4, "secp224k1" }, /* 306 */
+ { 0x21, 308, 0, 4, "secp224r1" }, /* 307 */
+ { 0x22, 309, 0, 4, "secp384r1" }, /* 308 */
+ { 0x23, 310, 0, 4, "secp521r1" }, /* 309 */
+ { 0x24, 311, 0, 4, "sect409k1" }, /* 310 */
+ { 0x25, 312, 0, 4, "sect409r1" }, /* 311 */
+ { 0x26, 313, 0, 4, "sect571k1" }, /* 312 */
+ { 0x27, 0, 0, 4, "sect571r1" }, /* 313 */
+ {0x60, 360, 1, 0, "" }, /* 314 */
+ { 0x86, 0, 1, 1, "" }, /* 315 */
+ { 0x48, 0, 1, 2, "" }, /* 316 */
+ { 0x01, 0, 1, 3, "organization" }, /* 317 */
+ { 0x65, 336, 1, 4, "gov" }, /* 318 */
+ { 0x03, 0, 1, 5, "csor" }, /* 319 */
+ { 0x04, 0, 1, 6, "nistalgorithm" }, /* 320 */
+ { 0x01, 331, 1, 7, "aes" }, /* 321 */
+ { 0x02, 323, 0, 8, "id-aes128-CBC" }, /* 322 */
+ { 0x06, 324, 0, 8, "id-aes128-GCM" }, /* 323 */
+ { 0x07, 325, 0, 8, "id-aes128-CCM" }, /* 324 */
+ { 0x16, 326, 0, 8, "id-aes192-CBC" }, /* 325 */
+ { 0x1A, 327, 0, 8, "id-aes192-GCM" }, /* 326 */
+ { 0x1B, 328, 0, 8, "id-aes192-CCM" }, /* 327 */
+ { 0x2A, 329, 0, 8, "id-aes256-CBC" }, /* 328 */
+ { 0x2E, 330, 0, 8, "id-aes256-GCM" }, /* 329 */
+ { 0x2F, 0, 0, 8, "id-aes256-CCM" }, /* 330 */
+ { 0x02, 0, 1, 7, "hashalgs" }, /* 331 */
+ { 0x01, 333, 0, 8, "id-SHA-256" }, /* 332 */
+ { 0x02, 334, 0, 8, "id-SHA-384" }, /* 333 */
+ { 0x03, 335, 0, 8, "id-SHA-512" }, /* 334 */
+ { 0x04, 0, 0, 8, "id-SHA-224" }, /* 335 */
+ { 0x86, 0, 1, 4, "" }, /* 336 */
+ { 0xf8, 0, 1, 5, "" }, /* 337 */
+ { 0x42, 350, 1, 6, "netscape" }, /* 338 */
+ { 0x01, 345, 1, 7, "" }, /* 339 */
+ { 0x01, 341, 0, 8, "nsCertType" }, /* 340 */
+ { 0x03, 342, 0, 8, "nsRevocationUrl" }, /* 341 */
+ { 0x04, 343, 0, 8, "nsCaRevocationUrl" }, /* 342 */
+ { 0x08, 344, 0, 8, "nsCaPolicyUrl" }, /* 343 */
+ { 0x0d, 0, 0, 8, "nsComment" }, /* 344 */
+ { 0x03, 348, 1, 7, "directory" }, /* 345 */
+ { 0x01, 0, 1, 8, "" }, /* 346 */
+ { 0x03, 0, 0, 9, "employeeNumber" }, /* 347 */
+ { 0x04, 0, 1, 7, "policy" }, /* 348 */
+ { 0x01, 0, 0, 8, "nsSGC" }, /* 349 */
+ { 0x45, 0, 1, 6, "verisign" }, /* 350 */
+ { 0x01, 0, 1, 7, "pki" }, /* 351 */
+ { 0x09, 0, 1, 8, "attributes" }, /* 352 */
+ { 0x02, 354, 0, 9, "messageType" }, /* 353 */
+ { 0x03, 355, 0, 9, "pkiStatus" }, /* 354 */
+ { 0x04, 356, 0, 9, "failInfo" }, /* 355 */
+ { 0x05, 357, 0, 9, "senderNonce" }, /* 356 */
+ { 0x06, 358, 0, 9, "recipientNonce" }, /* 357 */
+ { 0x07, 359, 0, 9, "transID" }, /* 358 */
+ { 0x08, 0, 0, 9, "extensionReq" }, /* 359 */
+ {0x67, 0, 1, 0, "" }, /* 360 */
+ { 0x81, 0, 1, 1, "" }, /* 361 */
+ { 0x05, 0, 1, 2, "" }, /* 362 */
+ { 0x02, 0, 1, 3, "tcg-attribute" }, /* 363 */
+ { 0x01, 365, 0, 4, "tcg-at-tpmManufacturer" }, /* 364 */
+ { 0x02, 366, 0, 4, "tcg-at-tpmModel" }, /* 365 */
+ { 0x03, 367, 0, 4, "tcg-at-tpmVersion" }, /* 366 */
+ { 0x0F, 0, 0, 4, "tcg-at-tpmIdLabel" } /* 367 */
};
diff --git a/src/libstrongswan/asn1/oid.h b/src/libstrongswan/asn1/oid.h
index b6ee9a10d..61db061f7 100644
--- a/src/libstrongswan/asn1/oid.h
+++ b/src/libstrongswan/asn1/oid.h
@@ -66,149 +66,155 @@ extern const oid_t oid_names[];
#define OID_MD2_WITH_RSA 90
#define OID_MD5_WITH_RSA 91
#define OID_SHA1_WITH_RSA 92
-#define OID_SHA256_WITH_RSA 93
-#define OID_SHA384_WITH_RSA 94
-#define OID_SHA512_WITH_RSA 95
-#define OID_SHA224_WITH_RSA 96
-#define OID_PKCS7_DATA 98
-#define OID_PKCS7_SIGNED_DATA 99
-#define OID_PKCS7_ENVELOPED_DATA 100
-#define OID_PKCS7_SIGNED_ENVELOPED_DATA 101
-#define OID_PKCS7_DIGESTED_DATA 102
-#define OID_PKCS7_ENCRYPTED_DATA 103
-#define OID_EMAIL_ADDRESS 105
-#define OID_UNSTRUCTURED_NAME 106
-#define OID_PKCS9_CONTENT_TYPE 107
-#define OID_PKCS9_MESSAGE_DIGEST 108
-#define OID_PKCS9_SIGNING_TIME 109
-#define OID_CHALLENGE_PASSWORD 111
-#define OID_EXTENSION_REQUEST 113
-#define OID_MD2 116
-#define OID_MD5 117
-#define OID_3DES_EDE_CBC 119
-#define OID_EC_PUBLICKEY 123
-#define OID_C2PNB163V1 126
-#define OID_C2PNB163V2 127
-#define OID_C2PNB163V3 128
-#define OID_C2PNB176W1 129
-#define OID_C2PNB191V1 130
-#define OID_C2PNB191V2 131
-#define OID_C2PNB191V3 132
-#define OID_C2PNB191V4 133
-#define OID_C2PNB191V5 134
-#define OID_C2PNB208W1 135
-#define OID_C2PNB239V1 136
-#define OID_C2PNB239V2 137
-#define OID_C2PNB239V3 138
-#define OID_C2PNB239V4 139
-#define OID_C2PNB239V5 140
-#define OID_C2PNB272W1 141
-#define OID_C2PNB304W1 142
-#define OID_C2PNB359V1 143
-#define OID_C2PNB368W1 144
-#define OID_C2PNB431R1 145
-#define OID_PRIME192V1 147
-#define OID_PRIME192V2 148
-#define OID_PRIME192V3 149
-#define OID_PRIME239V1 150
-#define OID_PRIME239V2 151
-#define OID_PRIME239V3 152
-#define OID_PRIME256V1 153
-#define OID_ECDSA_WITH_SHA1 155
-#define OID_ECDSA_WITH_SHA224 157
-#define OID_ECDSA_WITH_SHA256 158
-#define OID_ECDSA_WITH_SHA384 159
-#define OID_ECDSA_WITH_SHA512 160
-#define OID_USER_PRINCIPAL_NAME 175
-#define OID_STRONGSWAN 178
-#define OID_TCGID 185
-#define OID_AUTHORITY_INFO_ACCESS 190
-#define OID_IP_ADDR_BLOCKS 192
-#define OID_POLICY_QUALIFIER_CPS 194
-#define OID_POLICY_QUALIFIER_UNOTICE 195
-#define OID_SERVER_AUTH 197
-#define OID_CLIENT_AUTH 198
-#define OID_OCSP_SIGNING 205
-#define OID_XMPP_ADDR 207
-#define OID_AUTHENTICATION_INFO 209
-#define OID_ACCESS_IDENTITY 210
-#define OID_CHARGING_IDENTITY 211
-#define OID_GROUP 212
-#define OID_OCSP 215
-#define OID_BASIC 216
-#define OID_NONCE 217
-#define OID_CRL 218
-#define OID_RESPONSE 219
-#define OID_NO_CHECK 220
-#define OID_ARCHIVE_CUTOFF 221
-#define OID_SERVICE_LOCATOR 222
-#define OID_CA_ISSUERS 223
-#define OID_DES_CBC 229
-#define OID_SHA1 230
-#define OID_SHA1_WITH_RSA_OIW 231
-#define OID_ECGDSA_PUBKEY 250
-#define OID_ECGDSA_SIG_WITH_RIPEMD160 253
-#define OID_ECGDSA_SIG_WITH_SHA1 254
-#define OID_ECGDSA_SIG_WITH_SHA224 255
-#define OID_ECGDSA_SIG_WITH_SHA256 256
-#define OID_ECGDSA_SIG_WITH_SHA384 257
-#define OID_ECGDSA_SIG_WITH_SHA512 258
-#define OID_SECT163K1 281
-#define OID_SECT163R1 282
-#define OID_SECT239K1 283
-#define OID_SECT113R1 284
-#define OID_SECT113R2 285
-#define OID_SECT112R1 286
-#define OID_SECT112R2 287
-#define OID_SECT160R1 288
-#define OID_SECT160K1 289
-#define OID_SECT256K1 290
-#define OID_SECT163R2 291
-#define OID_SECT283K1 292
-#define OID_SECT283R1 293
-#define OID_SECT131R1 294
-#define OID_SECT131R2 295
-#define OID_SECT193R1 296
-#define OID_SECT193R2 297
-#define OID_SECT233K1 298
-#define OID_SECT233R1 299
-#define OID_SECT128R1 300
-#define OID_SECT128R2 301
-#define OID_SECT160R2 302
-#define OID_SECT192K1 303
-#define OID_SECT224K1 304
-#define OID_SECT224R1 305
-#define OID_SECT384R1 306
-#define OID_SECT521R1 307
-#define OID_SECT409K1 308
-#define OID_SECT409R1 309
-#define OID_SECT571K1 310
-#define OID_SECT571R1 311
-#define OID_AES128_CBC 320
-#define OID_AES128_GCM 321
-#define OID_AES128_CCM 322
-#define OID_AES192_CBC 323
-#define OID_AES192_GCM 324
-#define OID_AES192_CCM 325
-#define OID_AES256_CBC 326
-#define OID_AES256_GCM 327
-#define OID_AES256_CCM 328
-#define OID_SHA256 330
-#define OID_SHA384 331
-#define OID_SHA512 332
-#define OID_SHA224 333
-#define OID_NS_REVOCATION_URL 339
-#define OID_NS_CA_REVOCATION_URL 340
-#define OID_NS_CA_POLICY_URL 341
-#define OID_NS_COMMENT 342
-#define OID_EMPLOYEE_NUMBER 345
-#define OID_PKI_MESSAGE_TYPE 351
-#define OID_PKI_STATUS 352
-#define OID_PKI_FAIL_INFO 353
-#define OID_PKI_SENDER_NONCE 354
-#define OID_PKI_RECIPIENT_NONCE 355
-#define OID_PKI_TRANS_ID 356
+#define OID_RSAES_OAEP 93
+#define OID_SHA256_WITH_RSA 95
+#define OID_SHA384_WITH_RSA 96
+#define OID_SHA512_WITH_RSA 97
+#define OID_SHA224_WITH_RSA 98
+#define OID_PKCS7_DATA 100
+#define OID_PKCS7_SIGNED_DATA 101
+#define OID_PKCS7_ENVELOPED_DATA 102
+#define OID_PKCS7_SIGNED_ENVELOPED_DATA 103
+#define OID_PKCS7_DIGESTED_DATA 104
+#define OID_PKCS7_ENCRYPTED_DATA 105
+#define OID_EMAIL_ADDRESS 107
+#define OID_UNSTRUCTURED_NAME 108
+#define OID_PKCS9_CONTENT_TYPE 109
+#define OID_PKCS9_MESSAGE_DIGEST 110
+#define OID_PKCS9_SIGNING_TIME 111
+#define OID_CHALLENGE_PASSWORD 113
+#define OID_UNSTRUCTURED_ADDRESS 114
+#define OID_EXTENSION_REQUEST 115
+#define OID_MD2 118
+#define OID_MD5 119
+#define OID_3DES_EDE_CBC 121
+#define OID_EC_PUBLICKEY 125
+#define OID_C2PNB163V1 128
+#define OID_C2PNB163V2 129
+#define OID_C2PNB163V3 130
+#define OID_C2PNB176W1 131
+#define OID_C2PNB191V1 132
+#define OID_C2PNB191V2 133
+#define OID_C2PNB191V3 134
+#define OID_C2PNB191V4 135
+#define OID_C2PNB191V5 136
+#define OID_C2PNB208W1 137
+#define OID_C2PNB239V1 138
+#define OID_C2PNB239V2 139
+#define OID_C2PNB239V3 140
+#define OID_C2PNB239V4 141
+#define OID_C2PNB239V5 142
+#define OID_C2PNB272W1 143
+#define OID_C2PNB304W1 144
+#define OID_C2PNB359V1 145
+#define OID_C2PNB368W1 146
+#define OID_C2PNB431R1 147
+#define OID_PRIME192V1 149
+#define OID_PRIME192V2 150
+#define OID_PRIME192V3 151
+#define OID_PRIME239V1 152
+#define OID_PRIME239V2 153
+#define OID_PRIME239V3 154
+#define OID_PRIME256V1 155
+#define OID_ECDSA_WITH_SHA1 157
+#define OID_ECDSA_WITH_SHA224 159
+#define OID_ECDSA_WITH_SHA256 160
+#define OID_ECDSA_WITH_SHA384 161
+#define OID_ECDSA_WITH_SHA512 162
+#define OID_USER_PRINCIPAL_NAME 177
+#define OID_STRONGSWAN 180
+#define OID_TCGID 187
+#define OID_AUTHORITY_INFO_ACCESS 192
+#define OID_IP_ADDR_BLOCKS 194
+#define OID_POLICY_QUALIFIER_CPS 196
+#define OID_POLICY_QUALIFIER_UNOTICE 197
+#define OID_SERVER_AUTH 199
+#define OID_CLIENT_AUTH 200
+#define OID_OCSP_SIGNING 207
+#define OID_XMPP_ADDR 209
+#define OID_AUTHENTICATION_INFO 211
+#define OID_ACCESS_IDENTITY 212
+#define OID_CHARGING_IDENTITY 213
+#define OID_GROUP 214
+#define OID_OCSP 217
+#define OID_BASIC 218
+#define OID_NONCE 219
+#define OID_CRL 220
+#define OID_RESPONSE 221
+#define OID_NO_CHECK 222
+#define OID_ARCHIVE_CUTOFF 223
+#define OID_SERVICE_LOCATOR 224
+#define OID_CA_ISSUERS 225
+#define OID_DES_CBC 231
+#define OID_SHA1 232
+#define OID_SHA1_WITH_RSA_OIW 233
+#define OID_ECGDSA_PUBKEY 252
+#define OID_ECGDSA_SIG_WITH_RIPEMD160 255
+#define OID_ECGDSA_SIG_WITH_SHA1 256
+#define OID_ECGDSA_SIG_WITH_SHA224 257
+#define OID_ECGDSA_SIG_WITH_SHA256 258
+#define OID_ECGDSA_SIG_WITH_SHA384 259
+#define OID_ECGDSA_SIG_WITH_SHA512 260
+#define OID_SECT163K1 283
+#define OID_SECT163R1 284
+#define OID_SECT239K1 285
+#define OID_SECT113R1 286
+#define OID_SECT113R2 287
+#define OID_SECT112R1 288
+#define OID_SECT112R2 289
+#define OID_SECT160R1 290
+#define OID_SECT160K1 291
+#define OID_SECT256K1 292
+#define OID_SECT163R2 293
+#define OID_SECT283K1 294
+#define OID_SECT283R1 295
+#define OID_SECT131R1 296
+#define OID_SECT131R2 297
+#define OID_SECT193R1 298
+#define OID_SECT193R2 299
+#define OID_SECT233K1 300
+#define OID_SECT233R1 301
+#define OID_SECT128R1 302
+#define OID_SECT128R2 303
+#define OID_SECT160R2 304
+#define OID_SECT192K1 305
+#define OID_SECT224K1 306
+#define OID_SECT224R1 307
+#define OID_SECT384R1 308
+#define OID_SECT521R1 309
+#define OID_SECT409K1 310
+#define OID_SECT409R1 311
+#define OID_SECT571K1 312
+#define OID_SECT571R1 313
+#define OID_AES128_CBC 322
+#define OID_AES128_GCM 323
+#define OID_AES128_CCM 324
+#define OID_AES192_CBC 325
+#define OID_AES192_GCM 326
+#define OID_AES192_CCM 327
+#define OID_AES256_CBC 328
+#define OID_AES256_GCM 329
+#define OID_AES256_CCM 330
+#define OID_SHA256 332
+#define OID_SHA384 333
+#define OID_SHA512 334
+#define OID_SHA224 335
+#define OID_NS_REVOCATION_URL 341
+#define OID_NS_CA_REVOCATION_URL 342
+#define OID_NS_CA_POLICY_URL 343
+#define OID_NS_COMMENT 344
+#define OID_EMPLOYEE_NUMBER 347
+#define OID_PKI_MESSAGE_TYPE 353
+#define OID_PKI_STATUS 354
+#define OID_PKI_FAIL_INFO 355
+#define OID_PKI_SENDER_NONCE 356
+#define OID_PKI_RECIPIENT_NONCE 357
+#define OID_PKI_TRANS_ID 358
+#define OID_TPM_MANUFACTURER 364
+#define OID_TPM_MODEL 365
+#define OID_TPM_VERSION 366
+#define OID_TPM_ID_LABEL 367
-#define OID_MAX 359
+#define OID_MAX 368
#endif /* OID_H_ */
diff --git a/src/libstrongswan/asn1/oid.txt b/src/libstrongswan/asn1/oid.txt
index e2931c7dd..f16287cb2 100644
--- a/src/libstrongswan/asn1/oid.txt
+++ b/src/libstrongswan/asn1/oid.txt
@@ -91,6 +91,8 @@
0x02 "md2WithRSAEncryption" OID_MD2_WITH_RSA
0x04 "md5WithRSAEncryption" OID_MD5_WITH_RSA
0x05 "sha-1WithRSAEncryption" OID_SHA1_WITH_RSA
+ 0x07 "id-RSAES-OAEP" OID_RSAES_OAEP
+ 0x09 "id-pSpecified"
0x0B "sha256WithRSAEncryption" OID_SHA256_WITH_RSA
0x0C "sha384WithRSAEncryption" OID_SHA384_WITH_RSA
0x0D "sha512WithRSAEncryption" OID_SHA512_WITH_RSA
@@ -110,7 +112,7 @@
0x05 "signingTime" OID_PKCS9_SIGNING_TIME
0x06 "counterSignature"
0x07 "challengePassword" OID_CHALLENGE_PASSWORD
- 0x08 "unstructuredAddress"
+ 0x08 "unstructuredAddress" OID_UNSTRUCTURED_ADDRESS
0x0E "extensionRequest" OID_EXTENSION_REQUEST
0x0F "S/MIME Capabilities"
0x02 "digestAlgorithm"
@@ -356,4 +358,11 @@
0x06 "recipientNonce" OID_PKI_RECIPIENT_NONCE
0x07 "transID" OID_PKI_TRANS_ID
0x08 "extensionReq"
-
+0x67 ""
+ 0x81 ""
+ 0x05 ""
+ 0x02 "tcg-attribute"
+ 0x01 "tcg-at-tpmManufacturer" OID_TPM_MANUFACTURER
+ 0x02 "tcg-at-tpmModel" OID_TPM_MODEL
+ 0x03 "tcg-at-tpmVersion" OID_TPM_VERSION
+ 0x0F "tcg-at-tpmIdLabel" OID_TPM_ID_LABEL
diff --git a/src/libstrongswan/chunk.h b/src/libstrongswan/chunk.h
index f94bdfbf2..63644ac78 100644
--- a/src/libstrongswan/chunk.h
+++ b/src/libstrongswan/chunk.h
@@ -175,7 +175,7 @@ static inline void chunk_clear(chunk_t *chunk)
{
if (chunk->ptr)
{
- memset(chunk->ptr, 0, chunk->len);
+ memwipe(chunk->ptr, chunk->len);
chunk_free(chunk);
}
}
diff --git a/src/libstrongswan/credentials/cred_encoding.c b/src/libstrongswan/credentials/cred_encoding.c
index edd76205b..ac3266f4c 100644
--- a/src/libstrongswan/credentials/cred_encoding.c
+++ b/src/libstrongswan/credentials/cred_encoding.c
@@ -180,8 +180,13 @@ static bool encode(private_cred_encoding_t *this, cred_encoding_type_t type,
chunk = malloc_thing(chunk_t);
*chunk = *encoding;
this->lock->write_lock(this->lock);
- this->cache[type]->put(this->cache[type], cache, chunk);
+ chunk = this->cache[type]->put(this->cache[type], cache, chunk);
this->lock->unlock(this->lock);
+ if (chunk)
+ {
+ free(chunk->ptr);
+ free(chunk);
+ }
}
return success;
}
diff --git a/src/libstrongswan/credentials/ietf_attributes/ietf_attributes.c b/src/libstrongswan/credentials/ietf_attributes/ietf_attributes.c
index de5b85bae..fecc9910e 100644
--- a/src/libstrongswan/credentials/ietf_attributes/ietf_attributes.c
+++ b/src/libstrongswan/credentials/ietf_attributes/ietf_attributes.c
@@ -189,11 +189,11 @@ static char* get_string(private_ietf_attributes_t *this)
if (oid == OID_UNKNOWN)
{
- written = snprintf(pos, len, "0x#B", &attr->value);
+ written = snprintf(pos, len, "0x%#B", &attr->value);
}
else
{
- written = snprintf(pos, len, "%s", oid_names[oid]);
+ written = snprintf(pos, len, "%s", oid_names[oid].name);
}
break;
}
@@ -331,7 +331,7 @@ static bool matches(private_ietf_attributes_t *this, private_ietf_attributes_t *
/* look for at least one common attribute */
while (TRUE)
{
- bool cmp = attr_a->compare(attr_a, attr_b);
+ int cmp = attr_a->compare(attr_a, attr_b);
if (cmp == 0)
{
diff --git a/src/libstrongswan/crypto/crypto_tester.c b/src/libstrongswan/crypto/crypto_tester.c
index 276f4329a..4635dccea 100644
--- a/src/libstrongswan/crypto/crypto_tester.c
+++ b/src/libstrongswan/crypto/crypto_tester.c
@@ -247,7 +247,7 @@ METHOD(crypto_tester_t, test_crypter, bool,
{
DBG1(DBG_LIB,"disable %N[%s]: no key size supported",
encryption_algorithm_names, alg, plugin_name);
- return FALSE;
+ return FALSE;
}
else
{
@@ -263,7 +263,7 @@ METHOD(crypto_tester_t, test_crypter, bool,
{
*speed = bench_crypter(this, alg, create);
DBG1(DBG_LIB, "enabled %N[%s]: passed %u test vectors, %d points",
- encryption_algorithm_names, alg, tested, plugin_name, *speed);
+ encryption_algorithm_names, alg, plugin_name, tested, *speed);
}
else
{
@@ -417,7 +417,7 @@ METHOD(crypto_tester_t, test_aead, bool,
{
DBG1(DBG_LIB,"disable %N[%s]: no key size supported",
encryption_algorithm_names, alg, plugin_name);
- return FALSE;
+ return FALSE;
}
else
{
diff --git a/src/libstrongswan/crypto/crypto_tester.h b/src/libstrongswan/crypto/crypto_tester.h
index 019c87c39..9ac665929 100644
--- a/src/libstrongswan/crypto/crypto_tester.h
+++ b/src/libstrongswan/crypto/crypto_tester.h
@@ -72,7 +72,7 @@ struct aead_test_vector_t {
struct signer_test_vector_t {
/** signer algorithm this test vector tests */
- pseudo_random_function_t alg;
+ integrity_algorithm_t alg;
/** key to use, with a length the algorithm expects */
u_char *key;
/** size of the input data */
diff --git a/src/libstrongswan/crypto/proposal/proposal_keywords.c b/src/libstrongswan/crypto/proposal/proposal_keywords.c
index 10ab9fc23..d65955a2e 100644
--- a/src/libstrongswan/crypto/proposal/proposal_keywords.c
+++ b/src/libstrongswan/crypto/proposal/proposal_keywords.c
@@ -59,12 +59,12 @@ struct proposal_token {
u_int16_t keysize;
};
-#define TOTAL_KEYWORDS 117
+#define TOTAL_KEYWORDS 119
#define MIN_WORD_LENGTH 3
#define MAX_WORD_LENGTH 17
#define MIN_HASH_VALUE 9
-#define MAX_HASH_VALUE 209
-/* maximum key range = 201, duplicates = 0 */
+#define MAX_HASH_VALUE 213
+/* maximum key range = 205, duplicates = 0 */
#ifdef __GNUC__
__inline
@@ -80,32 +80,32 @@ hash (str, len)
{
static const unsigned char asso_values[] =
{
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 16, 9,
- 4, 41, 66, 19, 8, 4, 5, 3, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 122, 210, 3, 22, 21,
- 3, 111, 103, 48, 7, 4, 210, 210, 3, 210,
- 57, 3, 210, 210, 78, 6, 3, 28, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210
+ 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
+ 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
+ 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
+ 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
+ 214, 214, 214, 214, 214, 214, 214, 214, 14, 9,
+ 4, 34, 66, 19, 8, 4, 5, 3, 214, 214,
+ 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
+ 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
+ 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
+ 214, 214, 214, 214, 214, 131, 214, 3, 22, 21,
+ 3, 1, 101, 48, 3, 4, 214, 214, 3, 214,
+ 57, 4, 214, 214, 94, 6, 3, 32, 214, 214,
+ 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
+ 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
+ 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
+ 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
+ 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
+ 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
+ 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
+ 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
+ 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
+ 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
+ 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
+ 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
+ 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
+ 214, 214, 214, 214, 214, 214, 214
};
register int hval = len;
@@ -143,14 +143,19 @@ hash (str, len)
static const struct proposal_token wordlist[] =
{
{"sha", INTEGRITY_ALGORITHM, AUTH_HMAC_SHA1_96, 0},
+ {"des", ENCRYPTION_ALGORITHM, ENCR_DES, 0},
{"null", ENCRYPTION_ALGORITHM, ENCR_NULL, 0},
{"sha1", INTEGRITY_ALGORITHM, AUTH_HMAC_SHA1_96, 0},
+ {"serpent", ENCRYPTION_ALGORITHM, ENCR_SERPENT_CBC, 128},
{"camellia", ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CBC, 128},
{"sha512", INTEGRITY_ALGORITHM, AUTH_HMAC_SHA2_512_256, 0},
+ {"serpent192", ENCRYPTION_ALGORITHM, ENCR_SERPENT_CBC, 192},
+ {"serpent128", ENCRYPTION_ALGORITHM, ENCR_SERPENT_CBC, 128},
{"camellia192", ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CBC, 192},
{"cast128", ENCRYPTION_ALGORITHM, ENCR_CAST, 128},
{"camellia128", ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CBC, 128},
{"aes", ENCRYPTION_ALGORITHM, ENCR_AES_CBC, 128},
+ {"serpent256", ENCRYPTION_ALGORITHM, ENCR_SERPENT_CBC, 256},
{"aes192", ENCRYPTION_ALGORITHM, ENCR_AES_CBC, 192},
{"sha256", INTEGRITY_ALGORITHM, AUTH_HMAC_SHA2_256_128, 0},
{"aes128", ENCRYPTION_ALGORITHM, ENCR_AES_CBC, 128},
@@ -209,81 +214,79 @@ static const struct proposal_token wordlist[] =
{"aes128gcm16", ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV16, 128},
{"camellia192ccm64", ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CCM_ICV8, 192},
{"camellia128ccm64", ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CCM_ICV8, 128},
- {"camellia192ctr", ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CTR, 192},
- {"camellia128ctr", ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CTR, 128},
{"modp1024s160", DIFFIE_HELLMAN_GROUP, MODP_1024_160, 0},
+ {"modp3072", DIFFIE_HELLMAN_GROUP, MODP_3072_BIT, 0},
{"aes256gcm8", ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV8, 256},
{"aes256gcm96", ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV12, 256},
{"aes256gcm12", ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV12, 256},
- {"modp3072", DIFFIE_HELLMAN_GROUP, MODP_3072_BIT, 0},
- {"aes256gcm128", ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV16, 256},
{"ecp192", DIFFIE_HELLMAN_GROUP, ECP_192_BIT, 0},
+ {"aes256gcm128", ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV16, 256},
+ {"modp1536", DIFFIE_HELLMAN_GROUP, MODP_1536_BIT, 0},
{"aes256gcm16", ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV16, 256},
{"camellia256ccm64", ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CCM_ICV8, 256},
- {"des", ENCRYPTION_ALGORITHM, ENCR_DES, 0},
- {"camellia256ctr", ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CTR, 256},
{"ecp521", DIFFIE_HELLMAN_GROUP, ECP_521_BIT, 0},
- {"modp1536", DIFFIE_HELLMAN_GROUP, MODP_1536_BIT, 0},
+ {"camellia192ctr", ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CTR, 192},
+ {"camellia128ctr", ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CTR, 128},
+ {"noesn", EXTENDED_SEQUENCE_NUMBERS, NO_EXT_SEQ_NUMBERS, 0},
{"aes192gmac", ENCRYPTION_ALGORITHM, ENCR_NULL_AUTH_AES_GMAC, 192},
{"aes128gmac", ENCRYPTION_ALGORITHM, ENCR_NULL_AUTH_AES_GMAC, 128},
- {"serpent", ENCRYPTION_ALGORITHM, ENCR_SERPENT_CBC, 128},
{"modpnull", DIFFIE_HELLMAN_GROUP, MODP_NULL, 0},
{"aes192ccm64", ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV8, 192},
{"aes128ccm64", ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV8, 128},
- {"aes192ctr", ENCRYPTION_ALGORITHM, ENCR_AES_CTR, 192},
- {"aes128ctr", ENCRYPTION_ALGORITHM, ENCR_AES_CTR, 128},
- {"serpent192", ENCRYPTION_ALGORITHM, ENCR_SERPENT_CBC, 192},
{"ecp256", DIFFIE_HELLMAN_GROUP, ECP_256_BIT, 0},
- {"serpent128", ENCRYPTION_ALGORITHM, ENCR_SERPENT_CBC, 128},
+ {"camellia256ctr", ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CTR, 256},
+ {"blowfish", ENCRYPTION_ALGORITHM, ENCR_BLOWFISH, 128},
{"modp2048", DIFFIE_HELLMAN_GROUP, MODP_2048_BIT, 0},
{"aes256gmac", ENCRYPTION_ALGORITHM, ENCR_NULL_AUTH_AES_GMAC, 256},
{"modp4096", DIFFIE_HELLMAN_GROUP, MODP_4096_BIT, 0},
- {"serpent256", ENCRYPTION_ALGORITHM, ENCR_SERPENT_CBC, 256},
{"modp1024", DIFFIE_HELLMAN_GROUP, MODP_1024_BIT, 0},
- {"blowfish", ENCRYPTION_ALGORITHM, ENCR_BLOWFISH, 128},
- {"sha2_512", INTEGRITY_ALGORITHM, AUTH_HMAC_SHA2_512_256, 0},
- {"aes256ccm64", ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV8, 256},
{"blowfish192", ENCRYPTION_ALGORITHM, ENCR_BLOWFISH, 192},
- {"aes256ctr", ENCRYPTION_ALGORITHM, ENCR_AES_CTR, 256},
+ {"aes256ccm64", ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV8, 256},
{"blowfish128", ENCRYPTION_ALGORITHM, ENCR_BLOWFISH, 128},
+ {"aes192ctr", ENCRYPTION_ALGORITHM, ENCR_AES_CTR, 192},
+ {"aes128ctr", ENCRYPTION_ALGORITHM, ENCR_AES_CTR, 128},
{"modp2048s256", DIFFIE_HELLMAN_GROUP, MODP_2048_256, 0},
+ {"sha2_512", INTEGRITY_ALGORITHM, AUTH_HMAC_SHA2_512_256, 0},
{"aes192gcm64", ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV8, 192},
{"aes128gcm64", ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV8, 128},
+ {"esn", EXTENDED_SEQUENCE_NUMBERS, EXT_SEQ_NUMBERS, 0},
+ {"aes256ctr", ENCRYPTION_ALGORITHM, ENCR_AES_CTR, 256},
+ {"blowfish256", ENCRYPTION_ALGORITHM, ENCR_BLOWFISH, 256},
{"sha2_256", INTEGRITY_ALGORITHM, AUTH_HMAC_SHA2_256_128, 0},
{"sha256_96", INTEGRITY_ALGORITHM, AUTH_HMAC_SHA2_256_96, 0},
- {"sha2_256_96", INTEGRITY_ALGORITHM, AUTH_HMAC_SHA2_256_96, 0},
- {"blowfish256", ENCRYPTION_ALGORITHM, ENCR_BLOWFISH, 256},
{"aes256gcm64", ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV8, 256},
+ {"sha2_256_96", INTEGRITY_ALGORITHM, AUTH_HMAC_SHA2_256_96, 0},
{"ecp224", DIFFIE_HELLMAN_GROUP, ECP_224_BIT, 0},
{"ecp384", DIFFIE_HELLMAN_GROUP, ECP_384_BIT, 0},
- {"sha2_384", INTEGRITY_ALGORITHM, AUTH_HMAC_SHA2_384_192, 0},
{"modp6144", DIFFIE_HELLMAN_GROUP, MODP_6144_BIT, 0},
- {"modp2048s224", DIFFIE_HELLMAN_GROUP, MODP_2048_224, 0}
+ {"modp2048s224", DIFFIE_HELLMAN_GROUP, MODP_2048_224, 0},
+ {"sha2_384", INTEGRITY_ALGORITHM, AUTH_HMAC_SHA2_384_192, 0}
};
static const short lookup[] =
{
-1, -1, -1, -1, -1, -1, -1, -1, -1, 0,
- 1, -1, -1, -1, -1, -1, 2, -1, -1, -1,
- -1, 3, 4, -1, -1, -1, -1, -1, 5, 6,
- 7, 8, -1, -1, -1, 9, 10, 11, 12, 13,
- 14, 15, 16, 17, 18, 19, 20, 21, 22, -1,
- -1, -1, -1, 23, 24, 25, 26, 27, 28, 29,
- 30, -1, 31, -1, 32, 33, 34, 35, 36, 37,
- 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
- 48, -1, 49, -1, 50, -1, 51, -1, 52, -1,
- 53, -1, 54, 55, 56, 57, 58, 59, 60, 61,
- 62, 63, 64, 65, 66, 67, 68, 69, -1, 70,
- -1, 71, -1, 72, 73, 74, 75, 76, -1, 77,
- 78, 79, 80, 81, -1, 82, 83, 84, 85, -1,
- -1, 86, 87, 88, 89, 90, 91, 92, -1, -1,
- 93, 94, 95, 96, 97, 98, 99, 100, 101, 102,
- 103, 104, -1, -1, -1, -1, -1, -1, 105, 106,
- 107, 108, -1, -1, -1, -1, 109, -1, 110, -1,
- -1, -1, -1, -1, 111, -1, -1, -1, -1, 112,
- 113, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 1, 2, -1, -1, -1, -1, 3, 4, -1, -1,
+ -1, 5, 6, -1, -1, 7, -1, 8, 9, 10,
+ 11, 12, -1, 13, -1, 14, 15, 16, 17, 18,
+ 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
+ -1, -1, -1, -1, 29, 30, 31, 32, 33, 34,
+ 35, -1, 36, -1, 37, 38, 39, 40, 41, 42,
+ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
+ 53, -1, 54, -1, 55, -1, 56, -1, 57, -1,
+ 58, -1, 59, 60, 61, 62, 63, 64, 65, 66,
+ 67, 68, 69, 70, 71, 72, -1, 73, -1, 74,
+ -1, 75, -1, 76, 77, 78, 79, 80, -1, 81,
+ 82, 83, 84, 85, -1, 86, 87, -1, 88, -1,
+ -1, 89, 90, -1, 91, -1, -1, 92, -1, 93,
+ 94, 95, 96, -1, 97, -1, 98, 99, 100, 101,
+ 102, 103, -1, -1, -1, 104, -1, -1, 105, 106,
+ -1, 107, -1, -1, -1, 108, 109, -1, -1, 110,
+ 111, -1, -1, -1, 112, 113, -1, 114, 115, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 114, 115, -1, -1, -1, 116
+ -1, -1, -1, -1, -1, 116, -1, -1, -1, 117,
+ -1, -1, -1, 118
};
#ifdef __GNUC__
diff --git a/src/libstrongswan/crypto/proposal/proposal_keywords.txt b/src/libstrongswan/crypto/proposal/proposal_keywords.txt
index 208c6715b..4ef664d8f 100644
--- a/src/libstrongswan/crypto/proposal/proposal_keywords.txt
+++ b/src/libstrongswan/crypto/proposal/proposal_keywords.txt
@@ -146,3 +146,5 @@ ecp521, DIFFIE_HELLMAN_GROUP, ECP_521_BIT, 0
modp1024s160, DIFFIE_HELLMAN_GROUP, MODP_1024_160, 0
modp2048s224, DIFFIE_HELLMAN_GROUP, MODP_2048_224, 0
modp2048s256, DIFFIE_HELLMAN_GROUP, MODP_2048_256, 0
+noesn, EXTENDED_SEQUENCE_NUMBERS, NO_EXT_SEQ_NUMBERS, 0
+esn, EXTENDED_SEQUENCE_NUMBERS, EXT_SEQ_NUMBERS, 0
diff --git a/src/libstrongswan/crypto/transform.c b/src/libstrongswan/crypto/transform.c
index cec90a616..1e108f1de 100644
--- a/src/libstrongswan/crypto/transform.c
+++ b/src/libstrongswan/crypto/transform.c
@@ -28,3 +28,8 @@ ENUM_NEXT(transform_type_names, ENCRYPTION_ALGORITHM, EXTENDED_SEQUENCE_NUMBERS,
"EXTENDED_SEQUENCE_NUMBERS");
ENUM_END(transform_type_names, EXTENDED_SEQUENCE_NUMBERS);
+
+ENUM(extended_sequence_numbers_names, NO_EXT_SEQ_NUMBERS, EXT_SEQ_NUMBERS,
+ "NO_EXT_SEQ",
+ "EXT_SEQ",
+);
diff --git a/src/libstrongswan/crypto/transform.h b/src/libstrongswan/crypto/transform.h
index 1a2660199..1393c674c 100644
--- a/src/libstrongswan/crypto/transform.h
+++ b/src/libstrongswan/crypto/transform.h
@@ -45,4 +45,17 @@ enum transform_type_t {
*/
extern enum_name_t *transform_type_names;
+/**
+ * Extended sequence numbers, as in IKEv2 RFC 3.3.2.
+ */
+enum extended_sequence_numbers_t {
+ NO_EXT_SEQ_NUMBERS = 0,
+ EXT_SEQ_NUMBERS = 1
+};
+
+/**
+ * enum strings for extended_sequence_numbers_t.
+ */
+extern enum_name_t *extended_sequence_numbers_names;
+
#endif /** TRANSFORM_H_ @}*/
diff --git a/src/libstrongswan/eap/eap.c b/src/libstrongswan/eap/eap.c
index 71734017a..11b475d8f 100644
--- a/src/libstrongswan/eap/eap.c
+++ b/src/libstrongswan/eap/eap.c
@@ -44,11 +44,15 @@ ENUM_NEXT(eap_type_names, EAP_TTLS, EAP_TTLS, EAP_SIM,
"EAP_TTLS");
ENUM_NEXT(eap_type_names, EAP_AKA, EAP_AKA, EAP_TTLS,
"EAP_AKA");
-ENUM_NEXT(eap_type_names, EAP_MSCHAPV2, EAP_MSCHAPV2, EAP_AKA,
+ENUM_NEXT(eap_type_names, EAP_PEAP, EAP_MSCHAPV2, EAP_AKA,
+ "EAP_PEAP",
"EAP_MSCHAPV2");
-ENUM_NEXT(eap_type_names, EAP_TNC, EAP_TNC, EAP_MSCHAPV2,
+ENUM_NEXT(eap_type_names, EAP_MSTLV, EAP_MSTLV, EAP_MSCHAPV2,
+ "EAP_MSTLV");
+ENUM_NEXT(eap_type_names, EAP_TNC, EAP_TNC, EAP_MSTLV,
"EAP_TNC");
-ENUM_NEXT(eap_type_names, EAP_RADIUS, EAP_EXPERIMENTAL, EAP_TNC,
+ENUM_NEXT(eap_type_names, EAP_DYNAMIC, EAP_EXPERIMENTAL, EAP_TNC,
+ "EAP_DYNAMIC",
"EAP_RADIUS",
"EAP_EXPANDED",
"EAP_EXPERIMENTAL");
@@ -69,11 +73,15 @@ ENUM_NEXT(eap_type_short_names, EAP_TTLS, EAP_TTLS, EAP_SIM,
"TTLS");
ENUM_NEXT(eap_type_short_names, EAP_AKA, EAP_AKA, EAP_TTLS,
"AKA");
-ENUM_NEXT(eap_type_short_names, EAP_MSCHAPV2, EAP_MSCHAPV2, EAP_AKA,
+ENUM_NEXT(eap_type_short_names, EAP_PEAP, EAP_MSCHAPV2, EAP_AKA,
+ "PEAP",
"MSCHAPV2");
-ENUM_NEXT(eap_type_short_names, EAP_TNC, EAP_TNC, EAP_MSCHAPV2,
+ENUM_NEXT(eap_type_short_names, EAP_MSTLV, EAP_MSTLV, EAP_MSCHAPV2,
+ "MSTLV");
+ENUM_NEXT(eap_type_short_names, EAP_TNC, EAP_TNC, EAP_MSTLV,
"TNC");
-ENUM_NEXT(eap_type_short_names, EAP_RADIUS, EAP_EXPERIMENTAL, EAP_TNC,
+ENUM_NEXT(eap_type_short_names, EAP_DYNAMIC, EAP_EXPERIMENTAL, EAP_TNC,
+ "DYN",
"RAD",
"EXP",
"XP");
@@ -115,6 +123,7 @@ eap_type_t eap_type_from_string(char *name)
{"ttls", EAP_TTLS},
{"sim", EAP_SIM},
{"aka", EAP_AKA},
+ {"peap", EAP_PEAP},
{"mschapv2", EAP_MSCHAPV2},
{"tnc", EAP_TNC},
{"radius", EAP_RADIUS},
diff --git a/src/libstrongswan/eap/eap.h b/src/libstrongswan/eap/eap.h
index e98a3a211..945e4bc59 100644
--- a/src/libstrongswan/eap/eap.h
+++ b/src/libstrongswan/eap/eap.h
@@ -60,8 +60,12 @@ enum eap_type_t {
EAP_SIM = 18,
EAP_TTLS = 21,
EAP_AKA = 23,
+ EAP_PEAP = 25,
EAP_MSCHAPV2 = 26,
+ EAP_MSTLV = 33,
EAP_TNC = 38,
+ /** select EAP method dynamically based on i.e. EAP-Identity */
+ EAP_DYNAMIC = 252,
/** not a method, but an implementation providing different methods */
EAP_RADIUS = 253,
EAP_EXPANDED = 254,
@@ -79,6 +83,17 @@ extern enum_name_t *eap_type_names;
extern enum_name_t *eap_type_short_names;
/**
+ * EAP packet format
+ */
+typedef struct __attribute__((packed)) {
+ u_int8_t code;
+ u_int8_t identifier;
+ u_int16_t length;
+ u_int8_t type;
+ u_int8_t data;
+} eap_packet_t;
+
+/**
* Lookup the EAP method type from a string.
*
* @param name EAP method name (such as "md5", "aka")
diff --git a/src/libstrongswan/fetcher/fetcher.c b/src/libstrongswan/fetcher/fetcher.c
new file mode 100644
index 000000000..ca5a72165
--- /dev/null
+++ b/src/libstrongswan/fetcher/fetcher.c
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2011 Martin Willi
+ * Copyright (C) 2011 revosec AG
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+#include "fetcher.h"
+
+/**
+ * See header.
+ */
+bool fetcher_default_callback(void *userdata, chunk_t chunk)
+{
+ chunk_t *accu = userdata;
+
+ accu->ptr = realloc(accu->ptr, accu->len + chunk.len);
+ if (accu->ptr)
+ {
+ memcpy(&accu->ptr[accu->len], chunk.ptr, chunk.len);
+ accu->len += chunk.len;
+ return TRUE;
+ }
+ return FALSE;
+}
diff --git a/src/libstrongswan/fetcher/fetcher.h b/src/libstrongswan/fetcher/fetcher.h
index f312206bb..5b734da3d 100644
--- a/src/libstrongswan/fetcher/fetcher.h
+++ b/src/libstrongswan/fetcher/fetcher.h
@@ -1,6 +1,7 @@
/*
- * Copyright (C) 2008 Martin Willi
+ * Copyright (C) 2008-2011 Martin Willi
* Hochschule fuer Technik Rapperswil
+ * Copyright (C) 2011 revosec AG
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -25,6 +26,23 @@ typedef struct fetcher_t fetcher_t;
typedef enum fetcher_option_t fetcher_option_t;
#include <stdarg.h>
+#include <chunk.h>
+
+/**
+ * Constructor function which creates fetcher instances.
+ *
+ * @return fetcher instance
+ */
+typedef fetcher_t* (*fetcher_constructor_t)();
+
+/**
+ * Callback function used with FETCH_CALLBACK.
+ *
+ * @param userdata userdata passed to fetcher_t.fetch()
+ * @param chunk chunk with next chunk of data
+ * @return TRUE to continue with transfer, FALSE to abort
+ */
+typedef bool (*fetcher_callback_t)(void *userdata, chunk_t chunk);
#include <library.h>
@@ -64,19 +82,20 @@ enum fetcher_option_t {
FETCH_TIMEOUT,
/**
+ * Callback to invoke with each chunk of data.
+ * Additional argument fetch_callback_t.
+ * If this option is not given, the fetcher_default_callback is used,
+ * which accumulates the data into an allocated chunk.
+ */
+ FETCH_CALLBACK,
+
+ /**
* end of fetching options
*/
FETCH_END,
};
/**
- * Constructor function which creates fetcher instances.
- *
- * @return fetcher instance
- */
-typedef fetcher_t* (*fetcher_constructor_t)();
-
-/**
* Fetcher interface, an implementation fetches data from an URL.
*/
struct fetcher_t {
@@ -87,15 +106,18 @@ struct fetcher_t {
* The fetcher returns NOT_SUPPORTED to indicate that it is uncappable
* to handle such URLs. Other return values indicate a failure, and
* fetching of that URL gets cancelled.
+ * If no FETCH_CALLBACK function is set as option, userdata must be
+ * a chunk_t*. This chunk gets allocated, accumulated data using the
+ * fetcher_default_callback() function.
*
* @param uri URI to fetch from
- * @param result chunk which receives allocated data
+ * @param userdata userdata to pass to callback function.
* @return
* - SUCCESS if fetch was successful
* - NOT_SUPPORTED if fetcher does not support such URLs
* - FAILED, NOT_FOUND, PARSE_ERROR on failure
*/
- status_t (*fetch)(fetcher_t *this, char *uri, chunk_t *result);
+ status_t (*fetch)(fetcher_t *this, char *uri, void *userdata);
/**
* Set a fetcher option, as defined in fetcher_option_t.
@@ -114,4 +136,13 @@ struct fetcher_t {
void (*destroy)(fetcher_t *this);
};
+/**
+ * Default fetcher callback function, accumulates data to a chunk.
+ *
+ * @param userdata chunk for allocated data, empty on first invocation
+ * @param chunk current chunk of data
+ * @return FALSE if chunk too large to allocate
+ */
+bool fetcher_default_callback(void *userdata, chunk_t chunk);
+
#endif /** FETCHER_H_ @}*/
diff --git a/src/libstrongswan/fetcher/fetcher_manager.c b/src/libstrongswan/fetcher/fetcher_manager.c
index b007c8b08..9b363c7eb 100644
--- a/src/libstrongswan/fetcher/fetcher_manager.c
+++ b/src/libstrongswan/fetcher/fetcher_manager.c
@@ -58,11 +58,8 @@ static void entry_destroy(entry_t *entry)
free(entry);
}
-/**
- * Implementation of fetcher_manager_t.fetch.
- */
-static status_t fetch(private_fetcher_manager_t *this,
- char *url, chunk_t *response, ...)
+METHOD(fetcher_manager_t, fetch, status_t,
+ private_fetcher_manager_t *this, char *url, void *userdata, ...)
{
enumerator_t *enumerator;
status_t status = NOT_SUPPORTED;
@@ -89,25 +86,31 @@ static status_t fetch(private_fetcher_manager_t *this,
{
continue;
}
- va_start(args, response);
+ va_start(args, userdata);
while (good)
{
opt = va_arg(args, int);
switch (opt)
{
case FETCH_REQUEST_DATA:
- good = fetcher->set_option(fetcher, opt, va_arg(args, chunk_t));
+ good = fetcher->set_option(fetcher, opt,
+ va_arg(args, chunk_t));
continue;
case FETCH_REQUEST_TYPE:
case FETCH_REQUEST_HEADER:
- good = fetcher->set_option(fetcher, opt, va_arg(args, char*));
+ good = fetcher->set_option(fetcher, opt,
+ va_arg(args, char*));
continue;
case FETCH_HTTP_VERSION_1_0:
good = fetcher->set_option(fetcher, opt);
continue;
case FETCH_TIMEOUT:
- good = fetcher->set_option(fetcher, opt, va_arg(args, u_int));
+ good = fetcher->set_option(fetcher, opt,
+ va_arg(args, u_int));
continue;
+ case FETCH_CALLBACK:
+ good = fetcher->set_option(fetcher, opt,
+ va_arg(args, fetcher_callback_t));
case FETCH_END:
break;
}
@@ -120,7 +123,7 @@ static status_t fetch(private_fetcher_manager_t *this,
continue;
}
- status = fetcher->fetch(fetcher, url, response);
+ status = fetcher->fetch(fetcher, url, userdata);
fetcher->destroy(fetcher);
/* try another fetcher only if this one does not support that URL */
if (status == NOT_SUPPORTED)
@@ -139,27 +142,22 @@ static status_t fetch(private_fetcher_manager_t *this,
return status;
}
-/**
- * Implementation of fetcher_manager_t.add_fetcher.
- */
-static void add_fetcher(private_fetcher_manager_t *this,
- fetcher_constructor_t create, char *url)
+METHOD(fetcher_manager_t, add_fetcher, void,
+ private_fetcher_manager_t *this, fetcher_constructor_t create, char *url)
{
- entry_t *entry = malloc_thing(entry_t);
-
- entry->url = strdup(url);
- entry->create = create;
+ entry_t *entry;
+ INIT(entry,
+ .url = strdup(url),
+ .create = create,
+ );
this->lock->write_lock(this->lock);
this->fetchers->insert_last(this->fetchers, entry);
this->lock->unlock(this->lock);
}
-/**
- * Implementation of fetcher_manager_t.remove_fetcher.
- */
-static void remove_fetcher(private_fetcher_manager_t *this,
- fetcher_constructor_t create)
+METHOD(fetcher_manager_t, remove_fetcher, void,
+ private_fetcher_manager_t *this, fetcher_constructor_t create)
{
enumerator_t *enumerator;
entry_t *entry;
@@ -178,10 +176,8 @@ static void remove_fetcher(private_fetcher_manager_t *this,
this->lock->unlock(this->lock);
}
-/**
- * Implementation of fetcher_manager_t.destroy
- */
-static void destroy(private_fetcher_manager_t *this)
+METHOD(fetcher_manager_t, destroy, void,
+ private_fetcher_manager_t *this)
{
this->fetchers->destroy_function(this->fetchers, (void*)entry_destroy);
this->lock->destroy(this->lock);
@@ -193,15 +189,18 @@ static void destroy(private_fetcher_manager_t *this)
*/
fetcher_manager_t *fetcher_manager_create()
{
- private_fetcher_manager_t *this = malloc_thing(private_fetcher_manager_t);
-
- this->public.fetch = (status_t(*)(fetcher_manager_t*, char *url, chunk_t *response, ...))fetch;
- this->public.add_fetcher = (void(*)(fetcher_manager_t*, fetcher_constructor_t,char*))add_fetcher;
- this->public.remove_fetcher = (void(*)(fetcher_manager_t*, fetcher_constructor_t))remove_fetcher;
- this->public.destroy = (void(*)(fetcher_manager_t*))destroy;
-
- this->fetchers = linked_list_create();
- this->lock = rwlock_create(RWLOCK_TYPE_DEFAULT);
+ private_fetcher_manager_t *this;
+
+ INIT(this,
+ .public = {
+ .fetch = _fetch,
+ .add_fetcher = _add_fetcher,
+ .remove_fetcher = _remove_fetcher,
+ .destroy = _destroy,
+ },
+ .fetchers = linked_list_create(),
+ .lock = rwlock_create(RWLOCK_TYPE_DEFAULT),
+ );
return &this->public;
}
diff --git a/src/libstrongswan/fetcher/fetcher_manager.h b/src/libstrongswan/fetcher/fetcher_manager.h
index a7ac6611e..15250d531 100644
--- a/src/libstrongswan/fetcher/fetcher_manager.h
+++ b/src/libstrongswan/fetcher/fetcher_manager.h
@@ -31,17 +31,20 @@ typedef struct fetcher_manager_t fetcher_manager_t;
struct fetcher_manager_t {
/**
- * Fetch data from URI into chunk.
+ * Fetch data from URI.
*
* The variable argument list contains fetcher_option_t's, followed
* by a option specific data argument.
+ * If no FETCH_CALLBACK function is given as option, userdata must be
+ * a chunk_t*. This chunk gets allocated, accumulated data using the
+ * fetcher_default_callback() function.
*
* @param uri URI to fetch from
- * @param result chunk which receives allocated data
+ * @param userdata userdata to pass to callback function.
* @param options FETCH_END terminated fetcher_option_t arguments
* @return status indicating result of fetch
*/
- status_t (*fetch)(fetcher_manager_t *this, char *url, chunk_t *response, ...);
+ status_t (*fetch)(fetcher_manager_t *this, char *url, void *userdata, ...);
/**
* Register a fetcher implementation.
diff --git a/src/libstrongswan/plugins/aes/Makefile.in b/src/libstrongswan/plugins/aes/Makefile.in
index 9835cd5b9..c93f84ca7 100644
--- a/src/libstrongswan/plugins/aes/Makefile.in
+++ b/src/libstrongswan/plugins/aes/Makefile.in
@@ -240,6 +240,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -263,6 +265,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/aes/aes_crypter.c b/src/libstrongswan/plugins/aes/aes_crypter.c
index f13e33492..2a1fed944 100644
--- a/src/libstrongswan/plugins/aes/aes_crypter.c
+++ b/src/libstrongswan/plugins/aes/aes_crypter.c
@@ -1518,6 +1518,7 @@ METHOD(crypter_t, set_key, void,
METHOD(crypter_t, destroy, void,
private_aes_crypter_t *this)
{
+ memwipe(this, sizeof(*this));
free(this);
}
diff --git a/src/libstrongswan/plugins/aes/aes_plugin.c b/src/libstrongswan/plugins/aes/aes_plugin.c
index 1c060b6c8..d17355d1d 100644
--- a/src/libstrongswan/plugins/aes/aes_plugin.c
+++ b/src/libstrongswan/plugins/aes/aes_plugin.c
@@ -18,8 +18,6 @@
#include <library.h>
#include "aes_crypter.h"
-static const char *plugin_name = "aes";
-
typedef struct private_aes_plugin_t private_aes_plugin_t;
/**
@@ -33,6 +31,12 @@ struct private_aes_plugin_t {
aes_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_aes_plugin_t *this)
+{
+ return "aes";
+}
+
METHOD(plugin_t, destroy, void,
private_aes_plugin_t *this)
{
@@ -51,12 +55,14 @@ plugin_t *aes_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
);
- lib->crypto->add_crypter(lib->crypto, ENCR_AES_CBC, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_AES_CBC, get_name(this),
(crypter_constructor_t)aes_crypter_create);
return &this->public.plugin;
diff --git a/src/libstrongswan/plugins/af_alg/Makefile.in b/src/libstrongswan/plugins/af_alg/Makefile.in
index aa8df979e..00b54b026 100644
--- a/src/libstrongswan/plugins/af_alg/Makefile.in
+++ b/src/libstrongswan/plugins/af_alg/Makefile.in
@@ -244,6 +244,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -267,6 +269,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/af_alg/af_alg_crypter.c b/src/libstrongswan/plugins/af_alg/af_alg_crypter.c
index 3416ad8d2..7b3c062aa 100644
--- a/src/libstrongswan/plugins/af_alg/af_alg_crypter.c
+++ b/src/libstrongswan/plugins/af_alg/af_alg_crypter.c
@@ -63,6 +63,7 @@ static struct {
size_t iv_size;
} algs[] = {
{ENCR_DES, "cbc(des)", 8, 8, 8, 8, },
+ {ENCR_DES_ECB, "ecb(des)", 8, 8, 8, 0, },
{ENCR_3DES, "cbc(des3_ede)", 8, 24, 24, 8, },
{ENCR_AES_CBC, "cbc(aes)", 16, 16, 16, 16, },
{ENCR_AES_CBC, "cbc(aes)", 16, 24, 24, 16, },
@@ -91,7 +92,7 @@ static struct {
/**
* See header.
*/
-void af_alg_crypter_probe()
+void af_alg_crypter_probe(char *plugin)
{
encryption_algorithm_t prev = -1;
af_alg_ops_t *ops;
@@ -105,7 +106,7 @@ void af_alg_crypter_probe()
if (ops)
{
ops->destroy(ops);
- lib->crypto->add_crypter(lib->crypto, algs[i].id, af_alg_plugin_name,
+ lib->crypto->add_crypter(lib->crypto, algs[i].id, plugin,
(crypter_constructor_t)af_alg_crypter_create);
}
}
diff --git a/src/libstrongswan/plugins/af_alg/af_alg_crypter.h b/src/libstrongswan/plugins/af_alg/af_alg_crypter.h
index 711d2fc35..ed7799cc8 100644
--- a/src/libstrongswan/plugins/af_alg/af_alg_crypter.h
+++ b/src/libstrongswan/plugins/af_alg/af_alg_crypter.h
@@ -48,7 +48,9 @@ af_alg_crypter_t *af_alg_crypter_create(encryption_algorithm_t algo,
/**
* Probe algorithms and register af_alg_crypter_create().
+ *
+ * @param plugin plugin name to register algorithms for
*/
-void af_alg_crypter_probe();
+void af_alg_crypter_probe(char *plugin);
#endif /** AF_ALG_CRYPTER_H_ @}*/
diff --git a/src/libstrongswan/plugins/af_alg/af_alg_hasher.c b/src/libstrongswan/plugins/af_alg/af_alg_hasher.c
index 7c6297d44..11074c4bd 100644
--- a/src/libstrongswan/plugins/af_alg/af_alg_hasher.c
+++ b/src/libstrongswan/plugins/af_alg/af_alg_hasher.c
@@ -59,7 +59,7 @@ static struct {
/**
* See header.
*/
-void af_alg_hasher_probe()
+void af_alg_hasher_probe(char *plugin)
{
af_alg_ops_t *ops;
int i;
@@ -70,7 +70,7 @@ void af_alg_hasher_probe()
if (ops)
{
ops->destroy(ops);
- lib->crypto->add_hasher(lib->crypto, algs[i].id, af_alg_plugin_name,
+ lib->crypto->add_hasher(lib->crypto, algs[i].id, plugin,
(hasher_constructor_t)af_alg_hasher_create);
}
}
diff --git a/src/libstrongswan/plugins/af_alg/af_alg_hasher.h b/src/libstrongswan/plugins/af_alg/af_alg_hasher.h
index e0833e23a..f44ba2938 100644
--- a/src/libstrongswan/plugins/af_alg/af_alg_hasher.h
+++ b/src/libstrongswan/plugins/af_alg/af_alg_hasher.h
@@ -46,7 +46,9 @@ af_alg_hasher_t *af_alg_hasher_create(hash_algorithm_t algo);
/**
* Probe algorithms and register af_alg_hasher_create().
+ *
+ * @param plugin plugin name to register algorithms for
*/
-void af_alg_hasher_probe();
+void af_alg_hasher_probe(char *plugin);
#endif /** af_alg_HASHER_H_ @}*/
diff --git a/src/libstrongswan/plugins/af_alg/af_alg_ops.c b/src/libstrongswan/plugins/af_alg/af_alg_ops.c
index 7bf1d90db..82a227d97 100644
--- a/src/libstrongswan/plugins/af_alg/af_alg_ops.c
+++ b/src/libstrongswan/plugins/af_alg/af_alg_ops.c
@@ -21,8 +21,6 @@
#include <debug.h>
-const char *af_alg_plugin_name = "af-alg";
-
typedef struct private_af_alg_ops_t private_af_alg_ops_t;
/**
diff --git a/src/libstrongswan/plugins/af_alg/af_alg_ops.h b/src/libstrongswan/plugins/af_alg/af_alg_ops.h
index b7d642c00..ad164029f 100644
--- a/src/libstrongswan/plugins/af_alg/af_alg_ops.h
+++ b/src/libstrongswan/plugins/af_alg/af_alg_ops.h
@@ -33,8 +33,6 @@
#define SOL_ALG 279
#endif /* SOL_ALG */
-extern const char *af_alg_plugin_name;
-
typedef struct af_alg_ops_t af_alg_ops_t;
/**
diff --git a/src/libstrongswan/plugins/af_alg/af_alg_plugin.c b/src/libstrongswan/plugins/af_alg/af_alg_plugin.c
index 54e39f1a0..280ea4e98 100644
--- a/src/libstrongswan/plugins/af_alg/af_alg_plugin.c
+++ b/src/libstrongswan/plugins/af_alg/af_alg_plugin.c
@@ -35,6 +35,12 @@ struct private_af_alg_plugin_t {
af_alg_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_af_alg_plugin_t *this)
+{
+ return "af-alg";
+}
+
METHOD(plugin_t, destroy, void,
private_af_alg_plugin_t *this)
{
@@ -60,15 +66,17 @@ plugin_t *af_alg_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
);
- af_alg_hasher_probe();
- af_alg_signer_probe();
- af_alg_prf_probe();
- af_alg_crypter_probe();
+ af_alg_hasher_probe(get_name(this));
+ af_alg_signer_probe(get_name(this));
+ af_alg_prf_probe(get_name(this));
+ af_alg_crypter_probe(get_name(this));
return &this->public.plugin;
}
diff --git a/src/libstrongswan/plugins/af_alg/af_alg_prf.c b/src/libstrongswan/plugins/af_alg/af_alg_prf.c
index 575906bae..1c1174abb 100644
--- a/src/libstrongswan/plugins/af_alg/af_alg_prf.c
+++ b/src/libstrongswan/plugins/af_alg/af_alg_prf.c
@@ -70,7 +70,7 @@ static struct {
/**
* See header.
*/
-void af_alg_prf_probe()
+void af_alg_prf_probe(char *plugin)
{
af_alg_ops_t *ops;
int i;
@@ -81,7 +81,7 @@ void af_alg_prf_probe()
if (ops)
{
ops->destroy(ops);
- lib->crypto->add_prf(lib->crypto, algs[i].id, af_alg_plugin_name,
+ lib->crypto->add_prf(lib->crypto, algs[i].id, plugin,
(prf_constructor_t)af_alg_prf_create);
}
}
diff --git a/src/libstrongswan/plugins/af_alg/af_alg_prf.h b/src/libstrongswan/plugins/af_alg/af_alg_prf.h
index a3dea5649..d3275e7be 100644
--- a/src/libstrongswan/plugins/af_alg/af_alg_prf.h
+++ b/src/libstrongswan/plugins/af_alg/af_alg_prf.h
@@ -46,7 +46,9 @@ af_alg_prf_t *af_alg_prf_create(pseudo_random_function_t algo);
/**
* Probe algorithms and register af_alg_prf_create().
+ *
+ * @param plugin plugin name to register algorithms for
*/
-void af_alg_prf_probe();
+void af_alg_prf_probe(char *plugin);
#endif /** AF_ALG_PRF_H_ @}*/
diff --git a/src/libstrongswan/plugins/af_alg/af_alg_signer.c b/src/libstrongswan/plugins/af_alg/af_alg_signer.c
index 3d6f907bf..34534a06b 100644
--- a/src/libstrongswan/plugins/af_alg/af_alg_signer.c
+++ b/src/libstrongswan/plugins/af_alg/af_alg_signer.c
@@ -71,7 +71,7 @@ static struct {
/**
* See header.
*/
-void af_alg_signer_probe()
+void af_alg_signer_probe(char *plugin)
{
af_alg_ops_t *ops;
int i;
@@ -82,7 +82,7 @@ void af_alg_signer_probe()
if (ops)
{
ops->destroy(ops);
- lib->crypto->add_signer(lib->crypto, algs[i].id, af_alg_plugin_name,
+ lib->crypto->add_signer(lib->crypto, algs[i].id, plugin,
(signer_constructor_t)af_alg_signer_create);
}
}
diff --git a/src/libstrongswan/plugins/af_alg/af_alg_signer.h b/src/libstrongswan/plugins/af_alg/af_alg_signer.h
index b1d90707f..21487a118 100644
--- a/src/libstrongswan/plugins/af_alg/af_alg_signer.h
+++ b/src/libstrongswan/plugins/af_alg/af_alg_signer.h
@@ -46,7 +46,9 @@ af_alg_signer_t *af_alg_signer_create(integrity_algorithm_t algo);
/**
* Probe algorithms and register af_alg_signer_create().
+ *
+ * @param plugin plugin name to register algorithms for
*/
-void af_alg_signer_probe();
+void af_alg_signer_probe(char *plugin);
#endif /** AF_ALG_SIGNER_H_ @}*/
diff --git a/src/libstrongswan/plugins/agent/Makefile.in b/src/libstrongswan/plugins/agent/Makefile.in
index 1a3533f03..ce333660d 100644
--- a/src/libstrongswan/plugins/agent/Makefile.in
+++ b/src/libstrongswan/plugins/agent/Makefile.in
@@ -242,6 +242,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -265,6 +267,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/agent/agent_plugin.c b/src/libstrongswan/plugins/agent/agent_plugin.c
index bd3c1ac75..79c13b7c1 100644
--- a/src/libstrongswan/plugins/agent/agent_plugin.c
+++ b/src/libstrongswan/plugins/agent/agent_plugin.c
@@ -31,6 +31,12 @@ struct private_agent_plugin_t {
agent_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_agent_plugin_t *this)
+{
+ return "agent";
+}
+
METHOD(plugin_t, destroy, void,
private_agent_plugin_t *this)
{
@@ -49,6 +55,8 @@ plugin_t *agent_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
diff --git a/src/libstrongswan/plugins/blowfish/Makefile.in b/src/libstrongswan/plugins/blowfish/Makefile.in
index 251722f60..be8ba72ee 100644
--- a/src/libstrongswan/plugins/blowfish/Makefile.in
+++ b/src/libstrongswan/plugins/blowfish/Makefile.in
@@ -244,6 +244,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -267,6 +269,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/blowfish/blowfish_crypter.c b/src/libstrongswan/plugins/blowfish/blowfish_crypter.c
index 784c07eaf..fc3649b36 100644
--- a/src/libstrongswan/plugins/blowfish/blowfish_crypter.c
+++ b/src/libstrongswan/plugins/blowfish/blowfish_crypter.c
@@ -160,6 +160,7 @@ METHOD(crypter_t, set_key, void,
METHOD(crypter_t, destroy, void,
private_blowfish_crypter_t *this)
{
+ memwipe(this, sizeof(*this));
free(this);
}
diff --git a/src/libstrongswan/plugins/blowfish/blowfish_plugin.c b/src/libstrongswan/plugins/blowfish/blowfish_plugin.c
index 5232eca28..9dc8dfe7f 100644
--- a/src/libstrongswan/plugins/blowfish/blowfish_plugin.c
+++ b/src/libstrongswan/plugins/blowfish/blowfish_plugin.c
@@ -19,8 +19,6 @@
#include <library.h>
#include "blowfish_crypter.h"
-static const char *plugin_name = "blowfish";
-
typedef struct private_blowfish_plugin_t private_blowfish_plugin_t;
/**
@@ -34,6 +32,12 @@ struct private_blowfish_plugin_t {
blowfish_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_blowfish_plugin_t *this)
+{
+ return "blowfish";
+}
+
METHOD(plugin_t, destroy, void,
private_blowfish_plugin_t *this)
{
@@ -52,12 +56,14 @@ plugin_t *blowfish_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
);
- lib->crypto->add_crypter(lib->crypto, ENCR_BLOWFISH, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_BLOWFISH, get_name(this),
(crypter_constructor_t)blowfish_crypter_create);
return &this->public.plugin;
diff --git a/src/libstrongswan/plugins/ccm/Makefile.in b/src/libstrongswan/plugins/ccm/Makefile.in
index 371e5b2f4..b2bc4a51f 100644
--- a/src/libstrongswan/plugins/ccm/Makefile.in
+++ b/src/libstrongswan/plugins/ccm/Makefile.in
@@ -240,6 +240,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -263,6 +265,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/ccm/ccm_plugin.c b/src/libstrongswan/plugins/ccm/ccm_plugin.c
index a4c89b548..2865c2ae4 100644
--- a/src/libstrongswan/plugins/ccm/ccm_plugin.c
+++ b/src/libstrongswan/plugins/ccm/ccm_plugin.c
@@ -19,8 +19,6 @@
#include "ccm_aead.h"
-static const char *plugin_name = "ccm";
-
typedef struct private_ccm_plugin_t private_ccm_plugin_t;
/**
@@ -34,6 +32,12 @@ struct private_ccm_plugin_t {
ccm_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_ccm_plugin_t *this)
+{
+ return "ccm";
+}
+
METHOD(plugin_t, destroy, void,
private_ccm_plugin_t *this)
{
@@ -52,29 +56,35 @@ plugin_t *ccm_plugin_create()
crypter_t *crypter;
INIT(this,
- .public.plugin.destroy = _destroy,
+ .public = {
+ .plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
+ .destroy = _destroy,
+ },
+ },
);
crypter = lib->crypto->create_crypter(lib->crypto, ENCR_AES_CBC, 0);
if (crypter)
{
crypter->destroy(crypter);
- lib->crypto->add_aead(lib->crypto, ENCR_AES_CCM_ICV8, plugin_name,
+ lib->crypto->add_aead(lib->crypto, ENCR_AES_CCM_ICV8, get_name(this),
(aead_constructor_t)ccm_aead_create);
- lib->crypto->add_aead(lib->crypto, ENCR_AES_CCM_ICV12, plugin_name,
+ lib->crypto->add_aead(lib->crypto, ENCR_AES_CCM_ICV12, get_name(this),
(aead_constructor_t)ccm_aead_create);
- lib->crypto->add_aead(lib->crypto, ENCR_AES_CCM_ICV16, plugin_name,
+ lib->crypto->add_aead(lib->crypto, ENCR_AES_CCM_ICV16, get_name(this),
(aead_constructor_t)ccm_aead_create);
}
crypter = lib->crypto->create_crypter(lib->crypto, ENCR_CAMELLIA_CBC, 0);
if (crypter)
{
crypter->destroy(crypter);
- lib->crypto->add_aead(lib->crypto, ENCR_CAMELLIA_CCM_ICV8, plugin_name,
+ lib->crypto->add_aead(lib->crypto, ENCR_CAMELLIA_CCM_ICV8, get_name(this),
(aead_constructor_t)ccm_aead_create);
- lib->crypto->add_aead(lib->crypto, ENCR_CAMELLIA_CCM_ICV12, plugin_name,
+ lib->crypto->add_aead(lib->crypto, ENCR_CAMELLIA_CCM_ICV12, get_name(this),
(aead_constructor_t)ccm_aead_create);
- lib->crypto->add_aead(lib->crypto, ENCR_CAMELLIA_CCM_ICV16, plugin_name,
+ lib->crypto->add_aead(lib->crypto, ENCR_CAMELLIA_CCM_ICV16, get_name(this),
(aead_constructor_t)ccm_aead_create);
}
diff --git a/src/libstrongswan/plugins/constraints/Makefile.in b/src/libstrongswan/plugins/constraints/Makefile.in
index 382bfef98..8be502a9c 100644
--- a/src/libstrongswan/plugins/constraints/Makefile.in
+++ b/src/libstrongswan/plugins/constraints/Makefile.in
@@ -244,6 +244,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -267,6 +269,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/constraints/constraints_plugin.c b/src/libstrongswan/plugins/constraints/constraints_plugin.c
index 1c3f0c835..502c83559 100644
--- a/src/libstrongswan/plugins/constraints/constraints_plugin.c
+++ b/src/libstrongswan/plugins/constraints/constraints_plugin.c
@@ -36,6 +36,12 @@ struct private_constraints_plugin_t {
constraints_validator_t *validator;
};
+METHOD(plugin_t, get_name, char*,
+ private_constraints_plugin_t *this)
+{
+ return "constraints";
+}
+
METHOD(plugin_t, destroy, void,
private_constraints_plugin_t *this)
{
@@ -54,6 +60,8 @@ plugin_t *constraints_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
diff --git a/src/libstrongswan/plugins/ctr/Makefile.in b/src/libstrongswan/plugins/ctr/Makefile.in
index 2f6be07e2..0db640829 100644
--- a/src/libstrongswan/plugins/ctr/Makefile.in
+++ b/src/libstrongswan/plugins/ctr/Makefile.in
@@ -240,6 +240,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -263,6 +265,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/ctr/ctr_plugin.c b/src/libstrongswan/plugins/ctr/ctr_plugin.c
index 9f1bf957f..6850cacf0 100644
--- a/src/libstrongswan/plugins/ctr/ctr_plugin.c
+++ b/src/libstrongswan/plugins/ctr/ctr_plugin.c
@@ -19,8 +19,6 @@
#include "ctr_ipsec_crypter.h"
-static const char *plugin_name = "ctr";
-
typedef struct private_ctr_plugin_t private_ctr_plugin_t;
/**
@@ -34,6 +32,12 @@ struct private_ctr_plugin_t {
ctr_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_ctr_plugin_t *this)
+{
+ return "ctr";
+}
+
METHOD(plugin_t, destroy, void,
private_ctr_plugin_t *this)
{
@@ -54,6 +58,8 @@ plugin_t *ctr_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
@@ -63,14 +69,14 @@ plugin_t *ctr_plugin_create()
if (crypter)
{
crypter->destroy(crypter);
- lib->crypto->add_crypter(lib->crypto, ENCR_AES_CTR, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_AES_CTR, get_name(this),
(crypter_constructor_t)ctr_ipsec_crypter_create);
}
crypter = lib->crypto->create_crypter(lib->crypto, ENCR_CAMELLIA_CBC, 16);
if (crypter)
{
crypter->destroy(crypter);
- lib->crypto->add_crypter(lib->crypto, ENCR_CAMELLIA_CTR, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_CAMELLIA_CTR, get_name(this),
(crypter_constructor_t)ctr_ipsec_crypter_create);
}
return &this->public.plugin;
diff --git a/src/libstrongswan/plugins/curl/Makefile.in b/src/libstrongswan/plugins/curl/Makefile.in
index e61c73041..cdfb2b801 100644
--- a/src/libstrongswan/plugins/curl/Makefile.in
+++ b/src/libstrongswan/plugins/curl/Makefile.in
@@ -240,6 +240,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -263,6 +265,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/curl/curl_fetcher.c b/src/libstrongswan/plugins/curl/curl_fetcher.c
index 82e24e810..7f8c0aec2 100644
--- a/src/libstrongswan/plugins/curl/curl_fetcher.c
+++ b/src/libstrongswan/plugins/curl/curl_fetcher.c
@@ -43,31 +43,49 @@ struct private_curl_fetcher_t {
* Optional HTTP headers
*/
struct curl_slist *headers;
+
+ /**
+ * Callback function
+ */
+ fetcher_callback_t cb;
};
/**
- * writes data into a dynamically resizeable chunk_t
+ * Data to pass to curl callback
+ */
+typedef struct {
+ fetcher_callback_t cb;
+ void *user;
+} cb_data_t;
+
+/**
+ * Curl callback function, invokes fetcher_callback_t function
*/
-static size_t append(void *ptr, size_t size, size_t nmemb, chunk_t *data)
+static size_t curl_cb(void *ptr, size_t size, size_t nmemb, cb_data_t *data)
{
size_t realsize = size * nmemb;
- data->ptr = (u_char*)realloc(data->ptr, data->len + realsize);
- if (data->ptr)
+ if (data->cb(data->user, chunk_create(ptr, realsize)))
{
- memcpy(&data->ptr[data->len], ptr, realsize);
- data->len += realsize;
+ return realsize;
}
- return realsize;
+ return 0;
}
METHOD(fetcher_t, fetch, status_t,
- private_curl_fetcher_t *this, char *uri, chunk_t *result)
+ private_curl_fetcher_t *this, char *uri, void *userdata)
{
char error[CURL_ERROR_SIZE];
status_t status;
+ cb_data_t data = {
+ .cb = this->cb,
+ .user = userdata,
+ };
- *result = chunk_empty;
+ if (this->cb == fetcher_default_callback)
+ {
+ *(chunk_t*)userdata = chunk_empty;
+ }
if (curl_easy_setopt(this->curl, CURLOPT_URL, uri) != CURLE_OK)
{ /* URL type not supported by curl */
@@ -77,8 +95,8 @@ METHOD(fetcher_t, fetch, status_t,
curl_easy_setopt(this->curl, CURLOPT_FAILONERROR, TRUE);
curl_easy_setopt(this->curl, CURLOPT_NOSIGNAL, TRUE);
curl_easy_setopt(this->curl, CURLOPT_CONNECTTIMEOUT, DEFAULT_TIMEOUT);
- curl_easy_setopt(this->curl, CURLOPT_WRITEFUNCTION, (void*)append);
- curl_easy_setopt(this->curl, CURLOPT_WRITEDATA, (void*)result);
+ curl_easy_setopt(this->curl, CURLOPT_WRITEFUNCTION, (void*)curl_cb);
+ curl_easy_setopt(this->curl, CURLOPT_WRITEDATA, &data);
if (this->headers)
{
curl_easy_setopt(this->curl, CURLOPT_HTTPHEADER, this->headers);
@@ -146,6 +164,11 @@ METHOD(fetcher_t, set_option, bool,
va_arg(args, u_int));
break;
}
+ case FETCH_CALLBACK:
+ {
+ this->cb = va_arg(args, fetcher_callback_t);
+ break;
+ }
default:
supported = FALSE;
break;
@@ -178,6 +201,7 @@ curl_fetcher_t *curl_fetcher_create()
},
},
.curl = curl_easy_init(),
+ .cb = fetcher_default_callback,
);
if (!this->curl)
diff --git a/src/libstrongswan/plugins/curl/curl_plugin.c b/src/libstrongswan/plugins/curl/curl_plugin.c
index 387da03aa..d0e532055 100644
--- a/src/libstrongswan/plugins/curl/curl_plugin.c
+++ b/src/libstrongswan/plugins/curl/curl_plugin.c
@@ -34,6 +34,12 @@ struct private_curl_plugin_t {
curl_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_curl_plugin_t *this)
+{
+ return "curl";
+}
+
METHOD(plugin_t, destroy, void,
private_curl_plugin_t *this)
{
@@ -54,6 +60,8 @@ plugin_t *curl_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
diff --git a/src/libstrongswan/plugins/des/Makefile.in b/src/libstrongswan/plugins/des/Makefile.in
index e45988ca9..d24ac40f8 100644
--- a/src/libstrongswan/plugins/des/Makefile.in
+++ b/src/libstrongswan/plugins/des/Makefile.in
@@ -240,6 +240,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -263,6 +265,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/des/des_crypter.c b/src/libstrongswan/plugins/des/des_crypter.c
index 7d9fbe852..695e7e4c4 100644
--- a/src/libstrongswan/plugins/des/des_crypter.c
+++ b/src/libstrongswan/plugins/des/des_crypter.c
@@ -1552,6 +1552,7 @@ METHOD(crypter_t, set_key3, void,
METHOD(crypter_t, destroy, void,
private_des_crypter_t *this)
{
+ memwipe(this, sizeof(*this));
free(this);
}
diff --git a/src/libstrongswan/plugins/des/des_plugin.c b/src/libstrongswan/plugins/des/des_plugin.c
index d420d789e..78b73347d 100644
--- a/src/libstrongswan/plugins/des/des_plugin.c
+++ b/src/libstrongswan/plugins/des/des_plugin.c
@@ -18,8 +18,6 @@
#include <library.h>
#include "des_crypter.h"
-static const char *plugin_name = "des";
-
typedef struct private_des_plugin_t private_des_plugin_t;
/**
@@ -33,6 +31,12 @@ struct private_des_plugin_t {
des_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_des_plugin_t *this)
+{
+ return "des";
+}
+
METHOD(plugin_t, destroy, void,
private_des_plugin_t *this)
{
@@ -51,16 +55,18 @@ plugin_t *des_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
);
- lib->crypto->add_crypter(lib->crypto, ENCR_3DES, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_3DES, get_name(this),
(crypter_constructor_t)des_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_DES, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_DES, get_name(this),
(crypter_constructor_t)des_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_DES_ECB, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_DES_ECB, get_name(this),
(crypter_constructor_t)des_crypter_create);
return &this->public.plugin;
diff --git a/src/libstrongswan/plugins/dnskey/Makefile.in b/src/libstrongswan/plugins/dnskey/Makefile.in
index d1dce4679..62c52498c 100644
--- a/src/libstrongswan/plugins/dnskey/Makefile.in
+++ b/src/libstrongswan/plugins/dnskey/Makefile.in
@@ -243,6 +243,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -266,6 +268,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/dnskey/dnskey_plugin.c b/src/libstrongswan/plugins/dnskey/dnskey_plugin.c
index d11b149df..4e08746f8 100644
--- a/src/libstrongswan/plugins/dnskey/dnskey_plugin.c
+++ b/src/libstrongswan/plugins/dnskey/dnskey_plugin.c
@@ -31,6 +31,12 @@ struct private_dnskey_plugin_t {
dnskey_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_dnskey_plugin_t *this)
+{
+ return "dnskey";
+}
+
METHOD(plugin_t, destroy, void,
private_dnskey_plugin_t *this)
{
@@ -49,6 +55,8 @@ plugin_t *dnskey_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
diff --git a/src/libstrongswan/plugins/fips_prf/Makefile.in b/src/libstrongswan/plugins/fips_prf/Makefile.in
index ab1ed6d00..e88a102b8 100644
--- a/src/libstrongswan/plugins/fips_prf/Makefile.in
+++ b/src/libstrongswan/plugins/fips_prf/Makefile.in
@@ -243,6 +243,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -266,6 +268,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/fips_prf/fips_prf_plugin.c b/src/libstrongswan/plugins/fips_prf/fips_prf_plugin.c
index 3cce6ad91..7038da146 100644
--- a/src/libstrongswan/plugins/fips_prf/fips_prf_plugin.c
+++ b/src/libstrongswan/plugins/fips_prf/fips_prf_plugin.c
@@ -18,8 +18,6 @@
#include <library.h>
#include "fips_prf.h"
-static const char *plugin_name = "fips-prf";
-
typedef struct private_fips_prf_plugin_t private_fips_prf_plugin_t;
/**
@@ -33,6 +31,12 @@ struct private_fips_prf_plugin_t {
fips_prf_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_fips_prf_plugin_t *this)
+{
+ return "fips-prf";
+}
+
METHOD(plugin_t, destroy, void,
private_fips_prf_plugin_t *this)
{
@@ -52,6 +56,8 @@ plugin_t *fips_prf_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
@@ -61,7 +67,7 @@ plugin_t *fips_prf_plugin_create()
if (prf)
{
prf->destroy(prf);
- lib->crypto->add_prf(lib->crypto, PRF_FIPS_SHA1_160, plugin_name,
+ lib->crypto->add_prf(lib->crypto, PRF_FIPS_SHA1_160, get_name(this),
(prf_constructor_t)fips_prf_create);
}
diff --git a/src/libstrongswan/plugins/gcm/Makefile.in b/src/libstrongswan/plugins/gcm/Makefile.in
index 9e0b49776..202849eb6 100644
--- a/src/libstrongswan/plugins/gcm/Makefile.in
+++ b/src/libstrongswan/plugins/gcm/Makefile.in
@@ -240,6 +240,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -263,6 +265,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/gcm/gcm_plugin.c b/src/libstrongswan/plugins/gcm/gcm_plugin.c
index a438fb073..4b46f0ee4 100644
--- a/src/libstrongswan/plugins/gcm/gcm_plugin.c
+++ b/src/libstrongswan/plugins/gcm/gcm_plugin.c
@@ -19,8 +19,6 @@
#include "gcm_aead.h"
-static const char *plugin_name = "gcm";
-
typedef struct private_gcm_plugin_t private_gcm_plugin_t;
/**
@@ -34,6 +32,12 @@ struct private_gcm_plugin_t {
gcm_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_gcm_plugin_t *this)
+{
+ return "gcm";
+}
+
METHOD(plugin_t, destroy, void,
private_gcm_plugin_t *this)
{
@@ -52,18 +56,24 @@ plugin_t *gcm_plugin_create()
crypter_t *crypter;
INIT(this,
- .public.plugin.destroy = _destroy,
+ .public = {
+ .plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
+ .destroy = _destroy,
+ },
+ },
);
crypter = lib->crypto->create_crypter(lib->crypto, ENCR_AES_CBC, 0);
if (crypter)
{
crypter->destroy(crypter);
- lib->crypto->add_aead(lib->crypto, ENCR_AES_GCM_ICV8, plugin_name,
+ lib->crypto->add_aead(lib->crypto, ENCR_AES_GCM_ICV8, get_name(this),
(aead_constructor_t)gcm_aead_create);
- lib->crypto->add_aead(lib->crypto, ENCR_AES_GCM_ICV12, plugin_name,
+ lib->crypto->add_aead(lib->crypto, ENCR_AES_GCM_ICV12, get_name(this),
(aead_constructor_t)gcm_aead_create);
- lib->crypto->add_aead(lib->crypto, ENCR_AES_GCM_ICV16, plugin_name,
+ lib->crypto->add_aead(lib->crypto, ENCR_AES_GCM_ICV16, get_name(this),
(aead_constructor_t)gcm_aead_create);
}
diff --git a/src/libstrongswan/plugins/gcrypt/Makefile.in b/src/libstrongswan/plugins/gcrypt/Makefile.in
index 1bcada7dc..bedb918b9 100644
--- a/src/libstrongswan/plugins/gcrypt/Makefile.in
+++ b/src/libstrongswan/plugins/gcrypt/Makefile.in
@@ -244,6 +244,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -267,6 +269,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c b/src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c
index a53fed448..e26277b0b 100644
--- a/src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c
+++ b/src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c
@@ -29,8 +29,6 @@
#include <errno.h>
#include <gcrypt.h>
-static const char *plugin_name = "gcrypt";
-
typedef struct private_gcrypt_plugin_t private_gcrypt_plugin_t;
/**
@@ -95,6 +93,12 @@ static struct gcry_thread_cbs thread_functions = {
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
};
+METHOD(plugin_t, get_name, char*,
+ private_gcrypt_plugin_t *this)
+{
+ return "gcrypt";
+}
+
METHOD(plugin_t, destroy, void,
private_gcrypt_plugin_t *this)
{
@@ -144,85 +148,87 @@ plugin_t *gcrypt_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
);
/* hashers */
- lib->crypto->add_hasher(lib->crypto, HASH_SHA1, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA1, get_name(this),
(hasher_constructor_t)gcrypt_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_MD4, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_MD4, get_name(this),
(hasher_constructor_t)gcrypt_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_MD5, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_MD5, get_name(this),
(hasher_constructor_t)gcrypt_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_SHA224, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA224, get_name(this),
(hasher_constructor_t)gcrypt_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_SHA256, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA256, get_name(this),
(hasher_constructor_t)gcrypt_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_SHA384, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA384, get_name(this),
(hasher_constructor_t)gcrypt_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_SHA512, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA512, get_name(this),
(hasher_constructor_t)gcrypt_hasher_create);
/* crypters */
- lib->crypto->add_crypter(lib->crypto, ENCR_3DES, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_3DES, get_name(this),
(crypter_constructor_t)gcrypt_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_CAST, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_CAST, get_name(this),
(crypter_constructor_t)gcrypt_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_BLOWFISH, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_BLOWFISH, get_name(this),
(crypter_constructor_t)gcrypt_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_DES, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_DES, get_name(this),
(crypter_constructor_t)gcrypt_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_DES_ECB, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_DES_ECB, get_name(this),
(crypter_constructor_t)gcrypt_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_AES_CBC, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_AES_CBC, get_name(this),
(crypter_constructor_t)gcrypt_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_AES_CTR, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_AES_CTR, get_name(this),
(crypter_constructor_t)gcrypt_crypter_create);
#ifdef HAVE_GCRY_CIPHER_CAMELLIA
- lib->crypto->add_crypter(lib->crypto, ENCR_CAMELLIA_CBC, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_CAMELLIA_CBC, get_name(this),
(crypter_constructor_t)gcrypt_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_CAMELLIA_CTR, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_CAMELLIA_CTR, get_name(this),
(crypter_constructor_t)gcrypt_crypter_create);
#endif /* HAVE_GCRY_CIPHER_CAMELLIA */
- lib->crypto->add_crypter(lib->crypto, ENCR_SERPENT_CBC, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_SERPENT_CBC, get_name(this),
(crypter_constructor_t)gcrypt_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_TWOFISH_CBC, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_TWOFISH_CBC, get_name(this),
(crypter_constructor_t)gcrypt_crypter_create);
/* random numbers */
- lib->crypto->add_rng(lib->crypto, RNG_WEAK, plugin_name,
+ lib->crypto->add_rng(lib->crypto, RNG_WEAK, get_name(this),
(rng_constructor_t)gcrypt_rng_create);
- lib->crypto->add_rng(lib->crypto, RNG_STRONG, plugin_name,
+ lib->crypto->add_rng(lib->crypto, RNG_STRONG, get_name(this),
(rng_constructor_t)gcrypt_rng_create);
- lib->crypto->add_rng(lib->crypto, RNG_TRUE, plugin_name,
+ lib->crypto->add_rng(lib->crypto, RNG_TRUE, get_name(this),
(rng_constructor_t)gcrypt_rng_create);
/* diffie hellman groups, using modp */
- lib->crypto->add_dh(lib->crypto, MODP_2048_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_2048_BIT, get_name(this),
(dh_constructor_t)gcrypt_dh_create);
- lib->crypto->add_dh(lib->crypto, MODP_2048_224, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_2048_224, get_name(this),
(dh_constructor_t)gcrypt_dh_create);
- lib->crypto->add_dh(lib->crypto, MODP_2048_256, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_2048_256, get_name(this),
(dh_constructor_t)gcrypt_dh_create);
- lib->crypto->add_dh(lib->crypto, MODP_1536_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_1536_BIT, get_name(this),
(dh_constructor_t)gcrypt_dh_create);
- lib->crypto->add_dh(lib->crypto, MODP_3072_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_3072_BIT, get_name(this),
(dh_constructor_t)gcrypt_dh_create);
- lib->crypto->add_dh(lib->crypto, MODP_4096_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_4096_BIT, get_name(this),
(dh_constructor_t)gcrypt_dh_create);
- lib->crypto->add_dh(lib->crypto, MODP_6144_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_6144_BIT, get_name(this),
(dh_constructor_t)gcrypt_dh_create);
- lib->crypto->add_dh(lib->crypto, MODP_8192_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_8192_BIT, get_name(this),
(dh_constructor_t)gcrypt_dh_create);
- lib->crypto->add_dh(lib->crypto, MODP_1024_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_1024_BIT, get_name(this),
(dh_constructor_t)gcrypt_dh_create);
- lib->crypto->add_dh(lib->crypto, MODP_1024_160, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_1024_160, get_name(this),
(dh_constructor_t)gcrypt_dh_create);
- lib->crypto->add_dh(lib->crypto, MODP_768_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_768_BIT, get_name(this),
(dh_constructor_t)gcrypt_dh_create);
- lib->crypto->add_dh(lib->crypto, MODP_CUSTOM, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_CUSTOM, get_name(this),
(dh_constructor_t)gcrypt_dh_create_custom);
/* RSA */
diff --git a/src/libstrongswan/plugins/gmp/Makefile.in b/src/libstrongswan/plugins/gmp/Makefile.in
index f73bfb406..18592ab4a 100644
--- a/src/libstrongswan/plugins/gmp/Makefile.in
+++ b/src/libstrongswan/plugins/gmp/Makefile.in
@@ -241,6 +241,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -264,6 +266,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/gmp/gmp_plugin.c b/src/libstrongswan/plugins/gmp/gmp_plugin.c
index e9bfbcc28..55ccd4a4f 100644
--- a/src/libstrongswan/plugins/gmp/gmp_plugin.c
+++ b/src/libstrongswan/plugins/gmp/gmp_plugin.c
@@ -20,8 +20,6 @@
#include "gmp_rsa_private_key.h"
#include "gmp_rsa_public_key.h"
-static const char *plugin_name = "gmp";
-
typedef struct private_gmp_plugin_t private_gmp_plugin_t;
/**
@@ -35,6 +33,12 @@ struct private_gmp_plugin_t {
gmp_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_gmp_plugin_t *this)
+{
+ return "gmp";
+}
+
METHOD(plugin_t, destroy, void,
private_gmp_plugin_t *this)
{
@@ -61,35 +65,37 @@ plugin_t *gmp_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
);
- lib->crypto->add_dh(lib->crypto, MODP_2048_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_2048_BIT, get_name(this),
(dh_constructor_t)gmp_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_2048_224, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_2048_224, get_name(this),
(dh_constructor_t)gmp_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_2048_256, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_2048_256, get_name(this),
(dh_constructor_t)gmp_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_1536_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_1536_BIT, get_name(this),
(dh_constructor_t)gmp_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_3072_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_3072_BIT, get_name(this),
(dh_constructor_t)gmp_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_4096_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_4096_BIT, get_name(this),
(dh_constructor_t)gmp_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_6144_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_6144_BIT, get_name(this),
(dh_constructor_t)gmp_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_8192_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_8192_BIT, get_name(this),
(dh_constructor_t)gmp_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_1024_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_1024_BIT, get_name(this),
(dh_constructor_t)gmp_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_1024_160, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_1024_160, get_name(this),
(dh_constructor_t)gmp_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_768_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_768_BIT, get_name(this),
(dh_constructor_t)gmp_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_CUSTOM, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_CUSTOM, get_name(this),
(dh_constructor_t)gmp_diffie_hellman_create_custom);
lib->creds->add_builder(lib->creds, CRED_PRIVATE_KEY, KEY_RSA, FALSE,
diff --git a/src/libstrongswan/plugins/hmac/Makefile.in b/src/libstrongswan/plugins/hmac/Makefile.in
index 72cc23b72..b9e2cd817 100644
--- a/src/libstrongswan/plugins/hmac/Makefile.in
+++ b/src/libstrongswan/plugins/hmac/Makefile.in
@@ -241,6 +241,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -264,6 +266,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/hmac/hmac.c b/src/libstrongswan/plugins/hmac/hmac.c
index c7b2739df..397a1ea11 100644
--- a/src/libstrongswan/plugins/hmac/hmac.c
+++ b/src/libstrongswan/plugins/hmac/hmac.c
@@ -147,8 +147,8 @@ METHOD(hmac_t, destroy, void,
private_hmac_t *this)
{
this->h->destroy(this->h);
- free(this->opaded_key.ptr);
- free(this->ipaded_key.ptr);
+ chunk_clear(&this->opaded_key);
+ chunk_clear(&this->ipaded_key);
free(this);
}
diff --git a/src/libstrongswan/plugins/hmac/hmac_plugin.c b/src/libstrongswan/plugins/hmac/hmac_plugin.c
index 76d6157ae..47d6d3cde 100644
--- a/src/libstrongswan/plugins/hmac/hmac_plugin.c
+++ b/src/libstrongswan/plugins/hmac/hmac_plugin.c
@@ -19,8 +19,6 @@
#include "hmac_signer.h"
#include "hmac_prf.h"
-static const char *plugin_name = "hmac";
-
typedef struct private_hmac_plugin_t private_hmac_plugin_t;
/**
@@ -34,6 +32,12 @@ struct private_hmac_plugin_t {
hmac_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_hmac_plugin_t *this)
+{
+ return "hmac";
+}
+
METHOD(plugin_t, destroy, void,
private_hmac_plugin_t *this)
{
@@ -55,6 +59,8 @@ plugin_t *hmac_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
@@ -64,24 +70,24 @@ plugin_t *hmac_plugin_create()
if (hasher)
{
hasher->destroy(hasher);
- lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA1, plugin_name,
+ lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA1, get_name(this),
(prf_constructor_t)hmac_prf_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA1_96, plugin_name,
+ lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA1_96, get_name(this),
(signer_constructor_t)hmac_signer_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA1_128, plugin_name,
+ lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA1_128, get_name(this),
(signer_constructor_t)hmac_signer_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA1_160, plugin_name,
+ lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA1_160, get_name(this),
(signer_constructor_t)hmac_signer_create);
}
hasher = lib->crypto->create_hasher(lib->crypto, HASH_SHA256);
if (hasher)
{
hasher->destroy(hasher);
- lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA2_256, plugin_name,
+ lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA2_256, get_name(this),
(prf_constructor_t)hmac_prf_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_256_128, plugin_name,
+ lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_256_128, get_name(this),
(signer_constructor_t)hmac_signer_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_256_256, plugin_name,
+ lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_256_256, get_name(this),
(signer_constructor_t)hmac_signer_create);
}
@@ -89,31 +95,31 @@ plugin_t *hmac_plugin_create()
if (hasher)
{
hasher->destroy(hasher);
- lib->crypto->add_prf(lib->crypto, PRF_HMAC_MD5, plugin_name,
+ lib->crypto->add_prf(lib->crypto, PRF_HMAC_MD5, get_name(this),
(prf_constructor_t)hmac_prf_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_MD5_96, plugin_name,
+ lib->crypto->add_signer(lib->crypto, AUTH_HMAC_MD5_96, get_name(this),
(signer_constructor_t)hmac_signer_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_MD5_128, plugin_name,
+ lib->crypto->add_signer(lib->crypto, AUTH_HMAC_MD5_128, get_name(this),
(signer_constructor_t)hmac_signer_create);
}
hasher = lib->crypto->create_hasher(lib->crypto, HASH_SHA384);
if (hasher)
{
hasher->destroy(hasher);
- lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA2_384, plugin_name,
+ lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA2_384, get_name(this),
(prf_constructor_t)hmac_prf_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_384_192, plugin_name,
+ lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_384_192, get_name(this),
(signer_constructor_t)hmac_signer_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_384_384, plugin_name,
+ lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_384_384, get_name(this),
(signer_constructor_t)hmac_signer_create);
}
hasher = lib->crypto->create_hasher(lib->crypto, HASH_SHA512);
if (hasher)
{
hasher->destroy(hasher);
- lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA2_512, plugin_name,
+ lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA2_512, get_name(this),
(prf_constructor_t)hmac_prf_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_512_256, plugin_name,
+ lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_512_256, get_name(this),
(signer_constructor_t)hmac_signer_create);
}
diff --git a/src/libstrongswan/plugins/ldap/Makefile.in b/src/libstrongswan/plugins/ldap/Makefile.in
index 7235784e2..b496ace28 100644
--- a/src/libstrongswan/plugins/ldap/Makefile.in
+++ b/src/libstrongswan/plugins/ldap/Makefile.in
@@ -240,6 +240,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -263,6 +265,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/ldap/ldap_fetcher.c b/src/libstrongswan/plugins/ldap/ldap_fetcher.c
index e6c592217..fc6114b0a 100644
--- a/src/libstrongswan/plugins/ldap/ldap_fetcher.c
+++ b/src/libstrongswan/plugins/ldap/ldap_fetcher.c
@@ -101,7 +101,7 @@ static bool parse(LDAP *ldap, LDAPMessage *result, chunk_t *response)
METHOD(fetcher_t, fetch, status_t,
- private_ldap_fetcher_t *this, char *url, chunk_t *result)
+ private_ldap_fetcher_t *this, char *url, void *userdata)
{
LDAP *ldap;
LDAPURLDesc *lurl;
@@ -110,6 +110,7 @@ METHOD(fetcher_t, fetch, status_t,
int ldap_version = LDAP_VERSION3;
struct timeval timeout;
status_t status = FAILED;
+ chunk_t *result = userdata;
if (!strneq(url, "ldap", 4))
{
diff --git a/src/libstrongswan/plugins/ldap/ldap_plugin.c b/src/libstrongswan/plugins/ldap/ldap_plugin.c
index 3682ddd1f..08d9748ce 100644
--- a/src/libstrongswan/plugins/ldap/ldap_plugin.c
+++ b/src/libstrongswan/plugins/ldap/ldap_plugin.c
@@ -31,6 +31,12 @@ struct private_ldap_plugin_t {
ldap_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_ldap_plugin_t *this)
+{
+ return "ldap";
+}
+
METHOD(plugin_t, destroy, void,
private_ldap_plugin_t *this)
{
@@ -49,6 +55,8 @@ plugin_t *ldap_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
diff --git a/src/libstrongswan/plugins/md4/Makefile.in b/src/libstrongswan/plugins/md4/Makefile.in
index ea1a7a69a..82781054b 100644
--- a/src/libstrongswan/plugins/md4/Makefile.in
+++ b/src/libstrongswan/plugins/md4/Makefile.in
@@ -240,6 +240,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -263,6 +265,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/md4/md4_plugin.c b/src/libstrongswan/plugins/md4/md4_plugin.c
index cea1a61f3..371bba280 100644
--- a/src/libstrongswan/plugins/md4/md4_plugin.c
+++ b/src/libstrongswan/plugins/md4/md4_plugin.c
@@ -18,8 +18,6 @@
#include <library.h>
#include "md4_hasher.h"
-static const char *plugin_name = "md4";
-
typedef struct private_md4_plugin_t private_md4_plugin_t;
/**
@@ -33,6 +31,12 @@ struct private_md4_plugin_t {
md4_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_md4_plugin_t *this)
+{
+ return "md4";
+}
+
METHOD(plugin_t, destroy, void,
private_md4_plugin_t *this)
{
@@ -51,12 +55,14 @@ plugin_t *md4_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
);
- lib->crypto->add_hasher(lib->crypto, HASH_MD4, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_MD4, get_name(this),
(hasher_constructor_t)md4_hasher_create);
return &this->public.plugin;
diff --git a/src/libstrongswan/plugins/md5/Makefile.in b/src/libstrongswan/plugins/md5/Makefile.in
index 05f101564..0e3c37e7e 100644
--- a/src/libstrongswan/plugins/md5/Makefile.in
+++ b/src/libstrongswan/plugins/md5/Makefile.in
@@ -240,6 +240,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -263,6 +265,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/md5/md5_plugin.c b/src/libstrongswan/plugins/md5/md5_plugin.c
index d11173817..c72284193 100644
--- a/src/libstrongswan/plugins/md5/md5_plugin.c
+++ b/src/libstrongswan/plugins/md5/md5_plugin.c
@@ -18,8 +18,6 @@
#include <library.h>
#include "md5_hasher.h"
-static const char *plugin_name = "md5";
-
typedef struct private_md5_plugin_t private_md5_plugin_t;
/**
@@ -33,6 +31,12 @@ struct private_md5_plugin_t {
md5_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_md5_plugin_t *this)
+{
+ return "md5";
+}
+
METHOD(plugin_t, destroy, void,
private_md5_plugin_t *this)
{
@@ -51,12 +55,14 @@ plugin_t *md5_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
);
- lib->crypto->add_hasher(lib->crypto, HASH_MD5, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_MD5, get_name(this),
(hasher_constructor_t)md5_hasher_create);
return &this->public.plugin;
diff --git a/src/libstrongswan/plugins/mysql/Makefile.in b/src/libstrongswan/plugins/mysql/Makefile.in
index 4880415b3..32067d5b4 100644
--- a/src/libstrongswan/plugins/mysql/Makefile.in
+++ b/src/libstrongswan/plugins/mysql/Makefile.in
@@ -242,6 +242,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -265,6 +267,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/mysql/mysql_plugin.c b/src/libstrongswan/plugins/mysql/mysql_plugin.c
index 65d8681cb..579df4d50 100644
--- a/src/libstrongswan/plugins/mysql/mysql_plugin.c
+++ b/src/libstrongswan/plugins/mysql/mysql_plugin.c
@@ -32,6 +32,12 @@ struct private_mysql_plugin_t {
mysql_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_mysql_plugin_t *this)
+{
+ return "mysql";
+}
+
METHOD(plugin_t, destroy, void,
private_mysql_plugin_t *this)
{
@@ -57,6 +63,8 @@ plugin_t *mysql_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
diff --git a/src/libstrongswan/plugins/openssl/Makefile.in b/src/libstrongswan/plugins/openssl/Makefile.in
index b43be29f1..d1c8fce81 100644
--- a/src/libstrongswan/plugins/openssl/Makefile.in
+++ b/src/libstrongswan/plugins/openssl/Makefile.in
@@ -247,6 +247,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -270,6 +272,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/openssl/openssl_crypter.c b/src/libstrongswan/plugins/openssl/openssl_crypter.c
index 2ed07ff0c..cd9a3bd4a 100644
--- a/src/libstrongswan/plugins/openssl/openssl_crypter.c
+++ b/src/libstrongswan/plugins/openssl/openssl_crypter.c
@@ -152,7 +152,7 @@ METHOD(crypter_t, set_key, void,
METHOD(crypter_t, destroy, void,
private_openssl_crypter_t *this)
{
- free(this->key.ptr);
+ chunk_clear(&this->key);
free(this);
}
diff --git a/src/libstrongswan/plugins/openssl/openssl_ec_diffie_hellman.c b/src/libstrongswan/plugins/openssl/openssl_ec_diffie_hellman.c
index 32fc2bccd..78ed2811a 100644
--- a/src/libstrongswan/plugins/openssl/openssl_ec_diffie_hellman.c
+++ b/src/libstrongswan/plugins/openssl/openssl_ec_diffie_hellman.c
@@ -257,7 +257,7 @@ METHOD(diffie_hellman_t, destroy, void,
{
EC_POINT_clear_free(this->pub_key);
EC_KEY_free(this->key);
- chunk_free(&this->shared_secret);
+ chunk_clear(&this->shared_secret);
free(this);
}
diff --git a/src/libstrongswan/plugins/openssl/openssl_plugin.c b/src/libstrongswan/plugins/openssl/openssl_plugin.c
index 0050572ee..96aa38bb6 100644
--- a/src/libstrongswan/plugins/openssl/openssl_plugin.c
+++ b/src/libstrongswan/plugins/openssl/openssl_plugin.c
@@ -41,8 +41,6 @@
#include "openssl_x509.h"
#include "openssl_crl.h"
-static const char *plugin_name = "openssl";
-
typedef struct private_openssl_plugin_t private_openssl_plugin_t;
/**
@@ -195,6 +193,12 @@ static void threading_cleanup()
mutex = NULL;
}
+METHOD(plugin_t, get_name, char*,
+ private_openssl_plugin_t *this)
+{
+ return "openssl";
+}
+
METHOD(plugin_t, destroy, void,
private_openssl_plugin_t *this)
{
@@ -250,6 +254,8 @@ plugin_t *openssl_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
@@ -274,85 +280,85 @@ plugin_t *openssl_plugin_create()
}
/* crypter */
- lib->crypto->add_crypter(lib->crypto, ENCR_AES_CBC, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_AES_CBC, get_name(this),
(crypter_constructor_t)openssl_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_CAMELLIA_CBC, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_CAMELLIA_CBC, get_name(this),
(crypter_constructor_t)openssl_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_3DES, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_3DES, get_name(this),
(crypter_constructor_t)openssl_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_RC5, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_RC5, get_name(this),
(crypter_constructor_t)openssl_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_IDEA, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_IDEA, get_name(this),
(crypter_constructor_t)openssl_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_CAST, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_CAST, get_name(this),
(crypter_constructor_t)openssl_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_BLOWFISH, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_BLOWFISH, get_name(this),
(crypter_constructor_t)openssl_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_DES, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_DES, get_name(this),
(crypter_constructor_t)openssl_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_DES_ECB, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_DES_ECB, get_name(this),
(crypter_constructor_t)openssl_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_NULL, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_NULL, get_name(this),
(crypter_constructor_t)openssl_crypter_create);
/* hasher */
- lib->crypto->add_hasher(lib->crypto, HASH_SHA1, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA1, get_name(this),
(hasher_constructor_t)openssl_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_MD2, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_MD2, get_name(this),
(hasher_constructor_t)openssl_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_MD4, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_MD4, get_name(this),
(hasher_constructor_t)openssl_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_MD5, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_MD5, get_name(this),
(hasher_constructor_t)openssl_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_SHA224, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA224, get_name(this),
(hasher_constructor_t)openssl_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_SHA256, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA256, get_name(this),
(hasher_constructor_t)openssl_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_SHA384, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA384, get_name(this),
(hasher_constructor_t)openssl_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_SHA512, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA512, get_name(this),
(hasher_constructor_t)openssl_hasher_create);
/* prf */
- lib->crypto->add_prf(lib->crypto, PRF_KEYED_SHA1, plugin_name,
+ lib->crypto->add_prf(lib->crypto, PRF_KEYED_SHA1, get_name(this),
(prf_constructor_t)openssl_sha1_prf_create);
/* (ec) diffie hellman */
- lib->crypto->add_dh(lib->crypto, MODP_2048_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_2048_BIT, get_name(this),
(dh_constructor_t)openssl_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_2048_224, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_2048_224, get_name(this),
(dh_constructor_t)openssl_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_2048_256, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_2048_256, get_name(this),
(dh_constructor_t)openssl_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_1536_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_1536_BIT, get_name(this),
(dh_constructor_t)openssl_diffie_hellman_create);
#ifndef OPENSSL_NO_EC
- lib->crypto->add_dh(lib->crypto, ECP_256_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, ECP_256_BIT, get_name(this),
(dh_constructor_t)openssl_ec_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, ECP_384_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, ECP_384_BIT, get_name(this),
(dh_constructor_t)openssl_ec_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, ECP_521_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, ECP_521_BIT, get_name(this),
(dh_constructor_t)openssl_ec_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, ECP_224_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, ECP_224_BIT, get_name(this),
(dh_constructor_t)openssl_ec_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, ECP_192_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, ECP_192_BIT, get_name(this),
(dh_constructor_t)openssl_ec_diffie_hellman_create);
#endif /* OPENSSL_NO_EC */
- lib->crypto->add_dh(lib->crypto, MODP_3072_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_3072_BIT, get_name(this),
(dh_constructor_t)openssl_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_4096_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_4096_BIT, get_name(this),
(dh_constructor_t)openssl_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_6144_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_6144_BIT, get_name(this),
(dh_constructor_t)openssl_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_8192_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_8192_BIT, get_name(this),
(dh_constructor_t)openssl_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_1024_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_1024_BIT, get_name(this),
(dh_constructor_t)openssl_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_1024_160, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_1024_160, get_name(this),
(dh_constructor_t)openssl_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_768_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_768_BIT, get_name(this),
(dh_constructor_t)openssl_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_CUSTOM, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_CUSTOM, get_name(this),
(dh_constructor_t)openssl_diffie_hellman_create);
/* rsa */
diff --git a/src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c b/src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c
index 0b607c386..d1afd94cc 100644
--- a/src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c
+++ b/src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c
@@ -455,6 +455,7 @@ openssl_rsa_private_key_t *openssl_rsa_private_key_load(key_type_t type,
return NULL;
}
+#ifndef OPENSSL_NO_ENGINE
/**
* Login to engine with a PIN specified for a keyid
*/
@@ -496,6 +497,7 @@ static bool login(ENGINE *engine, chunk_t keyid)
}
return success;
}
+#endif /* OPENSSL_NO_ENGINE */
/**
* See header.
diff --git a/src/libstrongswan/plugins/padlock/Makefile.in b/src/libstrongswan/plugins/padlock/Makefile.in
index 7c89d0abd..7bc342995 100644
--- a/src/libstrongswan/plugins/padlock/Makefile.in
+++ b/src/libstrongswan/plugins/padlock/Makefile.in
@@ -243,6 +243,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -266,6 +268,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/padlock/padlock_aes_crypter.c b/src/libstrongswan/plugins/padlock/padlock_aes_crypter.c
index 06c20292f..119de86aa 100644
--- a/src/libstrongswan/plugins/padlock/padlock_aes_crypter.c
+++ b/src/libstrongswan/plugins/padlock/padlock_aes_crypter.c
@@ -105,6 +105,8 @@ static void crypt(private_padlock_aes_crypter_t *this, char *iv,
*dst = chunk_alloc(src.len);
padlock_crypt(key_aligned, &cword, src.ptr, dst->ptr,
src.len / AES_BLOCK_SIZE, iv_aligned);
+
+ memwipe(key_aligned, sizeof(key_aligned));
}
METHOD(crypter_t, decrypt, void,
@@ -146,7 +148,7 @@ METHOD(crypter_t, set_key, void,
METHOD(crypter_t, destroy, void,
private_padlock_aes_crypter_t *this)
{
- free(this->key.ptr);
+ chunk_clear(&this->key);
free(this);
}
diff --git a/src/libstrongswan/plugins/padlock/padlock_plugin.c b/src/libstrongswan/plugins/padlock/padlock_plugin.c
index 695823acf..9d4afd8e8 100644
--- a/src/libstrongswan/plugins/padlock/padlock_plugin.c
+++ b/src/libstrongswan/plugins/padlock/padlock_plugin.c
@@ -23,8 +23,6 @@
#include <library.h>
#include <debug.h>
-static const char *plugin_name = "padlock";
-
typedef struct private_padlock_plugin_t private_padlock_plugin_t;
typedef enum padlock_feature_t padlock_feature_t;
@@ -103,6 +101,12 @@ static padlock_feature_t get_padlock_features()
return 0;
}
+METHOD(plugin_t, get_name, char*,
+ private_padlock_plugin_t *this)
+{
+ return "padlock";
+}
+
METHOD(plugin_t, destroy, void,
private_padlock_plugin_t *this)
{
@@ -138,6 +142,8 @@ plugin_t *padlock_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
@@ -163,21 +169,21 @@ plugin_t *padlock_plugin_create()
if (this->features & PADLOCK_RNG_ENABLED)
{
- lib->crypto->add_rng(lib->crypto, RNG_TRUE, plugin_name,
+ lib->crypto->add_rng(lib->crypto, RNG_TRUE, get_name(this),
(rng_constructor_t)padlock_rng_create);
- lib->crypto->add_rng(lib->crypto, RNG_STRONG, plugin_name,
+ lib->crypto->add_rng(lib->crypto, RNG_STRONG, get_name(this),
(rng_constructor_t)padlock_rng_create);
- lib->crypto->add_rng(lib->crypto, RNG_WEAK, plugin_name,
+ lib->crypto->add_rng(lib->crypto, RNG_WEAK, get_name(this),
(rng_constructor_t)padlock_rng_create);
}
if (this->features & PADLOCK_ACE2_ENABLED)
{
- lib->crypto->add_crypter(lib->crypto, ENCR_AES_CBC, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_AES_CBC, get_name(this),
(crypter_constructor_t)padlock_aes_crypter_create);
}
if (this->features & PADLOCK_PHE_ENABLED)
{
- lib->crypto->add_hasher(lib->crypto, HASH_SHA1, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA1, get_name(this),
(hasher_constructor_t)padlock_sha1_hasher_create);
}
return &this->public.plugin;
diff --git a/src/libstrongswan/plugins/pem/Makefile.in b/src/libstrongswan/plugins/pem/Makefile.in
index 60740eb35..92c7fa2fe 100644
--- a/src/libstrongswan/plugins/pem/Makefile.in
+++ b/src/libstrongswan/plugins/pem/Makefile.in
@@ -241,6 +241,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -264,6 +266,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/pem/pem_plugin.c b/src/libstrongswan/plugins/pem/pem_plugin.c
index f2415a318..c81605ae5 100644
--- a/src/libstrongswan/plugins/pem/pem_plugin.c
+++ b/src/libstrongswan/plugins/pem/pem_plugin.c
@@ -33,6 +33,12 @@ struct private_pem_plugin_t {
pem_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_pem_plugin_t *this)
+{
+ return "pem";
+}
+
METHOD(plugin_t, destroy, void,
private_pem_plugin_t *this)
{
@@ -55,6 +61,8 @@ plugin_t *pem_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
diff --git a/src/libstrongswan/plugins/pgp/Makefile.in b/src/libstrongswan/plugins/pgp/Makefile.in
index ab14f8ced..6be915f29 100644
--- a/src/libstrongswan/plugins/pgp/Makefile.in
+++ b/src/libstrongswan/plugins/pgp/Makefile.in
@@ -241,6 +241,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -264,6 +266,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/pgp/pgp_plugin.c b/src/libstrongswan/plugins/pgp/pgp_plugin.c
index eaf0a1088..52e9d96b1 100644
--- a/src/libstrongswan/plugins/pgp/pgp_plugin.c
+++ b/src/libstrongswan/plugins/pgp/pgp_plugin.c
@@ -33,6 +33,12 @@ struct private_pgp_plugin_t {
pgp_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_pgp_plugin_t *this)
+{
+ return "pgp";
+}
+
METHOD(plugin_t, destroy, void,
private_pgp_plugin_t *this)
{
@@ -59,6 +65,8 @@ plugin_t *pgp_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
diff --git a/src/libstrongswan/plugins/pkcs1/Makefile.in b/src/libstrongswan/plugins/pkcs1/Makefile.in
index 8ed4a08e9..1ae880c3b 100644
--- a/src/libstrongswan/plugins/pkcs1/Makefile.in
+++ b/src/libstrongswan/plugins/pkcs1/Makefile.in
@@ -242,6 +242,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -265,6 +267,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/pkcs1/pkcs1_builder.c b/src/libstrongswan/plugins/pkcs1/pkcs1_builder.c
index 88c848899..a605fabc7 100644
--- a/src/libstrongswan/plugins/pkcs1/pkcs1_builder.c
+++ b/src/libstrongswan/plugins/pkcs1/pkcs1_builder.c
@@ -57,7 +57,7 @@ static public_key_t *parse_public_key(chunk_t blob)
int oid = asn1_parse_algorithmIdentifier(object,
parser->get_level(parser)+1, NULL);
- if (oid == OID_RSA_ENCRYPTION)
+ if (oid == OID_RSA_ENCRYPTION || oid == OID_RSAES_OAEP)
{
type = KEY_RSA;
}
diff --git a/src/libstrongswan/plugins/pkcs1/pkcs1_plugin.c b/src/libstrongswan/plugins/pkcs1/pkcs1_plugin.c
index 33732f8a4..e0e24cab2 100644
--- a/src/libstrongswan/plugins/pkcs1/pkcs1_plugin.c
+++ b/src/libstrongswan/plugins/pkcs1/pkcs1_plugin.c
@@ -32,6 +32,12 @@ struct private_pkcs1_plugin_t {
pkcs1_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_pkcs1_plugin_t *this)
+{
+ return "pkcs1";
+}
+
METHOD(plugin_t, destroy, void,
private_pkcs1_plugin_t *this)
{
@@ -55,6 +61,8 @@ plugin_t *pkcs1_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
diff --git a/src/libstrongswan/plugins/pkcs11/Makefile.in b/src/libstrongswan/plugins/pkcs11/Makefile.in
index 6c03b0497..1a67f88cc 100644
--- a/src/libstrongswan/plugins/pkcs11/Makefile.in
+++ b/src/libstrongswan/plugins/pkcs11/Makefile.in
@@ -244,6 +244,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -267,6 +269,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/pkcs11/pkcs11_manager.c b/src/libstrongswan/plugins/pkcs11/pkcs11_manager.c
index 9308e9c25..431cd6a2c 100644
--- a/src/libstrongswan/plugins/pkcs11/pkcs11_manager.c
+++ b/src/libstrongswan/plugins/pkcs11/pkcs11_manager.c
@@ -369,7 +369,7 @@ pkcs11_manager_t *pkcs11_manager_create(pkcs11_manager_token_event_t cb,
"libstrongswan.plugins.pkcs11.modules.%s.path", NULL, module);
if (!entry->path)
{
- DBG1(DBG_CFG, "PKCS11 module '%s' misses library path", module);
+ DBG1(DBG_CFG, "PKCS11 module '%s' lacks library path", module);
free(entry);
continue;
}
diff --git a/src/libstrongswan/plugins/pkcs11/pkcs11_plugin.c b/src/libstrongswan/plugins/pkcs11/pkcs11_plugin.c
index 071d2f782..7b537cfa7 100644
--- a/src/libstrongswan/plugins/pkcs11/pkcs11_plugin.c
+++ b/src/libstrongswan/plugins/pkcs11/pkcs11_plugin.c
@@ -26,8 +26,6 @@
#include "pkcs11_public_key.h"
#include "pkcs11_hasher.h"
-static const char *plugin_name = "pkcs11";
-
typedef struct private_pkcs11_plugin_t private_pkcs11_plugin_t;
/**
@@ -103,6 +101,12 @@ static void token_event_cb(private_pkcs11_plugin_t *this, pkcs11_library_t *p11,
}
}
+METHOD(plugin_t, get_name, char*,
+ private_pkcs11_plugin_t *this)
+{
+ return "pkcs11";
+}
+
METHOD(plugin_t, destroy, void,
private_pkcs11_plugin_t *this)
{
@@ -136,6 +140,8 @@ plugin_t *pkcs11_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
@@ -148,17 +154,17 @@ plugin_t *pkcs11_plugin_create()
if (lib->settings->get_bool(lib->settings,
"libstrongswan.plugins.pkcs11.use_hasher", FALSE))
{
- lib->crypto->add_hasher(lib->crypto, HASH_MD2, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_MD2, get_name(this),
(hasher_constructor_t)pkcs11_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_MD5, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_MD5, get_name(this),
(hasher_constructor_t)pkcs11_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_SHA1, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA1, get_name(this),
(hasher_constructor_t)pkcs11_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_SHA256, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA256, get_name(this),
(hasher_constructor_t)pkcs11_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_SHA384, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA384, get_name(this),
(hasher_constructor_t)pkcs11_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_SHA512, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA512, get_name(this),
(hasher_constructor_t)pkcs11_hasher_create);
}
diff --git a/src/libstrongswan/plugins/plugin.h b/src/libstrongswan/plugins/plugin.h
index 6d8a370fb..5c92fd1d8 100644
--- a/src/libstrongswan/plugins/plugin.h
+++ b/src/libstrongswan/plugins/plugin.h
@@ -21,6 +21,8 @@
#ifndef PLUGIN_H_
#define PLUGIN_H_
+#include <utils.h>
+
typedef struct plugin_t plugin_t;
/**
@@ -29,6 +31,20 @@ typedef struct plugin_t plugin_t;
struct plugin_t {
/**
+ * Get the name of the plugin.
+ *
+ * @return plugin name
+ */
+ char* (*get_name)(plugin_t *this);
+
+ /**
+ * Try to reload plugin configuration.
+ *
+ * @return TRUE if reloaded, FALSE if reloading not supporty by plugin
+ */
+ bool (*reload)(plugin_t *this);
+
+ /**
* Destroy a plugin instance.
*/
void (*destroy)(plugin_t *this);
diff --git a/src/libstrongswan/plugins/plugin_loader.c b/src/libstrongswan/plugins/plugin_loader.c
index 473db5ccf..b4d7bf7c7 100644
--- a/src/libstrongswan/plugins/plugin_loader.c
+++ b/src/libstrongswan/plugins/plugin_loader.c
@@ -43,11 +43,6 @@ struct private_plugin_loader_t {
* list of loaded plugins
*/
linked_list_t *plugins;
-
- /**
- * names of loaded plugins
- */
- linked_list_t *names;
};
/**
@@ -70,8 +65,6 @@ static status_t create_plugin(private_plugin_loader_t *this, void *handle,
constructor = dlsym(handle, create);
if (constructor == NULL)
{
- DBG2(DBG_LIB, "plugin '%s': failed to load - %s not found", name,
- create);
return NOT_FOUND;
}
if (integrity && lib->integrity)
@@ -153,12 +146,12 @@ static bool plugin_loaded(private_plugin_loader_t *this, char *name)
{
enumerator_t *enumerator;
bool found = FALSE;
- char *current;
+ plugin_t *plugin;
- enumerator = this->names->create_enumerator(this->names);
- while (enumerator->enumerate(enumerator, &current))
+ enumerator = this->plugins->create_enumerator(this->plugins);
+ while (enumerator->enumerate(enumerator, &plugin))
{
- if (streq(name, current))
+ if (streq(plugin->get_name(plugin), name))
{
found = TRUE;
break;
@@ -168,10 +161,8 @@ static bool plugin_loaded(private_plugin_loader_t *this, char *name)
return found;
}
-/**
- * Implementation of plugin_loader_t.load_plugins.
- */
-static bool load(private_plugin_loader_t *this, char *path, char *list)
+METHOD(plugin_loader_t, load_plugins, bool,
+ private_plugin_loader_t *this, char *path, char *list)
{
enumerator_t *enumerator;
char *token;
@@ -205,7 +196,6 @@ static bool load(private_plugin_loader_t *this, char *path, char *list)
if (plugin)
{
this->plugins->insert_last(this->plugins, plugin);
- this->names->insert_last(this->names, token);
}
else
{
@@ -214,20 +204,17 @@ static bool load(private_plugin_loader_t *this, char *path, char *list)
critical_failed = TRUE;
DBG1(DBG_LIB, "loading critical plugin '%s' failed", token);
}
- free(token);
}
+ free(token);
}
enumerator->destroy(enumerator);
return !critical_failed;
}
-/**
- * Implementation of plugin_loader_t.unload
- */
-static void unload(private_plugin_loader_t *this)
+METHOD(plugin_loader_t, unload, void,
+ private_plugin_loader_t *this)
{
plugin_t *plugin;
- char *name;
/* unload plugins in reverse order */
while (this->plugins->remove_last(this->plugins,
@@ -235,27 +222,64 @@ static void unload(private_plugin_loader_t *this)
{
plugin->destroy(plugin);
}
- while (this->names->remove_last(this->names, (void**)&name) == SUCCESS)
- {
- free(name);
- }
}
-/**
- * Implementation of plugin_loader_t.create_plugin_enumerator
- */
-static enumerator_t* create_plugin_enumerator(private_plugin_loader_t *this)
+METHOD(plugin_loader_t, create_plugin_enumerator, enumerator_t*,
+ private_plugin_loader_t *this)
{
- return this->names->create_enumerator(this->names);
+ return this->plugins->create_enumerator(this->plugins);
}
/**
- * Implementation of plugin_loader_t.destroy
+ * Reload a plugin by name, NULL for all
*/
-static void destroy(private_plugin_loader_t *this)
+static u_int reload_by_name(private_plugin_loader_t *this, char *name)
+{
+ u_int reloaded = 0;
+ enumerator_t *enumerator;
+ plugin_t *plugin;
+
+ enumerator = create_plugin_enumerator(this);
+ while (enumerator->enumerate(enumerator, &plugin))
+ {
+ if (name == NULL || streq(name, plugin->get_name(plugin)))
+ {
+ if (plugin->reload(plugin))
+ {
+ DBG2(DBG_LIB, "reloaded configuration of '%s' plugin",
+ plugin->get_name(plugin));
+ reloaded++;
+ }
+ }
+ }
+ enumerator->destroy(enumerator);
+ return reloaded;
+}
+
+METHOD(plugin_loader_t, reload, u_int,
+ private_plugin_loader_t *this, char *list)
+{
+ u_int reloaded = 0;
+ enumerator_t *enumerator;
+ char *name;
+
+ if (list == NULL)
+ {
+ return reload_by_name(this, NULL);
+ }
+ enumerator = enumerator_create_token(list, " ", "");
+ while (enumerator->enumerate(enumerator, &name))
+ {
+ reloaded += reload_by_name(this, name);
+ }
+ enumerator->destroy(enumerator);
+ return reloaded;
+}
+
+METHOD(plugin_loader_t, destroy, void,
+ private_plugin_loader_t *this)
{
this->plugins->destroy_offset(this->plugins, offsetof(plugin_t, destroy));
- this->names->destroy_function(this->names, free);
free(this);
}
@@ -264,15 +288,18 @@ static void destroy(private_plugin_loader_t *this)
*/
plugin_loader_t *plugin_loader_create()
{
- private_plugin_loader_t *this = malloc_thing(private_plugin_loader_t);
-
- this->public.load = (bool(*)(plugin_loader_t*, char *path, char *prefix))load;
- this->public.unload = (void(*)(plugin_loader_t*))unload;
- this->public.create_plugin_enumerator = (enumerator_t*(*)(plugin_loader_t*))create_plugin_enumerator;
- this->public.destroy = (void(*)(plugin_loader_t*))destroy;
+ private_plugin_loader_t *this;
- this->plugins = linked_list_create();
- this->names = linked_list_create();
+ INIT(this,
+ .public = {
+ .load = _load_plugins,
+ .reload = _reload,
+ .unload = _unload,
+ .create_plugin_enumerator = _create_plugin_enumerator,
+ .destroy = _destroy,
+ },
+ .plugins = linked_list_create(),
+ );
return &this->public;
}
diff --git a/src/libstrongswan/plugins/plugin_loader.h b/src/libstrongswan/plugins/plugin_loader.h
index f72c91c60..e03da4543 100644
--- a/src/libstrongswan/plugins/plugin_loader.h
+++ b/src/libstrongswan/plugins/plugin_loader.h
@@ -44,14 +44,22 @@ struct plugin_loader_t {
bool (*load)(plugin_loader_t *this, char *path, char *list);
/**
+ * Reload the configuration of one or multiple plugins.
+ *
+ * @param space separated plugin names to reload, NULL for all
+ * @return number of plugins that did support reloading
+ */
+ u_int (*reload)(plugin_loader_t *this, char *list);
+
+ /**
* Unload all loaded plugins.
*/
void (*unload)(plugin_loader_t *this);
/**
- * Create an enumerator over all loaded plugin names.
+ * Create an enumerator over all loaded plugins.
*
- * @return enumerator over char*
+ * @return enumerator over plugin_t*
*/
enumerator_t* (*create_plugin_enumerator)(plugin_loader_t *this);
diff --git a/src/libstrongswan/plugins/pubkey/Makefile.in b/src/libstrongswan/plugins/pubkey/Makefile.in
index 46349f9ba..97fba22fc 100644
--- a/src/libstrongswan/plugins/pubkey/Makefile.in
+++ b/src/libstrongswan/plugins/pubkey/Makefile.in
@@ -242,6 +242,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -265,6 +267,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/pubkey/pubkey_plugin.c b/src/libstrongswan/plugins/pubkey/pubkey_plugin.c
index cc12217a4..ae6607e5a 100644
--- a/src/libstrongswan/plugins/pubkey/pubkey_plugin.c
+++ b/src/libstrongswan/plugins/pubkey/pubkey_plugin.c
@@ -31,6 +31,12 @@ struct private_pubkey_plugin_t {
pubkey_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_pubkey_plugin_t *this)
+{
+ return "pubkey";
+}
+
METHOD(plugin_t, destroy, void,
private_pubkey_plugin_t *this)
{
@@ -49,6 +55,8 @@ plugin_t *pubkey_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
diff --git a/src/libstrongswan/plugins/random/Makefile.in b/src/libstrongswan/plugins/random/Makefile.in
index 21f8aff11..761d2c96e 100644
--- a/src/libstrongswan/plugins/random/Makefile.in
+++ b/src/libstrongswan/plugins/random/Makefile.in
@@ -242,6 +242,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -265,6 +267,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/random/random_plugin.c b/src/libstrongswan/plugins/random/random_plugin.c
index cc5cb0a3c..00202a5a6 100644
--- a/src/libstrongswan/plugins/random/random_plugin.c
+++ b/src/libstrongswan/plugins/random/random_plugin.c
@@ -18,8 +18,6 @@
#include <library.h>
#include "random_rng.h"
-static const char *plugin_name = "random";
-
typedef struct private_random_plugin_t private_random_plugin_t;
/**
@@ -33,6 +31,12 @@ struct private_random_plugin_t {
random_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_random_plugin_t *this)
+{
+ return "random";
+}
+
METHOD(plugin_t, destroy, void,
private_random_plugin_t *this)
{
@@ -51,14 +55,16 @@ plugin_t *random_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
);
- lib->crypto->add_rng(lib->crypto, RNG_STRONG, plugin_name,
+ lib->crypto->add_rng(lib->crypto, RNG_STRONG, get_name(this),
(rng_constructor_t)random_rng_create);
- lib->crypto->add_rng(lib->crypto, RNG_TRUE, plugin_name,
+ lib->crypto->add_rng(lib->crypto, RNG_TRUE, get_name(this),
(rng_constructor_t)random_rng_create);
return &this->public.plugin;
diff --git a/src/libstrongswan/plugins/revocation/Makefile.in b/src/libstrongswan/plugins/revocation/Makefile.in
index 4ed4b9694..e8856b7d7 100644
--- a/src/libstrongswan/plugins/revocation/Makefile.in
+++ b/src/libstrongswan/plugins/revocation/Makefile.in
@@ -244,6 +244,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -267,6 +269,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/revocation/revocation_plugin.c b/src/libstrongswan/plugins/revocation/revocation_plugin.c
index 02393b907..fa04fb2a2 100644
--- a/src/libstrongswan/plugins/revocation/revocation_plugin.c
+++ b/src/libstrongswan/plugins/revocation/revocation_plugin.c
@@ -36,6 +36,12 @@ struct private_revocation_plugin_t {
revocation_validator_t *validator;
};
+METHOD(plugin_t, get_name, char*,
+ private_revocation_plugin_t *this)
+{
+ return "revocation";
+}
+
METHOD(plugin_t, destroy, void,
private_revocation_plugin_t *this)
{
@@ -54,6 +60,8 @@ plugin_t *revocation_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
diff --git a/src/libstrongswan/plugins/sha1/Makefile.in b/src/libstrongswan/plugins/sha1/Makefile.in
index 3d96f4339..b4b275648 100644
--- a/src/libstrongswan/plugins/sha1/Makefile.in
+++ b/src/libstrongswan/plugins/sha1/Makefile.in
@@ -241,6 +241,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -264,6 +266,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/sha1/sha1_plugin.c b/src/libstrongswan/plugins/sha1/sha1_plugin.c
index dda2cbc1a..a9b84e790 100644
--- a/src/libstrongswan/plugins/sha1/sha1_plugin.c
+++ b/src/libstrongswan/plugins/sha1/sha1_plugin.c
@@ -19,8 +19,6 @@
#include "sha1_hasher.h"
#include "sha1_prf.h"
-static const char *plugin_name = "sha1";
-
typedef struct private_sha1_plugin_t private_sha1_plugin_t;
/**
@@ -34,6 +32,12 @@ struct private_sha1_plugin_t {
sha1_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_sha1_plugin_t *this)
+{
+ return "sha1";
+}
+
METHOD(plugin_t, destroy, void,
private_sha1_plugin_t *this)
{
@@ -54,14 +58,16 @@ plugin_t *sha1_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
);
- lib->crypto->add_hasher(lib->crypto, HASH_SHA1, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA1, get_name(this),
(hasher_constructor_t)sha1_hasher_create);
- lib->crypto->add_prf(lib->crypto, PRF_KEYED_SHA1, plugin_name,
+ lib->crypto->add_prf(lib->crypto, PRF_KEYED_SHA1, get_name(this),
(prf_constructor_t)sha1_prf_create);
return &this->public.plugin;
diff --git a/src/libstrongswan/plugins/sha2/Makefile.in b/src/libstrongswan/plugins/sha2/Makefile.in
index fcbfa0c44..bdc235555 100644
--- a/src/libstrongswan/plugins/sha2/Makefile.in
+++ b/src/libstrongswan/plugins/sha2/Makefile.in
@@ -240,6 +240,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -263,6 +265,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/sha2/sha2_plugin.c b/src/libstrongswan/plugins/sha2/sha2_plugin.c
index a5937dbb2..4ec03a268 100644
--- a/src/libstrongswan/plugins/sha2/sha2_plugin.c
+++ b/src/libstrongswan/plugins/sha2/sha2_plugin.c
@@ -18,8 +18,6 @@
#include <library.h>
#include "sha2_hasher.h"
-static const char *plugin_name = "sha2";
-
typedef struct private_sha2_plugin_t private_sha2_plugin_t;
/**
@@ -33,6 +31,12 @@ struct private_sha2_plugin_t {
sha2_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_sha2_plugin_t *this)
+{
+ return "sha2";
+}
+
METHOD(plugin_t, destroy, void,
private_sha2_plugin_t *this)
{
@@ -51,18 +55,20 @@ plugin_t *sha2_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
);
- lib->crypto->add_hasher(lib->crypto, HASH_SHA224, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA224, get_name(this),
(hasher_constructor_t)sha2_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_SHA256, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA256, get_name(this),
(hasher_constructor_t)sha2_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_SHA384, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA384, get_name(this),
(hasher_constructor_t)sha2_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_SHA512, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA512, get_name(this),
(hasher_constructor_t)sha2_hasher_create);
return &this->public.plugin;
diff --git a/src/libstrongswan/plugins/soup/Makefile.in b/src/libstrongswan/plugins/soup/Makefile.in
index 35d175f95..ec370d38c 100644
--- a/src/libstrongswan/plugins/soup/Makefile.in
+++ b/src/libstrongswan/plugins/soup/Makefile.in
@@ -241,6 +241,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -264,6 +266,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/soup/soup_fetcher.c b/src/libstrongswan/plugins/soup/soup_fetcher.c
index fd97631bd..3e5786b12 100644
--- a/src/libstrongswan/plugins/soup/soup_fetcher.c
+++ b/src/libstrongswan/plugins/soup/soup_fetcher.c
@@ -58,44 +58,77 @@ struct private_soup_fetcher_t {
* HTTP request version
*/
SoupHTTPVersion version;
+
+ /**
+ * Fetcher callback function
+ */
+ fetcher_callback_t cb;
};
+/**
+ * Data to pass to soup callback
+ */
+typedef struct {
+ fetcher_callback_t cb;
+ void *user;
+ SoupSession *session;
+} cb_data_t;
+
+/**
+ * Soup callback invoking our callback
+ */
+static void soup_cb(SoupMessage *message, SoupBuffer *chunk, cb_data_t *data)
+{
+ if (!data->cb(data->user, chunk_create((u_char*)chunk->data, chunk->length)))
+ {
+ soup_session_cancel_message(data->session, message,
+ SOUP_STATUS_CANCELLED);
+ }
+}
+
METHOD(fetcher_t, fetch, status_t,
- private_soup_fetcher_t *this, char *uri, chunk_t *result)
+ private_soup_fetcher_t *this, char *uri, void *userdata)
{
- SoupSession *session;
SoupMessage *message;
status_t status = FAILED;
+ cb_data_t data = {
+ .cb = this->cb,
+ .user = userdata,
+ };
message = soup_message_new(this->method, uri);
if (!message)
{
return NOT_SUPPORTED;
}
+ if (this->cb == fetcher_default_callback)
+ {
+ *(chunk_t*)userdata = chunk_empty;
+ }
if (this->type)
{
soup_message_set_request(message, this->type, SOUP_MEMORY_STATIC,
this->data.ptr, this->data.len);
}
soup_message_set_http_version(message, this->version);
- session = soup_session_sync_new();
- g_object_set(G_OBJECT(session),
+ soup_message_body_set_accumulate(message->response_body, FALSE);
+ g_signal_connect(message, "got-chunk", G_CALLBACK(soup_cb), &data);
+ data.session = soup_session_sync_new();
+ g_object_set(G_OBJECT(data.session),
SOUP_SESSION_TIMEOUT, (guint)this->timeout, NULL);
DBG2(DBG_LIB, "sending http request to '%s'...", uri);
- soup_session_send_message(session, message);
+ soup_session_send_message(data.session, message);
if (SOUP_STATUS_IS_SUCCESSFUL(message->status_code))
{
- *result = chunk_clone(chunk_create((u_char*)message->response_body->data,
- message->response_body->length));
status = SUCCESS;
}
else
{
- DBG1(DBG_LIB, "HTTP request failed, code %d", message->status_code);
+ DBG1(DBG_LIB, "HTTP request failed: %s", message->reason_phrase);
}
g_object_unref(G_OBJECT(message));
- g_object_unref(G_OBJECT(session));
+ g_object_unref(G_OBJECT(data.session));
return status;
}
@@ -121,6 +154,9 @@ METHOD(fetcher_t, set_option, bool,
case FETCH_TIMEOUT:
this->timeout = va_arg(args, u_int);
break;
+ case FETCH_CALLBACK:
+ this->cb = va_arg(args, fetcher_callback_t);
+ break;
default:
supported = FALSE;
break;
@@ -153,6 +189,7 @@ soup_fetcher_t *soup_fetcher_create()
.method = SOUP_METHOD_GET,
.version = SOUP_HTTP_1_1,
.timeout = DEFAULT_TIMEOUT,
+ .cb = fetcher_default_callback,
);
return &this->public;
diff --git a/src/libstrongswan/plugins/soup/soup_plugin.c b/src/libstrongswan/plugins/soup/soup_plugin.c
index 970e32472..22c8762e0 100644
--- a/src/libstrongswan/plugins/soup/soup_plugin.c
+++ b/src/libstrongswan/plugins/soup/soup_plugin.c
@@ -34,6 +34,12 @@ struct private_soup_plugin_t {
soup_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_soup_plugin_t *this)
+{
+ return "soup";
+}
+
METHOD(plugin_t, destroy, void,
private_soup_plugin_t *this)
{
@@ -58,6 +64,8 @@ plugin_t *soup_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
diff --git a/src/libstrongswan/plugins/sqlite/Makefile.in b/src/libstrongswan/plugins/sqlite/Makefile.in
index ae015d1a8..e2ec799a9 100644
--- a/src/libstrongswan/plugins/sqlite/Makefile.in
+++ b/src/libstrongswan/plugins/sqlite/Makefile.in
@@ -243,6 +243,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -266,6 +268,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/sqlite/sqlite_plugin.c b/src/libstrongswan/plugins/sqlite/sqlite_plugin.c
index e0b8e6ce1..d8c6a560c 100644
--- a/src/libstrongswan/plugins/sqlite/sqlite_plugin.c
+++ b/src/libstrongswan/plugins/sqlite/sqlite_plugin.c
@@ -31,6 +31,12 @@ struct private_sqlite_plugin_t {
sqlite_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_sqlite_plugin_t *this)
+{
+ return "sqlite";
+}
+
METHOD(plugin_t, destroy, void,
private_sqlite_plugin_t *this)
{
@@ -49,6 +55,8 @@ plugin_t *sqlite_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
diff --git a/src/libstrongswan/plugins/test_vectors/Makefile.in b/src/libstrongswan/plugins/test_vectors/Makefile.in
index 9dccb05e3..70cdfd600 100644
--- a/src/libstrongswan/plugins/test_vectors/Makefile.in
+++ b/src/libstrongswan/plugins/test_vectors/Makefile.in
@@ -248,6 +248,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -271,6 +273,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/test_vectors/test_vectors/des.c b/src/libstrongswan/plugins/test_vectors/test_vectors/des.c
index 80b5f1010..b4bf1fe6a 100644
--- a/src/libstrongswan/plugins/test_vectors/test_vectors/des.c
+++ b/src/libstrongswan/plugins/test_vectors/test_vectors/des.c
@@ -25,7 +25,6 @@
crypter_test_vector_t des_ecb1 = {
.alg = ENCR_DES_ECB, .key_size = 8, .len = 8,
.key = "\x00\x01\x02\x03\x04\x05\x06\x07",
- .iv = "\x00\x00\x00\x00\x00\x00\x00\x00",
.plain = "\x41\xAD\x06\x85\x48\x80\x9D\x02",
.cipher = "\x00\x11\x22\x33\x44\x55\x66\x77"
};
@@ -36,7 +35,6 @@ crypter_test_vector_t des_ecb1 = {
crypter_test_vector_t des_ecb2 = {
.alg = ENCR_DES_ECB, .key_size = 8, .len = 8,
.key = "\x2B\xD6\x45\x9F\x82\xC5\xB3\x00",
- .iv = "\x00\x00\x00\x00\x00\x00\x00\x00",
.plain = "\xB1\x0F\x84\x30\x97\xA0\xF9\x32",
.cipher = "\xEA\x02\x47\x14\xAD\x5C\x4D\x84"
};
diff --git a/src/libstrongswan/plugins/test_vectors/test_vectors_plugin.c b/src/libstrongswan/plugins/test_vectors/test_vectors_plugin.c
index 176bc438d..4a8743289 100644
--- a/src/libstrongswan/plugins/test_vectors/test_vectors_plugin.c
+++ b/src/libstrongswan/plugins/test_vectors/test_vectors_plugin.c
@@ -104,6 +104,12 @@ struct private_test_vectors_plugin_t {
test_vectors_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_test_vectors_plugin_t *this)
+{
+ return "test-vectors";
+}
+
METHOD(plugin_t, destroy, void,
private_test_vectors_plugin_t *this)
{
@@ -121,6 +127,8 @@ plugin_t *test_vectors_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
diff --git a/src/libstrongswan/plugins/x509/Makefile.in b/src/libstrongswan/plugins/x509/Makefile.in
index 57deab98e..58cdf2c7c 100644
--- a/src/libstrongswan/plugins/x509/Makefile.in
+++ b/src/libstrongswan/plugins/x509/Makefile.in
@@ -242,6 +242,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -265,6 +267,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/x509/x509_cert.c b/src/libstrongswan/plugins/x509/x509_cert.c
index 526dbe8c6..8b228a2b6 100644
--- a/src/libstrongswan/plugins/x509/x509_cert.c
+++ b/src/libstrongswan/plugins/x509/x509_cert.c
@@ -937,15 +937,15 @@ static const asn1Object_t certificatePoliciesObject[] = {
{ 0, "certificatePolicies", ASN1_SEQUENCE, ASN1_LOOP }, /* 0 */
{ 1, "policyInformation", ASN1_SEQUENCE, ASN1_NONE }, /* 1 */
{ 2, "policyId", ASN1_OID, ASN1_BODY }, /* 2 */
- { 2, "qualifier", ASN1_SEQUENCE, ASN1_OPT|ASN1_BODY }, /* 3 */
+ { 2, "qualifiers", ASN1_SEQUENCE, ASN1_OPT|ASN1_LOOP }, /* 3 */
{ 3, "qualifierInfo", ASN1_SEQUENCE, ASN1_NONE }, /* 4 */
{ 4, "qualifierId", ASN1_OID, ASN1_BODY }, /* 5 */
{ 4, "cPSuri", ASN1_IA5STRING, ASN1_OPT|ASN1_BODY }, /* 6 */
{ 4, "end choice", ASN1_EOC, ASN1_END }, /* 7 */
- { 4, "userNotice", ASN1_SEQUENCE, ASN1_OPT|ASN1_NONE }, /* 8 */
+ { 4, "userNotice", ASN1_SEQUENCE, ASN1_OPT|ASN1_BODY }, /* 8 */
{ 5, "explicitText", ASN1_EOC, ASN1_RAW }, /* 9 */
{ 4, "end choice", ASN1_EOC, ASN1_END }, /* 10 */
- { 2, "end opt", ASN1_EOC, ASN1_END }, /* 12 */
+ { 2, "end opt/loop", ASN1_EOC, ASN1_END }, /* 12 */
{ 0, "end loop", ASN1_EOC, ASN1_END }, /* 13 */
{ 0, "exit", ASN1_EOC, ASN1_EXIT }
};
@@ -1117,7 +1117,7 @@ static const asn1Object_t ipAddrBlocksObjects[] = {
{ 4, "min", ASN1_BIT_STRING, ASN1_BODY }, /* 9 */
{ 4, "max", ASN1_BIT_STRING, ASN1_BODY }, /* 10 */
{ 3, "end choice", ASN1_EOC, ASN1_END }, /* 11 */
- { 2, "end choice/loop", ASN1_EOC, ASN1_END }, /* 12 */
+ { 2, "end opt/loop", ASN1_EOC, ASN1_END }, /* 12 */
{ 0, "end loop", ASN1_EOC, ASN1_END }, /* 13 */
{ 0, "exit", ASN1_EOC, ASN1_EXIT }
};
diff --git a/src/libstrongswan/plugins/x509/x509_ocsp_response.c b/src/libstrongswan/plugins/x509/x509_ocsp_response.c
index 829f47f81..4cbe3f718 100644
--- a/src/libstrongswan/plugins/x509/x509_ocsp_response.c
+++ b/src/libstrongswan/plugins/x509/x509_ocsp_response.c
@@ -453,7 +453,7 @@ static const asn1Object_t basicResponseObjects[] = {
{ 5, "critical", ASN1_BOOLEAN, ASN1_BODY |
ASN1_DEF }, /* 16 */
{ 5, "extnValue", ASN1_OCTET_STRING, ASN1_BODY }, /* 17 */
- { 4, "end loop", ASN1_EOC, ASN1_END }, /* 18 */
+ { 3, "end loop", ASN1_EOC, ASN1_END }, /* 18 */
{ 2, "end opt", ASN1_EOC, ASN1_END }, /* 19 */
{ 1, "signatureAlgorithm", ASN1_EOC, ASN1_RAW }, /* 20 */
{ 1, "signature", ASN1_BIT_STRING, ASN1_BODY }, /* 21 */
diff --git a/src/libstrongswan/plugins/x509/x509_plugin.c b/src/libstrongswan/plugins/x509/x509_plugin.c
index d40cc3567..bfeb74b0e 100644
--- a/src/libstrongswan/plugins/x509/x509_plugin.c
+++ b/src/libstrongswan/plugins/x509/x509_plugin.c
@@ -36,6 +36,12 @@ struct private_x509_plugin_t {
x509_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_x509_plugin_t *this)
+{
+ return "x509";
+}
+
METHOD(plugin_t, destroy, void,
private_x509_plugin_t *this)
{
@@ -72,6 +78,8 @@ plugin_t *x509_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
diff --git a/src/libstrongswan/plugins/xcbc/Makefile.in b/src/libstrongswan/plugins/xcbc/Makefile.in
index 06d7a2121..35f868de4 100644
--- a/src/libstrongswan/plugins/xcbc/Makefile.in
+++ b/src/libstrongswan/plugins/xcbc/Makefile.in
@@ -241,6 +241,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -264,6 +266,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/xcbc/xcbc.c b/src/libstrongswan/plugins/xcbc/xcbc.c
index be18d92b8..8ddde962c 100644
--- a/src/libstrongswan/plugins/xcbc/xcbc.c
+++ b/src/libstrongswan/plugins/xcbc/xcbc.c
@@ -236,13 +236,17 @@ METHOD(xcbc_t, set_key, void,
memset(k1.ptr, 0x01, this->b);
this->k1->encrypt(this->k1, k1, iv, NULL);
this->k1->set_key(this->k1, k1);
+
+ memwipe(k1.ptr, k1.len);
}
METHOD(xcbc_t, destroy, void,
private_xcbc_t *this)
{
this->k1->destroy(this->k1);
+ memwipe(this->k2, this->b);
free(this->k2);
+ memwipe(this->k3, this->b);
free(this->k3);
free(this->e);
free(this->remaining);
diff --git a/src/libstrongswan/plugins/xcbc/xcbc_plugin.c b/src/libstrongswan/plugins/xcbc/xcbc_plugin.c
index 65e88335c..0fcb093c8 100644
--- a/src/libstrongswan/plugins/xcbc/xcbc_plugin.c
+++ b/src/libstrongswan/plugins/xcbc/xcbc_plugin.c
@@ -19,8 +19,6 @@
#include "xcbc_signer.h"
#include "xcbc_prf.h"
-static const char *plugin_name = "xcbc";
-
typedef struct private_xcbc_plugin_t private_xcbc_plugin_t;
/**
@@ -34,6 +32,12 @@ struct private_xcbc_plugin_t {
xcbc_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_xcbc_plugin_t *this)
+{
+ return "xcbc";
+}
+
METHOD(plugin_t, destroy, void,
private_xcbc_plugin_t *this)
{
@@ -55,6 +59,8 @@ plugin_t *xcbc_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
@@ -64,18 +70,18 @@ plugin_t *xcbc_plugin_create()
if (crypter)
{
crypter->destroy(crypter);
- lib->crypto->add_prf(lib->crypto, PRF_AES128_XCBC, plugin_name,
+ lib->crypto->add_prf(lib->crypto, PRF_AES128_XCBC, get_name(this),
(prf_constructor_t)xcbc_prf_create);
- lib->crypto->add_signer(lib->crypto, AUTH_AES_XCBC_96, plugin_name,
+ lib->crypto->add_signer(lib->crypto, AUTH_AES_XCBC_96, get_name(this),
(signer_constructor_t)xcbc_signer_create);
}
crypter = lib->crypto->create_crypter(lib->crypto, ENCR_CAMELLIA_CBC, 16);
if (crypter)
{
crypter->destroy(crypter);
- lib->crypto->add_prf(lib->crypto, PRF_CAMELLIA128_XCBC, plugin_name,
+ lib->crypto->add_prf(lib->crypto, PRF_CAMELLIA128_XCBC, get_name(this),
(prf_constructor_t)xcbc_prf_create);
- lib->crypto->add_signer(lib->crypto, AUTH_CAMELLIA_XCBC_96, plugin_name,
+ lib->crypto->add_signer(lib->crypto, AUTH_CAMELLIA_XCBC_96, get_name(this),
(signer_constructor_t)xcbc_signer_create);
}
return &this->public.plugin;
diff --git a/src/libstrongswan/processing/jobs/callback_job.c b/src/libstrongswan/processing/jobs/callback_job.c
index 556cbd907..0043a9cdb 100644
--- a/src/libstrongswan/processing/jobs/callback_job.c
+++ b/src/libstrongswan/processing/jobs/callback_job.c
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009 Tobias Brunner
- * Copyright (C) 2007 Martin Willi
+ * Copyright (C) 2007-2011 Martin Willi
+ * Copyright (C) 2011 revosec AG
* Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -29,6 +30,7 @@ typedef struct private_callback_job_t private_callback_job_t;
* Private data of an callback_job_t Object.
*/
struct private_callback_job_t {
+
/**
* Public callback_job_t interface.
*/
@@ -111,10 +113,8 @@ static void unregister(private_callback_job_t *this)
}
}
-/**
- * Implements job_t.destroy.
- */
-static void destroy(private_callback_job_t *this)
+METHOD(job_t, destroy, void,
+ private_callback_job_t *this)
{
this->mutex->lock(this->mutex);
unregister(this);
@@ -133,10 +133,8 @@ static void destroy(private_callback_job_t *this)
free(this);
}
-/**
- * Implementation of callback_job_t.cancel.
- */
-static void cancel(private_callback_job_t *this)
+METHOD(callback_job_t, cancel, void,
+ private_callback_job_t *this)
{
callback_job_t *child;
sem_t *terminated = NULL;
@@ -177,10 +175,8 @@ static void cancel(private_callback_job_t *this)
}
}
-/**
- * Implementation of job_t.execute.
- */
-static void execute(private_callback_job_t *this)
+METHOD(job_t, execute, void,
+ private_callback_job_t *this)
{
bool cleanup = FALSE, requeue = FALSE;
@@ -226,8 +222,7 @@ static void execute(private_callback_job_t *this)
thread_cancellation_point();
if (requeue)
{
- lib->processor->queue_job(lib->processor,
- &this->public.job_interface);
+ lib->processor->queue_job(lib->processor, &this->public.job);
}
thread_cleanup_pop(cleanup);
}
@@ -239,24 +234,24 @@ callback_job_t *callback_job_create(callback_job_cb_t cb, void *data,
callback_job_cleanup_t cleanup,
callback_job_t *parent)
{
- private_callback_job_t *this = malloc_thing(private_callback_job_t);
-
- /* interface functions */
- this->public.job_interface.execute = (void (*) (job_t *)) execute;
- this->public.job_interface.destroy = (void (*) (job_t *)) destroy;
- this->public.cancel = (void(*)(callback_job_t*))cancel;
+ private_callback_job_t *this;
- /* private variables */
- this->mutex = mutex_create(MUTEX_TYPE_DEFAULT);
- this->callback = cb;
- this->data = data;
- this->cleanup = cleanup;
- this->thread = 0;
- this->children = linked_list_create();
- this->parent = (private_callback_job_t*)parent;
- this->cancelled = FALSE;
- this->destroyable = condvar_create(CONDVAR_TYPE_DEFAULT);
- this->terminated = NULL;
+ INIT(this,
+ .public = {
+ .job = {
+ .execute = _execute,
+ .destroy = _destroy,
+ },
+ .cancel = _cancel,
+ },
+ .mutex = mutex_create(MUTEX_TYPE_DEFAULT),
+ .callback = cb,
+ .data = data,
+ .cleanup = cleanup,
+ .children = linked_list_create(),
+ .parent = (private_callback_job_t*)parent,
+ .destroyable = condvar_create(CONDVAR_TYPE_DEFAULT),
+ );
/* register us at parent */
if (parent)
diff --git a/src/libstrongswan/processing/jobs/callback_job.h b/src/libstrongswan/processing/jobs/callback_job.h
index 62da1edd1..1eb5664d3 100644
--- a/src/libstrongswan/processing/jobs/callback_job.h
+++ b/src/libstrongswan/processing/jobs/callback_job.h
@@ -1,5 +1,6 @@
/*
- * Copyright (C) 2007 Martin Willi
+ * Copyright (C) 2007-2011 Martin Willi
+ * Copyright (C) 2011 revosec AG
* Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -30,7 +31,7 @@ typedef struct callback_job_t callback_job_t;
typedef enum job_requeue_t job_requeue_t;
/**
- * Job requeueing policy
+ * Job requeueing policy.
*
* The job requeueing policy defines how a job is handled when the callback
* function returns.
@@ -84,15 +85,19 @@ typedef void (*callback_job_cleanup_t)(void *data);
* of asynchronous methods, without to manage threads.
*/
struct callback_job_t {
+
/**
* The job_t interface.
*/
- job_t job_interface;
+ job_t job;
/**
- * Cancel the job's thread and wait for its termination. This only works
- * reliably for jobs that always use JOB_REQUEUE_FAIR or JOB_REQUEUE_DIRECT,
- * otherwise the job may already be destroyed when cancel is called. */
+ * Cancel the job's thread and wait for its termination.
+ *
+ * This only works reliably for jobs that always use JOB_REQUEUE_FAIR or
+ * JOB_REQUEUE_DIRECT, otherwise the job may already be destroyed when
+ * cancel is called.
+ */
void (*cancel)(callback_job_t *this);
};
diff --git a/src/libstrongswan/processing/processor.c b/src/libstrongswan/processing/processor.c
index 723aec908..de556f86b 100644
--- a/src/libstrongswan/processing/processor.c
+++ b/src/libstrongswan/processing/processor.c
@@ -1,5 +1,6 @@
/*
- * Copyright (C) 2005-2007 Martin Willi
+ * Copyright (C) 2005-2011 Martin Willi
+ * Copyright (C) 2011 revosec AG
* Copyright (C) 2005 Jan Hutter
* Hochschule fuer Technik Rapperswil
*
@@ -136,50 +137,46 @@ static void process_jobs(private_processor_t *this)
thread_cleanup_pop(FALSE);
this->mutex->lock(this->mutex);
}
+ this->total_threads--;
+ this->thread_terminated->signal(this->thread_terminated);
this->mutex->unlock(this->mutex);
- restart(this);
}
-/**
- * Implementation of processor_t.get_total_threads.
- */
-static u_int get_total_threads(private_processor_t *this)
+METHOD(processor_t, get_total_threads, u_int,
+ private_processor_t *this)
{
u_int count;
+
this->mutex->lock(this->mutex);
count = this->total_threads;
this->mutex->unlock(this->mutex);
return count;
}
-/**
- * Implementation of processor_t.get_idle_threads.
- */
-static u_int get_idle_threads(private_processor_t *this)
+METHOD(processor_t, get_idle_threads, u_int,
+ private_processor_t *this)
{
u_int count;
+
this->mutex->lock(this->mutex);
count = this->idle_threads;
this->mutex->unlock(this->mutex);
return count;
}
-/**
- * implements processor_t.get_job_load
- */
-static u_int get_job_load(private_processor_t *this)
+METHOD(processor_t, get_job_load, u_int,
+ private_processor_t *this)
{
u_int load;
+
this->mutex->lock(this->mutex);
load = this->list->get_count(this->list);
this->mutex->unlock(this->mutex);
return load;
}
-/**
- * implements function processor_t.queue_job
- */
-static void queue_job(private_processor_t *this, job_t *job)
+METHOD(processor_t, queue_job, void,
+ private_processor_t *this, job_t *job)
{
this->mutex->lock(this->mutex);
this->list->insert_last(this->list, job);
@@ -187,10 +184,8 @@ static void queue_job(private_processor_t *this, job_t *job)
this->mutex->unlock(this->mutex);
}
-/**
- * Implementation of processor_t.set_threads.
- */
-static void set_threads(private_processor_t *this, u_int count)
+METHOD(processor_t, set_threads, void,
+ private_processor_t *this, u_int count)
{
this->mutex->lock(this->mutex);
if (count > this->total_threads)
@@ -218,12 +213,11 @@ static void set_threads(private_processor_t *this, u_int count)
this->mutex->unlock(this->mutex);
}
-/**
- * Implementation of processor_t.destroy.
- */
-static void destroy(private_processor_t *this)
+METHOD(processor_t, destroy, void,
+ private_processor_t *this)
{
thread_t *current;
+
set_threads(this, 0);
this->mutex->lock(this->mutex);
while (this->total_threads > 0)
@@ -250,23 +244,23 @@ static void destroy(private_processor_t *this)
*/
processor_t *processor_create()
{
- private_processor_t *this = malloc_thing(private_processor_t);
-
- this->public.get_total_threads = (u_int(*)(processor_t*))get_total_threads;
- this->public.get_idle_threads = (u_int(*)(processor_t*))get_idle_threads;
- this->public.get_job_load = (u_int(*)(processor_t*))get_job_load;
- this->public.queue_job = (void(*)(processor_t*, job_t*))queue_job;
- this->public.set_threads = (void(*)(processor_t*, u_int))set_threads;
- this->public.destroy = (void(*)(processor_t*))destroy;
-
- this->list = linked_list_create();
- this->threads = linked_list_create();
- this->mutex = mutex_create(MUTEX_TYPE_DEFAULT);
- this->job_added = condvar_create(CONDVAR_TYPE_DEFAULT);
- this->thread_terminated = condvar_create(CONDVAR_TYPE_DEFAULT);
- this->total_threads = 0;
- this->desired_threads = 0;
- this->idle_threads = 0;
+ private_processor_t *this;
+
+ INIT(this,
+ .public = {
+ .get_total_threads = _get_total_threads,
+ .get_idle_threads = _get_idle_threads,
+ .get_job_load = _get_job_load,
+ .queue_job = _queue_job,
+ .set_threads = _set_threads,
+ .destroy = _destroy,
+ },
+ .list = linked_list_create(),
+ .threads = linked_list_create(),
+ .mutex = mutex_create(MUTEX_TYPE_DEFAULT),
+ .job_added = condvar_create(CONDVAR_TYPE_DEFAULT),
+ .thread_terminated = condvar_create(CONDVAR_TYPE_DEFAULT),
+ );
return &this->public;
}
diff --git a/src/libstrongswan/processing/scheduler.c b/src/libstrongswan/processing/scheduler.c
index e23f04598..7d9bcd70f 100644
--- a/src/libstrongswan/processing/scheduler.c
+++ b/src/libstrongswan/processing/scheduler.c
@@ -232,10 +232,8 @@ static job_requeue_t schedule(private_scheduler_t * this)
return JOB_REQUEUE_DIRECT;
}
-/**
- * Implements scheduler_t.get_job_load
- */
-static u_int get_job_load(private_scheduler_t *this)
+METHOD(scheduler_t, get_job_load, u_int,
+ private_scheduler_t *this)
{
int count;
this->mutex->lock(this->mutex);
@@ -244,10 +242,8 @@ static u_int get_job_load(private_scheduler_t *this)
return count;
}
-/**
- * Implements scheduler_t.schedule_job_tv.
- */
-static void schedule_job_tv(private_scheduler_t *this, job_t *job, timeval_t tv)
+METHOD(scheduler_t, schedule_job_tv, void,
+ private_scheduler_t *this, job_t *job, timeval_t tv)
{
event_t *event;
u_int position;
@@ -283,10 +279,8 @@ static void schedule_job_tv(private_scheduler_t *this, job_t *job, timeval_t tv)
this->mutex->unlock(this->mutex);
}
-/**
- * Implements scheduler_t.schedule_job.
- */
-static void schedule_job(private_scheduler_t *this, job_t *job, u_int32_t s)
+METHOD(scheduler_t, schedule_job, void,
+ private_scheduler_t *this, job_t *job, u_int32_t s)
{
timeval_t tv;
@@ -296,10 +290,8 @@ static void schedule_job(private_scheduler_t *this, job_t *job, u_int32_t s)
schedule_job_tv(this, job, tv);
}
-/**
- * Implements scheduler_t.schedule_job_ms.
- */
-static void schedule_job_ms(private_scheduler_t *this, job_t *job, u_int32_t ms)
+METHOD(scheduler_t, schedule_job_ms, void,
+ private_scheduler_t *this, job_t *job, u_int32_t ms)
{
timeval_t tv, add;
@@ -312,10 +304,8 @@ static void schedule_job_ms(private_scheduler_t *this, job_t *job, u_int32_t ms)
schedule_job_tv(this, job, tv);
}
-/**
- * Implementation of scheduler_t.destroy.
- */
-static void destroy(private_scheduler_t *this)
+METHOD(scheduler_t, destroy, void,
+ private_scheduler_t *this)
{
event_t *event;
this->job->cancel(this->job);
@@ -334,22 +324,23 @@ static void destroy(private_scheduler_t *this)
*/
scheduler_t * scheduler_create()
{
- private_scheduler_t *this = malloc_thing(private_scheduler_t);
-
- this->public.get_job_load = (u_int (*) (scheduler_t *this)) get_job_load;
- this->public.schedule_job = (void (*) (scheduler_t *this, job_t *job, u_int32_t s)) schedule_job;
- this->public.schedule_job_ms = (void (*) (scheduler_t *this, job_t *job, u_int32_t ms)) schedule_job_ms;
- this->public.schedule_job_tv = (void (*) (scheduler_t *this, job_t *job, timeval_t tv)) schedule_job_tv;
- this->public.destroy = (void(*)(scheduler_t*)) destroy;
+ private_scheduler_t *this;
+
+ INIT(this,
+ .public = {
+ .get_job_load = _get_job_load,
+ .schedule_job = _schedule_job,
+ .schedule_job_ms = _schedule_job_ms,
+ .schedule_job_tv = _schedule_job_tv,
+ .destroy = _destroy,
+ },
+ .heap_size = HEAP_SIZE_DEFAULT,
+ .mutex = mutex_create(MUTEX_TYPE_DEFAULT),
+ .condvar = condvar_create(CONDVAR_TYPE_DEFAULT),
+ );
- /* Note: the root of the heap is at index 1 */
- this->event_count = 0;
- this->heap_size = HEAP_SIZE_DEFAULT;
this->heap = (event_t**)calloc(this->heap_size + 1, sizeof(event_t*));
- this->mutex = mutex_create(MUTEX_TYPE_DEFAULT);
- this->condvar = condvar_create(CONDVAR_TYPE_DEFAULT);
-
this->job = callback_job_create((callback_job_cb_t)schedule, this, NULL, NULL);
lib->processor->queue_job(lib->processor, (job_t*)this->job);
diff --git a/src/libstrongswan/settings.c b/src/libstrongswan/settings.c
index bd279f51d..8a2248b46 100644
--- a/src/libstrongswan/settings.c
+++ b/src/libstrongswan/settings.c
@@ -20,8 +20,14 @@
#include <stdio.h>
#include <errno.h>
#include <limits.h>
-#include <glob.h>
#include <libgen.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#ifdef HAVE_GLOB_H
+#include <glob.h>
+#endif /* HAVE_GLOB_H */
#include "settings.h"
@@ -146,6 +152,17 @@ static void section_destroy(section_t *this)
}
/**
+ * Purge contents of a section
+ */
+static void section_purge(section_t *this)
+{
+ this->kv->destroy_function(this->kv, (void*)kv_destroy);
+ this->kv = linked_list_create();
+ this->sections->destroy_function(this->sections, (void*)section_destroy);
+ this->sections = linked_list_create();
+}
+
+/**
* callback to find a section by name
*/
static bool section_find(section_t *this, char *name)
@@ -914,14 +931,30 @@ static bool parse_file(linked_list_t *contents, char *file, int level,
{
bool success;
char *text, *pos;
+ struct stat st;
FILE *fd;
int len;
DBG2(DBG_LIB, "loading config file '%s'", file);
+ if (stat(file, &st) == -1)
+ {
+ if (errno == ENOENT)
+ {
+ DBG2(DBG_LIB, "'%s' does not exist, ignored", file);
+ return TRUE;
+ }
+ DBG1(DBG_LIB, "failed to stat '%s': %s", file, strerror(errno));
+ return FALSE;
+ }
+ else if (!S_ISREG(st.st_mode))
+ {
+ DBG1(DBG_LIB, "'%s' is not a regular file", file);
+ return FALSE;
+ }
fd = fopen(file, "r");
if (fd == NULL)
{
- DBG1(DBG_LIB, "'%s' does not exist or is not readable", file);
+ DBG1(DBG_LIB, "'%s' is not readable", file);
return FALSE;
}
fseek(fd, 0, SEEK_END);
@@ -950,16 +983,15 @@ static bool parse_file(linked_list_t *contents, char *file, int level,
}
/**
- * Load the files matching "pattern", which is resolved with glob(3).
+ * Load the files matching "pattern", which is resolved with glob(3), if
+ * available.
* If the pattern is relative, the directory of "file" is used as base.
*/
static bool parse_files(linked_list_t *contents, char *file, int level,
char *pattern, section_t *section)
{
bool success = TRUE;
- int status;
- glob_t buf;
- char **expanded, pat[PATH_MAX];
+ char pat[PATH_MAX];
if (level > MAX_INCLUSION_LEVEL)
{
@@ -994,28 +1026,39 @@ static bool parse_files(linked_list_t *contents, char *file, int level,
}
free(dir);
}
- status = glob(pat, GLOB_ERR, NULL, &buf);
- if (status == GLOB_NOMATCH)
- {
- DBG2(DBG_LIB, "no files found matching '%s', ignored", pat);
- }
- else if (status != 0)
+#ifdef HAVE_GLOB_H
{
- DBG1(DBG_LIB, "expanding file pattern '%s' failed", pat);
- success = FALSE;
- }
- else
- {
- for (expanded = buf.gl_pathv; *expanded != NULL; expanded++)
+ int status;
+ glob_t buf;
+
+ status = glob(pat, GLOB_ERR, NULL, &buf);
+ if (status == GLOB_NOMATCH)
+ {
+ DBG2(DBG_LIB, "no files found matching '%s', ignored", pat);
+ }
+ else if (status != 0)
{
- success &= parse_file(contents, *expanded, level + 1, section);
- if (!success)
+ DBG1(DBG_LIB, "expanding file pattern '%s' failed", pat);
+ success = FALSE;
+ }
+ else
+ {
+ char **expanded;
+ for (expanded = buf.gl_pathv; *expanded != NULL; expanded++)
{
- break;
+ success &= parse_file(contents, *expanded, level + 1, section);
+ if (!success)
+ {
+ break;
+ }
}
}
+ globfree(&buf);
}
- globfree(&buf);
+#else /* HAVE_GLOB_H */
+ /* if glob(3) is not available, try to load pattern directly */
+ success = parse_file(contents, pat, level + 1, section);
+#endif /* HAVE_GLOB_H */
return success;
}
@@ -1070,12 +1113,17 @@ static void section_extend(section_t *base, section_t *extension)
* All files (even included ones) have to be loaded successfully.
*/
static bool load_files_internal(private_settings_t *this, section_t *parent,
- char *pattern)
+ char *pattern, bool merge)
{
char *text;
linked_list_t *contents = linked_list_create();
section_t *section = section_create(NULL);
+ if (pattern == NULL)
+ {
+ pattern = STRONGSWAN_CONF;
+ }
+
if (!parse_files(contents, NULL, 0, pattern, section))
{
contents->destroy_function(contents, (void*)free);
@@ -1084,6 +1132,10 @@ static bool load_files_internal(private_settings_t *this, section_t *parent,
}
this->lock->write_lock(this->lock);
+ if (!merge)
+ {
+ section_purge(parent);
+ }
/* extend parent section */
section_extend(parent, section);
/* move contents of loaded files to main store */
@@ -1099,13 +1151,13 @@ static bool load_files_internal(private_settings_t *this, section_t *parent,
}
METHOD(settings_t, load_files, bool,
- private_settings_t *this, char *pattern)
+ private_settings_t *this, char *pattern, bool merge)
{
- return load_files_internal(this, this->top, pattern);
+ return load_files_internal(this, this->top, pattern, merge);
}
METHOD(settings_t, load_files_section, bool,
- private_settings_t *this, char *pattern, char *key, ...)
+ private_settings_t *this, char *pattern, bool merge, char *key, ...)
{
section_t *section;
va_list args;
@@ -1118,7 +1170,7 @@ METHOD(settings_t, load_files_section, bool,
{
return FALSE;
}
- return load_files_internal(this, section, pattern);
+ return load_files_internal(this, section, pattern, merge);
}
METHOD(settings_t, destroy, void,
@@ -1160,12 +1212,7 @@ settings_t *settings_create(char *file)
.lock = rwlock_create(RWLOCK_TYPE_DEFAULT),
);
- if (file == NULL)
- {
- file = STRONGSWAN_CONF;
- }
-
- load_files(this, file);
+ load_files(this, file, FALSE);
return &this->public;
}
diff --git a/src/libstrongswan/settings.h b/src/libstrongswan/settings.h
index bc3df3706..9ccd02327 100644
--- a/src/libstrongswan/settings.h
+++ b/src/libstrongswan/settings.h
@@ -261,22 +261,25 @@ struct settings_t {
/**
* Load settings from the files matching the given pattern.
*
- * Existing sections are extended, existing values replaced, by those found
- * in the loaded files.
+ * If merge is TRUE, existing sections are extended, existing values
+ * replaced, by those found in the loaded files. If it is FALSE, existing
+ * sections are purged before reading the new config.
*
* @note If any of the files matching the pattern fails to load, no settings
* are added at all. So, it's all or nothing.
*
* @param pattern file pattern
+ * @param merge TRUE to merge config with existing values
* @return TRUE, if settings were loaded successfully
*/
- bool (*load_files)(settings_t *this, char *pattern);
+ bool (*load_files)(settings_t *this, char *pattern, bool merge);
/**
* Load settings from the files matching the given pattern.
*
- * Existing sections are extended, existing values replaced, by those found
- * in the loaded files.
+ * If merge is TRUE, existing sections are extended, existing values
+ * replaced, by those found in the loaded files. If it is FALSE, existing
+ * sections are purged before reading the new config.
*
* All settings are loaded relative to the given section. The section is
* created, if it does not yet exist.
@@ -285,11 +288,12 @@ struct settings_t {
* are added at all. So, it's all or nothing.
*
* @param pattern file pattern
+ * @param merge TRUE to merge config with existing values
* @param section section name of parent section, printf style
* @param ... argument list for section
* @return TRUE, if settings were loaded successfully
*/
- bool (*load_files_section)(settings_t *this, char *pattern,
+ bool (*load_files_section)(settings_t *this, char *pattern, bool merge,
char *section, ...);
/**
diff --git a/src/libstrongswan/threading/thread.c b/src/libstrongswan/threading/thread.c
index 3751bb749..fcc0019d8 100644
--- a/src/libstrongswan/threading/thread.c
+++ b/src/libstrongswan/threading/thread.c
@@ -205,6 +205,7 @@ static void *join(private_thread_t *this)
{
pthread_t thread_id;
void *val;
+
this->mutex->lock(this->mutex);
if (pthread_equal(this->thread_id, pthread_self()))
{
@@ -231,6 +232,7 @@ static void *join(private_thread_t *this)
this->mutex->unlock(this->mutex);
}
pthread_join(thread_id, &val);
+
return val;
}
@@ -240,6 +242,7 @@ static void *join(private_thread_t *this)
static private_thread_t *thread_create_internal()
{
private_thread_t *this = malloc_thing(private_thread_t);
+
this->public.cancel = (void(*)(thread_t*))cancel;
this->public.kill = (void(*)(thread_t*,int))_kill;
this->public.detach = (void(*)(thread_t*))detach;
@@ -281,11 +284,13 @@ static void thread_cleanup(private_thread_t *this)
static void *thread_main(private_thread_t *this)
{
void *res;
+
sem_wait(&this->created);
current_thread->set(current_thread, this);
pthread_cleanup_push((thread_cleanup_t)thread_cleanup, this);
res = this->main(this->arg);
pthread_cleanup_pop(TRUE);
+
return res;
}
@@ -295,6 +300,7 @@ static void *thread_main(private_thread_t *this)
thread_t *thread_create(thread_main_t main, void *arg)
{
private_thread_t *this = thread_create_internal();
+
this->main = main;
this->arg = arg;
if (pthread_create(&this->thread_id, NULL, (void*)thread_main, this) != 0)
@@ -308,6 +314,7 @@ thread_t *thread_create(thread_main_t main, void *arg)
this->id = next_id++;
id_mutex->unlock(id_mutex);
sem_post(&this->created);
+
return &this->public;
}
@@ -325,7 +332,8 @@ thread_t *thread_current()
u_int thread_current_id()
{
private_thread_t *this = (private_thread_t*)thread_current();
- return this->id;
+
+ return this ? this->id : 0;
}
/**
@@ -335,6 +343,7 @@ void thread_cleanup_push(thread_cleanup_t cleanup, void *arg)
{
private_thread_t *this = (private_thread_t*)thread_current();
cleanup_handler_t *handler;
+
this->mutex->lock(this->mutex);
handler = malloc_thing(cleanup_handler_t);
handler->cleanup = cleanup;
@@ -350,6 +359,7 @@ void thread_cleanup_pop(bool execute)
{
private_thread_t *this = (private_thread_t*)thread_current();
cleanup_handler_t *handler;
+
this->mutex->lock(this->mutex);
if (this->cleanup_handlers->remove_last(this->cleanup_handlers,
(void**)&handler) != SUCCESS)
@@ -374,14 +384,18 @@ bool thread_cancelability(bool enable)
{
#ifdef HAVE_PTHREAD_CANCEL
int old;
+
pthread_setcancelstate(enable ? PTHREAD_CANCEL_ENABLE
: PTHREAD_CANCEL_DISABLE, &old);
+
return old == PTHREAD_CANCEL_ENABLE;
#else
sigset_t new, old;
+
sigemptyset(&new);
sigaddset(&new, SIG_CANCEL);
pthread_sigmask(enable ? SIG_UNBLOCK : SIG_BLOCK, &new, &old);
+
return sigismember(&old, SIG_CANCEL) == 0;
#endif /* HAVE_PTHREAD_CANCEL */
}
@@ -392,6 +406,7 @@ bool thread_cancelability(bool enable)
void thread_cancellation_point()
{
bool old = thread_cancelability(TRUE);
+
#ifdef HAVE_PTHREAD_CANCEL
pthread_testcancel();
#endif /* HAVE_PTHREAD_CANCEL */
@@ -412,6 +427,7 @@ void thread_exit(void *val)
void threads_init()
{
private_thread_t *main_thread = thread_create_internal();
+
main_thread->id = 0;
main_thread->thread_id = pthread_self();
current_thread = thread_value_create(NULL);
@@ -434,6 +450,7 @@ void threads_init()
void threads_deinit()
{
private_thread_t *main_thread = (private_thread_t*)thread_current();
+
main_thread->mutex->lock(main_thread->mutex);
thread_destroy(main_thread);
current_thread->destroy(current_thread);
diff --git a/src/libstrongswan/utils.c b/src/libstrongswan/utils.c
index 2ab061a74..6ffb62aaf 100644
--- a/src/libstrongswan/utils.c
+++ b/src/libstrongswan/utils.c
@@ -102,6 +102,14 @@ void memxor(u_int8_t dst[], u_int8_t src[], size_t n)
/**
* Described in header.
*/
+void memwipe_noinline(void *ptr, size_t n)
+{
+ memwipe_inline(ptr, n);
+}
+
+/**
+ * Described in header.
+ */
void *memstr(const void *haystack, const char *needle, size_t n)
{
unsigned const char *pos = haystack;
@@ -287,7 +295,7 @@ bool ref_put(refcount_t *ref)
bool more_refs;
pthread_mutex_lock(&ref_mutex);
- more_refs = --(*ref);
+ more_refs = --(*ref) > 0;
pthread_mutex_unlock(&ref_mutex);
return !more_refs;
}
diff --git a/src/libstrongswan/utils.h b/src/libstrongswan/utils.h
index ed61895ee..a334954ae 100644
--- a/src/libstrongswan/utils.h
+++ b/src/libstrongswan/utils.h
@@ -337,6 +337,51 @@ void *clalloc(void *pointer, size_t size);
void memxor(u_int8_t dest[], u_int8_t src[], size_t n);
/**
+ * Safely overwrite n bytes of memory at ptr with zero, non-inlining variant.
+ */
+void memwipe_noinline(void *ptr, size_t n);
+
+/**
+ * Safely overwrite n bytes of memory at ptr with zero, inlining variant.
+ */
+static inline void memwipe_inline(void *ptr, size_t n)
+{
+ volatile char *c = (volatile char*)ptr;
+ int m, i;
+
+ /* byte wise until long aligned */
+ for (i = 0; (uintptr_t)&c % sizeof(long) && i < n; i++)
+ {
+ c[i] = 0;
+ }
+ /* word wize */
+ for (m = n - sizeof(long); i <= m; i += sizeof(long))
+ {
+ *(volatile long*)&c[i] = 0;
+ }
+ /* byte wise of the rest */
+ for (; i < n; i++)
+ {
+ c[i] = 0;
+ }
+}
+
+/**
+ * Safely overwrite n bytes of memory at ptr with zero, auto-inlining variant.
+ */
+static inline void memwipe(void *ptr, size_t n)
+{
+ if (__builtin_constant_p(n))
+ {
+ memwipe_inline(ptr, n);
+ }
+ else
+ {
+ memwipe_noinline(ptr, n);
+ }
+}
+
+/**
* A variant of strstr with the characteristics of memchr, where haystack is not
* a null-terminated string but simply a memory area of length n.
*/
diff --git a/src/libstrongswan/utils/backtrace.c b/src/libstrongswan/utils/backtrace.c
index 41224e8c2..5744439f8 100644
--- a/src/libstrongswan/utils/backtrace.c
+++ b/src/libstrongswan/utils/backtrace.c
@@ -80,7 +80,7 @@ static void log_(private_backtrace_t *this, FILE *file, bool detailed)
}
if (info.dli_sname)
{
- fprintf(file, " \e[33m%s\e[0m @ %p (\e[31m%s\e[0m+0x%x) [%p]\n",
+ fprintf(file, " \e[33m%s\e[0m @ %p (\e[31m%s\e[0m+0x%tx) [%p]\n",
info.dli_fname, info.dli_fbase, info.dli_sname,
this->frames[i] - info.dli_saddr, this->frames[i]);
}
diff --git a/src/libstrongswan/utils/host.c b/src/libstrongswan/utils/host.c
index ffeebd05c..615d85c95 100644
--- a/src/libstrongswan/utils/host.c
+++ b/src/libstrongswan/utils/host.c
@@ -625,5 +625,6 @@ host_t *host_create_any(int family)
default:
break;
}
+ free(this);
return NULL;
}
diff --git a/src/libstrongswan/utils/identification.c b/src/libstrongswan/utils/identification.c
index fd2716deb..252cfa28e 100644
--- a/src/libstrongswan/utils/identification.c
+++ b/src/libstrongswan/utils/identification.c
@@ -64,32 +64,34 @@ typedef struct {
} x501rdn_t;
static const x501rdn_t x501rdns[] = {
- {"ND", OID_NAME_DISTINGUISHER, ASN1_PRINTABLESTRING},
- {"UID", OID_PILOT_USERID, ASN1_PRINTABLESTRING},
- {"DC", OID_PILOT_DOMAIN_COMPONENT, ASN1_PRINTABLESTRING},
- {"CN", OID_COMMON_NAME, ASN1_PRINTABLESTRING},
- {"S", OID_SURNAME, ASN1_PRINTABLESTRING},
- {"SN", OID_SERIAL_NUMBER, ASN1_PRINTABLESTRING},
- {"serialNumber", OID_SERIAL_NUMBER, ASN1_PRINTABLESTRING},
- {"C", OID_COUNTRY, ASN1_PRINTABLESTRING},
- {"L", OID_LOCALITY, ASN1_PRINTABLESTRING},
- {"ST", OID_STATE_OR_PROVINCE, ASN1_PRINTABLESTRING},
- {"O", OID_ORGANIZATION, ASN1_PRINTABLESTRING},
- {"OU", OID_ORGANIZATION_UNIT, ASN1_PRINTABLESTRING},
- {"T", OID_TITLE, ASN1_PRINTABLESTRING},
- {"D", OID_DESCRIPTION, ASN1_PRINTABLESTRING},
- {"N", OID_NAME, ASN1_PRINTABLESTRING},
- {"G", OID_GIVEN_NAME, ASN1_PRINTABLESTRING},
- {"I", OID_INITIALS, ASN1_PRINTABLESTRING},
- {"ID", OID_UNIQUE_IDENTIFIER, ASN1_PRINTABLESTRING},
- {"EN", OID_EMPLOYEE_NUMBER, ASN1_PRINTABLESTRING},
- {"employeeNumber", OID_EMPLOYEE_NUMBER, ASN1_PRINTABLESTRING},
- {"E", OID_EMAIL_ADDRESS, ASN1_IA5STRING},
- {"Email", OID_EMAIL_ADDRESS, ASN1_IA5STRING},
- {"emailAddress", OID_EMAIL_ADDRESS, ASN1_IA5STRING},
- {"UN", OID_UNSTRUCTURED_NAME, ASN1_IA5STRING},
- {"unstructuredName",OID_UNSTRUCTURED_NAME, ASN1_IA5STRING},
- {"TCGID", OID_TCGID, ASN1_PRINTABLESTRING}
+ {"ND", OID_NAME_DISTINGUISHER, ASN1_PRINTABLESTRING},
+ {"UID", OID_PILOT_USERID, ASN1_PRINTABLESTRING},
+ {"DC", OID_PILOT_DOMAIN_COMPONENT, ASN1_PRINTABLESTRING},
+ {"CN", OID_COMMON_NAME, ASN1_PRINTABLESTRING},
+ {"S", OID_SURNAME, ASN1_PRINTABLESTRING},
+ {"SN", OID_SERIAL_NUMBER, ASN1_PRINTABLESTRING},
+ {"serialNumber", OID_SERIAL_NUMBER, ASN1_PRINTABLESTRING},
+ {"C", OID_COUNTRY, ASN1_PRINTABLESTRING},
+ {"L", OID_LOCALITY, ASN1_PRINTABLESTRING},
+ {"ST", OID_STATE_OR_PROVINCE, ASN1_PRINTABLESTRING},
+ {"O", OID_ORGANIZATION, ASN1_PRINTABLESTRING},
+ {"OU", OID_ORGANIZATION_UNIT, ASN1_PRINTABLESTRING},
+ {"T", OID_TITLE, ASN1_PRINTABLESTRING},
+ {"D", OID_DESCRIPTION, ASN1_PRINTABLESTRING},
+ {"N", OID_NAME, ASN1_PRINTABLESTRING},
+ {"G", OID_GIVEN_NAME, ASN1_PRINTABLESTRING},
+ {"I", OID_INITIALS, ASN1_PRINTABLESTRING},
+ {"ID", OID_UNIQUE_IDENTIFIER, ASN1_PRINTABLESTRING},
+ {"EN", OID_EMPLOYEE_NUMBER, ASN1_PRINTABLESTRING},
+ {"employeeNumber", OID_EMPLOYEE_NUMBER, ASN1_PRINTABLESTRING},
+ {"E", OID_EMAIL_ADDRESS, ASN1_IA5STRING},
+ {"Email", OID_EMAIL_ADDRESS, ASN1_IA5STRING},
+ {"emailAddress", OID_EMAIL_ADDRESS, ASN1_IA5STRING},
+ {"UN", OID_UNSTRUCTURED_NAME, ASN1_IA5STRING},
+ {"unstructuredName", OID_UNSTRUCTURED_NAME, ASN1_IA5STRING},
+ {"UA", OID_UNSTRUCTURED_ADDRESS, ASN1_PRINTABLESTRING},
+ {"unstructuredAddress", OID_UNSTRUCTURED_ADDRESS, ASN1_PRINTABLESTRING},
+ {"TCGID", OID_TCGID, ASN1_PRINTABLESTRING}
};
/**
diff --git a/src/libstrongswan/utils/leak_detective.c b/src/libstrongswan/utils/leak_detective.c
index 52e92951b..39505d3f3 100644
--- a/src/libstrongswan/utils/leak_detective.c
+++ b/src/libstrongswan/utils/leak_detective.c
@@ -165,6 +165,7 @@ char *whitelist[] = {
"__gmtime_r",
"localtime_r",
"tzset",
+ "time_printf_hook",
"inet_ntoa",
"strerror",
"getprotobyname",
@@ -190,6 +191,7 @@ char *whitelist[] = {
"dlopen",
"dlerror",
"dlclose",
+ "dlsym",
/* mysql functions */
"mysql_init_character_set",
"init_client_errs",
diff --git a/src/libstrongswan/utils/linked_list.c b/src/libstrongswan/utils/linked_list.c
index 4aa8ea6ca..9b37359dc 100644
--- a/src/libstrongswan/utils/linked_list.c
+++ b/src/libstrongswan/utils/linked_list.c
@@ -289,6 +289,7 @@ static void insert_before(private_iterator_t * iterator, void *item)
if (iterator->current == NULL)
{
iterator->list->public.insert_first(&(iterator->list->public), item);
+ return;
}
element_t *element = element_create(item);