]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
use a pre-computed key if the OpenSSL version doesn't support generating rsa keys...
authorMark Andrews <marka@isc.org>
Fri, 15 Jun 2012 00:41:31 +0000 (10:41 +1000)
committerMark Andrews <marka@isc.org>
Fri, 15 Jun 2012 00:41:31 +0000 (10:41 +1000)
bin/tests/system/conf.sh.in
bin/tests/system/rsabigexponent/bigkey.c

index be509e7f39c45ae823379721363359e564502ec5..e87de421900e9ac2424a1b314f3f250144024058 100644 (file)
@@ -51,13 +51,13 @@ JOURNALPRINT=$TOP/bin/tools/named-journalprint
 
 # The "stress" test is not run by default since it creates enough
 # load on the machine to make it unusable to other users.
-# v6synth rsabigexponent
+# v6synth
 SUBDIRS="acl allow_query addzone autosign builtin cacheclean checkconf
         checknames checkzone database dlv dlvauto dlz dlzexternal
          dname dns64 dnssec ecdsa forward glue gost ixfr inline limits
         logfileconfig lwresd masterfile masterformat metadata notify
         nsupdate pending pkcs11 redirect resolver rndc rpz rrsetorder
-        sortlist smartsign staticstub statistics stub
+        rsabigexponent sortlist smartsign staticstub statistics stub
         tkey tsig tsiggss unknown upforwd views xfer xferquota zonechecks"
 
 # PERL will be an empty string if no perl interpreter was found.
index d7ccf379cf71f99409365f963f636dd1fe1cd2c4..f65226203d99e9a94b75e90a6ec96ed96fbcafdc 100644 (file)
@@ -26,6 +26,7 @@
 #include <isc/entropy.h>
 #include <isc/mem.h>
 #include <isc/region.h>
+#include <isc/stdio.h>
 #include <isc/string.h>
 #include <isc/util.h>
 
 #include <dst/dst.h>
 #include <dst/result.h>
 
-#include <openssl/err.h>
+#include <openssl/opensslv.h>
+#if OPENSSL_VERSION_NUMBER <= 0x00908000L
+
+/*
+ * Use a fixed key file pair if OpenSSL doesn't support > 32 bit exponents.
+ */
 
+int
+main(int argc, char **argv) {
+       FILE *fp;
+       
+       UNUSED(argc);
+       UNUSED(argv);
+
+       fp = fopen("Kexample.+005+10264.private", "w");
+       if (fp == NULL) {
+               perror("fopen(Kexample.+005+10264.private)");
+               exit(1);
+       }
+
+       fputs("Private-key-format: v1.3\n", fp);
+       fputs("Algorithm: 5 (RSASHA1)\n", fp);
+       fputs("Modulus: yhNbLRPA7VpLCXcgMvBwsfe7taVaTvLPY3AI+YolKwqD6"
+             "/3nLlCcz4kBOTOkQBf9bmO98WnKuOWoxuEOgudoDvQOzXNl9RJtt61"
+             "IRMscAlsVtTIfAjPLhcGy32l2s5VYWWVXx/qkcf+i/JC38YXIuVdiA"
+             "MtbgQV40ffM4lAbZ7M=\n", fp);
+       fputs("PublicExponent: AQAAAAAAAQ==\n", fp);
+       fputs("PrivateExponent: gfXvioazoFIJp3/H2kJncrRZaqjIf9+21CL1i"
+             "XecBOof03er8ym5AKopZQM8ie+qxvhDkIJ8YDrB7UbDxmFpPceHWYM"
+             "X0vDWQCIiEiKzRfCsBOjgJu6HS15G/oZDqDwKat+yegtzxhg48BCPq"
+             "zfHLXXUvBTA/HK/u8L1LwggqHk=\n", fp);
+       fputs("Prime1: 7xAPHsNnS0w7CoEnIQiu+SrmHsy86HKJOEm9FiQybRVCwf"
+             "h4ZRQl+Z9mUbb9skjPvkM6ZeuzXTFkOjdck2y1NQ==\n", fp);
+       fputs("Prime2: 2GRzzqyRR2gfITPug8Rddxt647/2DrAuKricX/AXyGcuHM"
+             "vTZ+v+mfgJn6TFqSn4SBF2zHJ876lWbQ+12aNORw==\n", fp);
+       fputs("Exponent1: PnGTwxiT59N/Rq/FSAwcwoAudiF/X3iK0X09j9Dl8cY"
+             "DYAJ0bhB9es1LIaSsgLSER2b1kHbCp+FQXGVHJeZ07Q==\n", fp);
+       fputs("Exponent2: Ui+zxA/zbnUSYnz+wdbrfBD2aTeKytZG4ASI3oPDZag"
+             "V9YC0eZRPjI82KQcFXoj1b/fV/HzT9/9rhU4mvCGjLw==\n", fp);
+       fputs("Coefficient: sdCL6AdOaCr9c+RO8NCA492MOT9w7K9d/HauC+fif"
+             "2iWN36dA+BCKaeldS/+6ZTnV2ZVyVFQTeLJM8hplxDBwQ==\n", fp);
+
+       if (fclose(fp) != 0) {
+               perror("fclose(Kexample.+005+10264.private)");
+               exit(1);
+       }
+
+       fp = fopen("Kexample.+005+10264.key", "w");
+       if (fp == NULL) {
+               perror("fopen(Kexample.+005+10264.key)");
+               exit(1);
+       }
+
+       fputs("; This is a zone-signing key, keyid 10264, for example.\n", fp);
+       fputs("example. IN DNSKEY 256 3 5 BwEAAAAAAAHKE1stE8DtWksJdyA"
+             "y8HCx97u1pVpO8s9jcAj5iiUrCoPr /ecuUJzPiQE5M6RAF/1uY73x"
+             "acq45ajG4Q6C52gO9A7Nc2X1Em23rUhE yxwCWxW1Mh8CM8uFwbLfaX"
+             "azlVhZZVfH+qRx/6L8kLfxhci5V2IAy1uB BXjR98ziUBtnsw==\n", fp);
+
+       if (fclose(fp) != 0) {
+               perror("close(Kexample.+005+10264.key)");
+               exit(1);
+       }
+
+       exit(0);
+}
+#else
+#include <openssl/err.h>
 #include <openssl/objects.h>
 #include <openssl/rsa.h>
-#if OPENSSL_VERSION_NUMBER <= 0x00908000L
-#error Require an OpenSSL version >= 9.8.0a
-#endif
 #include <openssl/bn.h>
 #include <openssl/evp.h>
 
@@ -169,6 +233,7 @@ main(int argc, char **argv) {
        isc_mem_destroy(&mctx);
        return (0);
 }
+#endif
 
 #else /* OPENSSL */