diff options
author | lloyd <[email protected]> | 2013-07-19 16:30:38 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2013-07-19 16:30:38 +0000 |
commit | 98ceb0cb0cb46d71d1090f29d859dc99e5b54c5a (patch) | |
tree | 803665a2fe82a99509476ac7688f832b0ef1d5f5 | |
parent | 21fb81c0aa42dad874b2844804b12e69f80cd41a (diff) |
Fix calling on deleted objects
-rw-r--r-- | src/pk_pad/emsa2/emsa2.cpp | 5 | ||||
-rw-r--r-- | src/rng/randpool/randpool.cpp | 3 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/pk_pad/emsa2/emsa2.cpp b/src/pk_pad/emsa2/emsa2.cpp index d299ddacd..02a3dbe72 100644 --- a/src/pk_pad/emsa2/emsa2.cpp +++ b/src/pk_pad/emsa2/emsa2.cpp @@ -99,12 +99,13 @@ EMSA2::EMSA2(HashFunction* hash_in) : hash(hash_in) { empty_hash = hash->final(); - hash_id = ieee1363_hash_id(hash->name()); + const std::string hash_name = hash->name(); + hash_id = ieee1363_hash_id(hash_name); if(hash_id == 0) { delete hash; - throw Encoding_Error("EMSA2 cannot be used with " + hash->name()); + throw Encoding_Error("EMSA2 no hash identifier for " + hash_name); } } diff --git a/src/rng/randpool/randpool.cpp b/src/rng/randpool/randpool.cpp index ef55f3975..aa029fef3 100644 --- a/src/rng/randpool/randpool.cpp +++ b/src/rng/randpool/randpool.cpp @@ -184,8 +184,7 @@ Randpool::Randpool(BlockCipher* cipher_in, { delete cipher; delete mac; - throw Internal_Error("Randpool: Invalid algorithm combination " + - cipher->name() + "/" + mac->name()); + throw Internal_Error("Randpool: Invalid algorithm combination"); } buffer.resize(BLOCK_SIZE); |