aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/ec_dompar
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-02 00:26:39 +0000
committerlloyd <[email protected]>2010-03-02 00:26:39 +0000
commitdd4984b39fb4d5e43cc9ba97f7180b0780c04217 (patch)
tree2e4852a6362c5e312015c0396ce96ef3dd1b4bb0 /src/pubkey/ec_dompar
parent2e2b5c5b158da43095ed0b4ee595c1b9c38ac97f (diff)
Set PEM constructor (taking a string) to default to "". In this case,
don't initialize.
Diffstat (limited to 'src/pubkey/ec_dompar')
-rw-r--r--src/pubkey/ec_dompar/ec_dompar.cpp16
-rw-r--r--src/pubkey/ec_dompar/ec_dompar.h2
2 files changed, 12 insertions, 6 deletions
diff --git a/src/pubkey/ec_dompar/ec_dompar.cpp b/src/pubkey/ec_dompar/ec_dompar.cpp
index 544257552..7910e898f 100644
--- a/src/pubkey/ec_dompar/ec_dompar.cpp
+++ b/src/pubkey/ec_dompar/ec_dompar.cpp
@@ -25,14 +25,18 @@ EC_Domain_Params::EC_Domain_Params(const OID& domain_oid)
throw Lookup_Error("No ECC domain data for " + domain_oid.as_string());
*this = EC_Domain_Params(pem);
+ oid = domain_oid.as_string();
}
EC_Domain_Params::EC_Domain_Params(const std::string& pem)
{
- DataSource_Memory input(pem);
+ if(pem != "")
+ {
+ DataSource_Memory input(pem);
- *this = EC_Domain_Params(
- PEM_Code::decode_check_label(input, "ECC DOMAIN PARAMETERS"));
+ *this = EC_Domain_Params(
+ PEM_Code::decode_check_label(input, "ECC DOMAIN PARAMETERS"));
+ }
}
EC_Domain_Params::EC_Domain_Params(const MemoryRegion<byte>& ber_data)
@@ -110,8 +114,10 @@ EC_Domain_Params::DER_encode(EC_Domain_Params_Encoding form) const
.encode(curve.get_p())
.end_cons()
.start_cons(SEQUENCE)
- .encode(BigInt::encode_1363(curve.get_a(), p_bytes), OCTET_STRING)
- .encode(BigInt::encode_1363(curve.get_b(), p_bytes), OCTET_STRING)
+ .encode(BigInt::encode_1363(curve.get_a(), p_bytes),
+ OCTET_STRING)
+ .encode(BigInt::encode_1363(curve.get_b(), p_bytes),
+ OCTET_STRING)
.end_cons()
.encode(EC2OSP(base_point, PointGFp::UNCOMPRESSED), OCTET_STRING)
.encode(order)
diff --git a/src/pubkey/ec_dompar/ec_dompar.h b/src/pubkey/ec_dompar/ec_dompar.h
index e063389ca..6789976d0 100644
--- a/src/pubkey/ec_dompar/ec_dompar.h
+++ b/src/pubkey/ec_dompar/ec_dompar.h
@@ -63,7 +63,7 @@ class BOTAN_DLL EC_Domain_Params
* Create an EC domain from PEM encoding (as from PEM_encode)
* @param pem data
*/
- EC_Domain_Params(const std::string& pem);
+ EC_Domain_Params(const std::string& pem = "");
/**
* Create the DER encoding of this domain