aboutsummaryrefslogtreecommitdiffstats
path: root/src/cert
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-11-18 06:49:50 +0000
committerlloyd <[email protected]>2009-11-18 06:49:50 +0000
commit5e80eff19cc7377d67314c1266a0060f1f201882 (patch)
tree902cefb65ea0f986567eff866ac93d94947ad0dc /src/cert
parent74528281a8fce78fc99d6f480577b7645bd5be5c (diff)
Much cleaning up in ECDSA, though it's still rather a mess (and 50x slower
than OpenSSL... that's a problem for another branch though).
Diffstat (limited to 'src/cert')
-rw-r--r--src/cert/x509/x509_ca.cpp18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/cert/x509/x509_ca.cpp b/src/cert/x509/x509_ca.cpp
index 48ec0bd1c..a4159ad2b 100644
--- a/src/cert/x509/x509_ca.cpp
+++ b/src/cert/x509/x509_ca.cpp
@@ -21,8 +21,6 @@
#include <memory>
#include <set>
-#include <stdio.h>
-
namespace Botan {
/*
@@ -251,7 +249,6 @@ PK_Signer* choose_sig_format(const Private_Key& key,
AlgorithmIdentifier& sig_algo)
{
std::string padding;
- Signature_Format format;
const std::string algo_name = key.algo_name();
@@ -260,29 +257,20 @@ PK_Signer* choose_sig_format(const Private_Key& key,
throw Algorithm_Not_Found(hash_fn);
if(key.max_input_bits() < proto_hash->OUTPUT_LENGTH*8)
- {
- printf("%d %d\n", key.max_input_bits(), proto_hash->OUTPUT_LENGTH*8);
throw Invalid_Argument("Key is too small for chosen hash function");
- }
if(algo_name == "RSA")
- {
padding = "EMSA3";
- format = IEEE_1363;
- }
else if(algo_name == "DSA")
- {
padding = "EMSA1";
- format = DER_SEQUENCE;
- }
else if(algo_name == "ECDSA")
- {
padding = "EMSA1_BSI";
- format = IEEE_1363;
- }
else
throw Invalid_Argument("Unknown X.509 signing key type: " + algo_name);
+ Signature_Format format =
+ (key.message_parts() > 1) ? DER_SEQUENCE : IEEE_1363;
+
padding = padding + '(' + proto_hash->name() + ')';
sig_algo.oid = OIDS::lookup(algo_name + "/" + padding);