diff options
author | Daniel Neus <[email protected]> | 2016-01-04 21:35:24 +0100 |
---|---|---|
committer | Daniel Neus <[email protected]> | 2016-01-04 21:35:24 +0100 |
commit | 443a5c25db02aa7ac505fdc3b0fa60c1d584a5f1 (patch) | |
tree | 6683223da4ea9917914c0eb9d7d1110cc86ac6f6 /src/lib/pubkey/pkcs8.cpp | |
parent | 9d3ad9a0f44a9321185ed9f221c828dac81b9f0c (diff) |
String comparision fixes
fix PVS-Studio perfomance warnings
Diffstat (limited to 'src/lib/pubkey/pkcs8.cpp')
-rw-r--r-- | src/lib/pubkey/pkcs8.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/pubkey/pkcs8.cpp b/src/lib/pubkey/pkcs8.cpp index 1a021a283..ddf9be2f0 100644 --- a/src/lib/pubkey/pkcs8.cpp +++ b/src/lib/pubkey/pkcs8.cpp @@ -153,7 +153,7 @@ namespace { std::pair<std::string, std::string> choose_pbe_params(const std::string& pbe_algo, const std::string& key_algo) { - if(pbe_algo == "") + if(pbe_algo.empty()) { // Defaults: if(key_algo == "Curve25519" || key_algo == "McEliece") @@ -202,7 +202,7 @@ std::string PEM_encode(const Private_Key& key, std::chrono::milliseconds msec, const std::string& pbe_algo) { - if(pass == "") + if(pass.empty()) return PEM_encode(key); return PEM_Code::encode(PKCS8::BER_encode(key, rng, pass, msec, pbe_algo), @@ -223,7 +223,7 @@ Private_Key* load_key(DataSource& source, secure_vector<byte> pkcs8_key = PKCS8_decode(source, get_pass, alg_id, is_encrypted); const std::string alg_name = OIDS::lookup(alg_id.oid); - if(alg_name == "" || alg_name == alg_id.oid.as_string()) + if(alg_name.empty() || alg_name == alg_id.oid.as_string()) throw PKCS8_Exception("Unknown algorithm OID: " + alg_id.oid.as_string()); |