The unified diff between revisions [4e40e885..] and [48b49b84..] is displayed below. It can also be downloaded as a raw diff.

#
#
# patch "include/ber_dec.h"
#  from [90a3ca1bab5637490b05f6dce57aca75fc794b01]
#    to [754b0c94f34f9805ed0c722aed0ad78e50ae4106]
#
# patch "include/config.h"
#  from [5acbd2e041ef13562c85e988834f2b252c3c5a9d]
#    to [1f8bab46263a80c5eef84f1289b3db99e664f7f5]
#
# patch "include/der_enc.h"
#  from [2bd34135e89958c97778e92d5206b2b411887961]
#    to [b1f6c6128e409f1de66951eb53c755c29d3c39d6]
#
# patch "include/enums.h"
#  from [9fcb09ae52890c249997ea8355a9bd7d3464f2de]
#    to [68dbc74e69996937ec15c7cc13b99a04ae0f1d6d]
#
# patch "include/pbe_pkcs.h"
#  from [248bcd00abf4a4a4b5738c0f96efd110d2ed2ad1]
#    to [c926118676c621edd61e938a2bd3accfbcdac059]
#
# patch "include/pkcs8.h"
#  from [ef4946e935d2220ffd54106dadaa2929192852a7]
#    to [11646eb7ca38fe68ddf5772f941c751f2018d8a2]
#
# patch "include/pubkey.h"
#  from [ba87e679f0c99d8b1598b04532e4eeba3085a1ea]
#    to [71ef0bd35dfe81ebaf664951498d28e5baff138c]
#
# patch "include/x509_key.h"
#  from [24c8a01c58a33a951d43cf1b375a5fc538132dbd]
#    to [5a679997d1530382c7efe4c6e968491f5b867fd3]
#
# patch "include/x509_obj.h"
#  from [4048a6db99a88fd595d1df2010303cf3189dddcc]
#    to [5f88a957a4890dd111b65216613fdc16f055fb46]
#
# patch "src/config.cpp"
#  from [05674501b6d1aee0d9468c4c28b8238db74a1798]
#    to [ff5bbdf754d3f6d5ab8b0b6ea331153b6a9f30f0]
#
# patch "src/x509_ca.cpp"
#  from [404db596206c91d8c714db6ea88a0736b36bed47]
#    to [be4d6707e41b77daaa91d7cb8c421ca6e16c19a8]
#
============================================================
--- include/ber_dec.h	90a3ca1bab5637490b05f6dce57aca75fc794b01
+++ include/ber_dec.h	754b0c94f34f9805ed0c722aed0ad78e50ae4106
@@ -8,6 +8,7 @@

 #include <botan/asn1_oid.h>
 #include <botan/data_src.h>
