diff options
-rw-r--r-- | checks/x509.cpp | 87 | ||||
-rw-r--r-- | modules/x509/certstor.cpp (renamed from src/certstor.cpp) | 0 | ||||
-rw-r--r-- | modules/x509/certstor.h (renamed from include/certstor.h) | 0 | ||||
-rw-r--r-- | modules/x509/crl_ent.cpp (renamed from src/crl_ent.cpp) | 0 | ||||
-rw-r--r-- | modules/x509/crl_ent.h (renamed from include/crl_ent.h) | 0 | ||||
-rw-r--r-- | modules/x509/modinfo.txt | 31 | ||||
-rw-r--r-- | modules/x509/pkcs10.cpp (renamed from src/pkcs10.cpp) | 0 | ||||
-rw-r--r-- | modules/x509/pkcs10.h (renamed from include/pkcs10.h) | 0 | ||||
-rw-r--r-- | modules/x509/x509_ca.cpp (renamed from src/x509_ca.cpp) | 0 | ||||
-rw-r--r-- | modules/x509/x509_ca.h (renamed from include/x509_ca.h) | 0 | ||||
-rw-r--r-- | modules/x509/x509_crl.cpp (renamed from src/x509_crl.cpp) | 0 | ||||
-rw-r--r-- | modules/x509/x509_crl.h (renamed from include/x509_crl.h) | 0 | ||||
-rw-r--r-- | modules/x509/x509_ext.cpp (renamed from src/x509_ext.cpp) | 0 | ||||
-rw-r--r-- | modules/x509/x509_ext.h (renamed from include/x509_ext.h) | 0 | ||||
-rw-r--r-- | modules/x509/x509_obj.cpp (renamed from src/x509_obj.cpp) | 0 | ||||
-rw-r--r-- | modules/x509/x509_obj.h (renamed from include/x509_obj.h) | 0 | ||||
-rw-r--r-- | modules/x509/x509cert.cpp (renamed from src/x509cert.cpp) | 0 | ||||
-rw-r--r-- | modules/x509/x509cert.h (renamed from include/x509cert.h) | 0 | ||||
-rw-r--r-- | modules/x509/x509find.cpp (renamed from src/x509find.cpp) | 0 | ||||
-rw-r--r-- | modules/x509/x509find.h (renamed from include/x509find.h) | 0 | ||||
-rw-r--r-- | modules/x509/x509opt.cpp (renamed from src/x509opt.cpp) | 0 | ||||
-rw-r--r-- | modules/x509/x509self.cpp (renamed from src/x509self.cpp) | 0 | ||||
-rw-r--r-- | modules/x509/x509self.h (renamed from include/x509self.h) | 0 | ||||
-rw-r--r-- | modules/x509/x509stor.cpp (renamed from src/x509stor.cpp) | 0 | ||||
-rw-r--r-- | modules/x509/x509stor.h (renamed from include/x509stor.h) | 0 |
25 files changed, 81 insertions, 37 deletions
diff --git a/checks/x509.cpp b/checks/x509.cpp index f2517d02a..5f5c6b1fa 100644 --- a/checks/x509.cpp +++ b/checks/x509.cpp @@ -1,11 +1,15 @@ #include <botan/filters.h> +#include <botan/rsa.h> +#include <botan/dsa.h> + +#ifdef BOTAN_HAS_X509 #include <botan/x509self.h> #include <botan/x509stor.h> #include <botan/x509_ca.h> #include <botan/pkcs10.h> -#include <botan/rsa.h> -#include <botan/dsa.h> +#endif + using namespace Botan; #include <iostream> @@ -14,9 +18,7 @@ using namespace Botan; #include "validate.h" #include "common.h" -X509_Cert_Options ca_opts(); -X509_Cert_Options req_opts1(); -X509_Cert_Options req_opts2(); +#ifdef BOTAN_HAS_X509 namespace { @@ -44,6 +46,45 @@ u64bit key_id(const Public_Key* key) return id; } + +/* Return some option sets */ +X509_Cert_Options ca_opts() + { + X509_Cert_Options opts("Test CA/US/Botan Project/Testing"); + + opts.uri = "http://botan.randombit.net"; + opts.dns = "botan.randombit.net"; + opts.email = "[email protected]"; + + opts.CA_key(1); + + return opts; + } + +X509_Cert_Options req_opts1() + { + X509_Cert_Options opts("Test User 1/US/Botan Project/Testing"); + + opts.uri = "http://botan.randombit.net"; + opts.dns = "botan.randombit.net"; + opts.email = "[email protected]"; + + return opts; + } + +X509_Cert_Options req_opts2() + { + X509_Cert_Options opts("Test User 2/US/Botan Project/Testing"); + + opts.uri = "http://botan.randombit.net"; + opts.dns = "botan.randombit.net"; + opts.email = "[email protected]"; + + opts.add_ex_constraint("PKIX.EmailProtection"); + + return opts; + } + u32bit check_against_copy(const Private_Key& orig, RandomNumberGenerator& rng) { @@ -157,40 +198,12 @@ void do_x509_tests(RandomNumberGenerator& rng) std::cout << std::endl; } -/* Return some option sets */ -X509_Cert_Options ca_opts() - { - X509_Cert_Options opts("Test CA/US/Botan Project/Testing"); - - opts.uri = "http://botan.randombit.net"; - opts.dns = "botan.randombit.net"; - opts.email = "[email protected]"; - - opts.CA_key(1); - - return opts; - } +#else -X509_Cert_Options req_opts1() +void do_x509_tests(RandomNumberGenerator&) { - X509_Cert_Options opts("Test User 1/US/Botan Project/Testing"); - - opts.uri = "http://botan.randombit.net"; - opts.dns = "botan.randombit.net"; - opts.email = "[email protected]"; - - return opts; + std::cout << "Skipping Botan X.509 tests (disabled in build)\n"; } -X509_Cert_Options req_opts2() - { - X509_Cert_Options opts("Test User 2/US/Botan Project/Testing"); - - opts.uri = "http://botan.randombit.net"; - opts.dns = "botan.randombit.net"; - opts.email = "[email protected]"; +#endif - opts.add_ex_constraint("PKIX.EmailProtection"); - - return opts; - } diff --git a/src/certstor.cpp b/modules/x509/certstor.cpp index 2b51590ad..2b51590ad 100644 --- a/src/certstor.cpp +++ b/modules/x509/certstor.cpp diff --git a/include/certstor.h b/modules/x509/certstor.h index ca0480496..ca0480496 100644 --- a/include/certstor.h +++ b/modules/x509/certstor.h diff --git a/src/crl_ent.cpp b/modules/x509/crl_ent.cpp index 4a85b99c2..4a85b99c2 100644 --- a/src/crl_ent.cpp +++ b/modules/x509/crl_ent.cpp diff --git a/include/crl_ent.h b/modules/x509/crl_ent.h index 05a9338b3..05a9338b3 100644 --- a/include/crl_ent.h +++ b/modules/x509/crl_ent.h diff --git a/modules/x509/modinfo.txt b/modules/x509/modinfo.txt new file mode 100644 index 000000000..162d3931b --- /dev/null +++ b/modules/x509/modinfo.txt @@ -0,0 +1,31 @@ +realname "X.509" + +define X509 + +load_on auto + +<add> +certstor.h +certstor.cpp +crl_ent.cpp +crl_ent.h +pkcs10.h +pkcs10.cpp +x509_ca.cpp +x509_ca.h +x509_crl.cpp +x509_crl.h +x509_ext.cpp +x509_ext.h +x509_obj.cpp +x509_obj.h +x509cert.cpp +x509cert.h +x509find.cpp +x509find.h +x509opt.cpp +x509self.cpp +x509self.h +x509stor.cpp +x509stor.h +</add> diff --git a/src/pkcs10.cpp b/modules/x509/pkcs10.cpp index bd21cca7d..bd21cca7d 100644 --- a/src/pkcs10.cpp +++ b/modules/x509/pkcs10.cpp diff --git a/include/pkcs10.h b/modules/x509/pkcs10.h index f688688ee..f688688ee 100644 --- a/include/pkcs10.h +++ b/modules/x509/pkcs10.h diff --git a/src/x509_ca.cpp b/modules/x509/x509_ca.cpp index d455e4988..d455e4988 100644 --- a/src/x509_ca.cpp +++ b/modules/x509/x509_ca.cpp diff --git a/include/x509_ca.h b/modules/x509/x509_ca.h index 969e62558..969e62558 100644 --- a/include/x509_ca.h +++ b/modules/x509/x509_ca.h diff --git a/src/x509_crl.cpp b/modules/x509/x509_crl.cpp index 306c78bd1..306c78bd1 100644 --- a/src/x509_crl.cpp +++ b/modules/x509/x509_crl.cpp diff --git a/include/x509_crl.h b/modules/x509/x509_crl.h index f7623b940..f7623b940 100644 --- a/include/x509_crl.h +++ b/modules/x509/x509_crl.h diff --git a/src/x509_ext.cpp b/modules/x509/x509_ext.cpp index 3595a0492..3595a0492 100644 --- a/src/x509_ext.cpp +++ b/modules/x509/x509_ext.cpp diff --git a/include/x509_ext.h b/modules/x509/x509_ext.h index 5b302df0d..5b302df0d 100644 --- a/include/x509_ext.h +++ b/modules/x509/x509_ext.h diff --git a/src/x509_obj.cpp b/modules/x509/x509_obj.cpp index e78790949..e78790949 100644 --- a/src/x509_obj.cpp +++ b/modules/x509/x509_obj.cpp diff --git a/include/x509_obj.h b/modules/x509/x509_obj.h index 8808fd686..8808fd686 100644 --- a/include/x509_obj.h +++ b/modules/x509/x509_obj.h diff --git a/src/x509cert.cpp b/modules/x509/x509cert.cpp index b24e6a036..b24e6a036 100644 --- a/src/x509cert.cpp +++ b/modules/x509/x509cert.cpp diff --git a/include/x509cert.h b/modules/x509/x509cert.h index c8dc2c435..c8dc2c435 100644 --- a/include/x509cert.h +++ b/modules/x509/x509cert.h diff --git a/src/x509find.cpp b/modules/x509/x509find.cpp index 83d02449d..83d02449d 100644 --- a/src/x509find.cpp +++ b/modules/x509/x509find.cpp diff --git a/include/x509find.h b/modules/x509/x509find.h index 65781199f..65781199f 100644 --- a/include/x509find.h +++ b/modules/x509/x509find.h diff --git a/src/x509opt.cpp b/modules/x509/x509opt.cpp index 716884ed5..716884ed5 100644 --- a/src/x509opt.cpp +++ b/modules/x509/x509opt.cpp diff --git a/src/x509self.cpp b/modules/x509/x509self.cpp index 6c3baae9b..6c3baae9b 100644 --- a/src/x509self.cpp +++ b/modules/x509/x509self.cpp diff --git a/include/x509self.h b/modules/x509/x509self.h index 2f83a12be..2f83a12be 100644 --- a/include/x509self.h +++ b/modules/x509/x509self.h diff --git a/src/x509stor.cpp b/modules/x509/x509stor.cpp index f050b33b1..f050b33b1 100644 --- a/src/x509stor.cpp +++ b/modules/x509/x509stor.cpp diff --git a/include/x509stor.h b/modules/x509/x509stor.h index 3f3f38ea0..3f3f38ea0 100644 --- a/include/x509stor.h +++ b/modules/x509/x509stor.h |