diff options
Diffstat (limited to 'src/lib/pubkey/ec_group')
-rw-r--r-- | src/lib/pubkey/ec_group/ec_group.cpp | 4 | ||||
-rw-r--r-- | src/lib/pubkey/ec_group/ec_group.h | 2 | ||||
-rw-r--r-- | src/lib/pubkey/ec_group/ec_named.cpp | 5 |
3 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/pubkey/ec_group/ec_group.cpp b/src/lib/pubkey/ec_group/ec_group.cpp index a5262fd5e..cbc628195 100644 --- a/src/lib/pubkey/ec_group/ec_group.cpp +++ b/src/lib/pubkey/ec_group/ec_group.cpp @@ -17,9 +17,9 @@ namespace Botan { EC_Group::EC_Group(const OID& domain_oid) { - const char* pem = PEM_for_named_group(OIDS::lookup(domain_oid)); + const std::string pem = PEM_for_named_group(OIDS::lookup(domain_oid)); - if(!pem) + if(pem == "") throw Lookup_Error("No ECC domain data for " + domain_oid.as_string()); *this = EC_Group(pem); diff --git a/src/lib/pubkey/ec_group/ec_group.h b/src/lib/pubkey/ec_group/ec_group.h index b623a876d..15c09a54d 100644 --- a/src/lib/pubkey/ec_group/ec_group.h +++ b/src/lib/pubkey/ec_group/ec_group.h @@ -125,7 +125,7 @@ class BOTAN_DLL EC_Group /** * Return PEM representation of named EC group */ - static const char* PEM_for_named_group(const std::string& name); + static std::string PEM_for_named_group(const std::string& name); private: CurveGFp m_curve; diff --git a/src/lib/pubkey/ec_group/ec_named.cpp b/src/lib/pubkey/ec_group/ec_named.cpp index c19b8ed37..2aef0ad31 100644 --- a/src/lib/pubkey/ec_group/ec_named.cpp +++ b/src/lib/pubkey/ec_group/ec_named.cpp @@ -9,7 +9,8 @@ namespace Botan { -const char* EC_Group::PEM_for_named_group(const std::string& name) +//static +std::string EC_Group::PEM_for_named_group(const std::string& name) { if(name == "secp160k1") return @@ -270,7 +271,7 @@ const char* EC_Group::PEM_for_named_group(const std::string& name) return BOTAN_HOUSE_ECC_CURVE_PEM; #endif - return nullptr; + return ""; } } |