+#include <botan/enums.h>

 namespace Botan {

============================================================
--- include/config.h	5acbd2e041ef13562c85e988834f2b252c3c5a9d
+++ include/config.h	1f8bab46263a80c5eef84f1289b3db99e664f7f5
@@ -7,7 +7,6 @@
 #define BOTAN_POLICY_CONF_H__

 #include <botan/mutex.h>
-#include <botan/enums.h>
 #include <string>
 #include <vector>
 #include <map>
@@ -39,9 +38,6 @@ class BOTAN_DLL Config
       std::string deref_alias(const std::string&) const;

       void load_inifile(const std::string&);
-
-      static void choose_sig_format(const std::string&, std::string&,
-                                    Signature_Format&);
    private:
       Config(const Config&) {}
       Config& operator=(const Config&) { return (*this); }
============================================================
--- include/der_enc.h	2bd34135e89958c97778e92d5206b2b411887961
+++ include/der_enc.h	b1f6c6128e409f1de66951eb53c755c29d3c39d6
@@ -6,8 +6,7 @@
 #ifndef BOTAN_DER_ENCODER_H__
 #define BOTAN_DER_ENCODER_H__

-#include <botan/secmem.h>
-#include <botan/enums.h>
+#include <botan/asn1_int.h>
 #include <vector>

 namespace Botan {
============================================================
--- include/enums.h	9fcb09ae52890c249997ea8355a9bd7d3464f2de
+++ include/enums.h	68dbc74e69996937ec15c7cc13b99a04ae0f1d6d
@@ -53,8 +53,6 @@ enum Cipher_Dir { ENCRYPTION, DECRYPTION

 enum Cipher_Dir { ENCRYPTION, DECRYPTION };

-enum Signature_Format { IEEE_1363, DER_SEQUENCE };
-
 enum Character_Set {
    LOCAL_CHARSET,
    UCS2_CHARSET,
============================================================
--- include/pbe_pkcs.h	248bcd00abf4a4a4b5738c0f96efd110d2ed2ad1
+++ include/pbe_pkcs.h	c926118676c621edd61e938a2bd3accfbcdac059
@@ -8,6 +8,7 @@

 #include <botan/pbe.h>
 #include <botan/pipe.h>
+#include <botan/enums.h>

 namespace Botan {

============================================================
--- include/pkcs8.h	ef4946e935d2220ffd54106dadaa2929192852a7
+++ include/pkcs8.h	11646eb7ca38fe68ddf5772f941c751f2018d8a2
@@ -8,6 +8,7 @@

 #include <botan/x509_key.h>
 #include <botan/ui.h>
+#include <botan/enums.h>

 namespace Botan {

============================================================
--- include/pubkey.h	ba87e679f0c99d8b1598b04532e4eeba3085a1ea
+++ include/pubkey.h	71ef0bd35dfe81ebaf664951498d28e5baff138c
@@ -12,6 +12,8 @@ namespace Botan {

 namespace Botan {

+enum Signature_Format { IEEE_1363, DER_SEQUENCE };
+
 /*************************************************
 * Public Key Encryptor                           *
 *************************************************/
============================================================
--- include/x509_key.h	24c8a01c58a33a951d43cf1b375a5fc538132dbd
+++ include/x509_key.h	5a679997d1530382c7efe4c6e968491f5b867fd3
@@ -9,6 +9,7 @@
 #include <botan/pipe.h>
 #include <botan/pk_keys.h>
 #include <botan/alg_id.h>
+#include <botan/enums.h>

 namespace Botan {

============================================================
--- include/x509_obj.h	4048a6db99a88fd595d1df2010303cf3189dddcc
+++ include/x509_obj.h	5f88a957a4890dd111b65216613fdc16f055fb46
@@ -8,6 +8,7 @@

 #include <botan/asn1_obj.h>
 #include <botan/pipe.h>
+#include <botan/enums.h>
 #include <vector>

 namespace Botan {
============================================================
--- src/config.cpp	05674501b6d1aee0d9468c4c28b8238db74a1798
+++ src/config.cpp	ff5bbdf754d3f6d5ab8b0b6ea331153b6a9f30f0
@@ -155,33 +155,4 @@ u32bit Config::option_as_time(const std:
    return scale * to_u32bit(value);
    }

-/*************************************************
-* Choose the signature format for a PK algorithm *
-*************************************************/
-void Config::choose_sig_format(const std::string& algo_name,
-                               std::string& padding,
-                               Signature_Format& format)
-   {
-   if(algo_name == "RSA")
-      {
-      std::string hash = global_state().config().option("x509/ca/rsa_hash");
-
-      if(hash == "")
-         throw Invalid_State("No value set for x509/ca/rsa_hash");
-
-      hash = global_state().config().deref_alias(hash);
-
-      padding = "EMSA3(" + hash + ")";
-      format = IEEE_1363;
-      }
-   else if(algo_name == "DSA")
-      {
-      std::string hash = global_state().config().deref_alias("SHA-1");
-      padding = "EMSA1(" + hash + ")";
-      format = DER_SEQUENCE;
-      }
-   else
-      throw Invalid_Argument("Unknown X.509 signing key type: " + algo_name);
-   }
-
 }
============================================================
--- src/x509_ca.cpp	404db596206c91d8c714db6ea88a0736b36bed47
+++ src/x509_ca.cpp	be4d6707e41b77daaa91d7cb8c421ca6e16c19a8
@@ -11,6 +11,7 @@
 #include <botan/lookup.h>
 #include <botan/look_pk.h>
 #include <botan/numthry.h>
+#include <botan/libstate.h>
 #include <botan/oids.h>
 #include <botan/util.h>
 #include <algorithm>
@@ -236,13 +237,35 @@ PK_Signer* choose_sig_format(const Priva
    {
    std::string padding;
    Signature_Format format;
-   Config::choose_sig_format(key.algo_name(), padding, format);

-   sig_algo.oid = OIDS::lookup(key.algo_name() + "/" + padding);
+   const std::string algo_name = key.algo_name();

+   if(algo_name == "RSA")
+      {
+      std::string hash = global_config().option("x509/ca/rsa_hash");
+
+      if(hash == "")
+         throw Invalid_State("No value set for x509/ca/rsa_hash");
+
+      hash = global_config().deref_alias(hash);
+
+      padding = "EMSA3(" + hash + ")";
+      format = IEEE_1363;
+      }
+   else if(algo_name == "DSA")
+      {
+      std::string hash = global_config().deref_alias("SHA-1");
+      padding = "EMSA1(" + hash + ")";
+      format = DER_SEQUENCE;
+      }
+   else
+      throw Invalid_Argument("Unknown X.509 signing key type: " + algo_name);
+
+   sig_algo.oid = OIDS::lookup(algo_name + "/" + padding);
+
    std::auto_ptr<X509_Encoder> encoding(key.x509_encoder());
    if(!encoding.get())
-      throw Encoding_Error("Key " + key.algo_name() + " does not support "
+      throw Encoding_Error("Key " + algo_name + " does not support "
                            "X.509 encoding");

    sig_algo.parameters = encoding->alg_id().parameters;