diff options
author | lloyd <[email protected]> | 2010-09-03 13:23:45 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-09-03 13:23:45 +0000 |
commit | cb9a034650620e4d392a2d2f978b687078e5002c (patch) | |
tree | d80914034f7130bc479d3c1bb2ea9f13619a5dd5 /src/constructs/tss | |
parent | e201c88a7931bc892c7d608ee9130ceb7c0f2fef (diff) |
Update some callers that were using Hex_Encoder or Hex_Decoder but
really didn't need to.
The ones in symkey and big_code were actually calling accessor
functions to do the encoding themselves without a Pipe (should have
definitely recognized that as a code smell). These versions have
changed semantically with this checkin - previously they would completely
ignore bad inputs, but now invalid inputs are rejected. For instance, you
cannot say
SymmetricKey key("Only some of this is hex, most of it isn't");
And expect to get a valid key formed by filtering out the non-hex
characters and then decoding it. This is almost certainly a good thing.
Also fix include in Botan.xs
Diffstat (limited to 'src/constructs/tss')
-rw-r--r-- | src/constructs/tss/tss.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/constructs/tss/tss.cpp b/src/constructs/tss/tss.cpp index 0782a27d1..ad45cfcec 100644 --- a/src/constructs/tss/tss.cpp +++ b/src/constructs/tss/tss.cpp @@ -106,9 +106,7 @@ HashFunction* get_rtss_hash_by_id(byte id) RTSS_Share::RTSS_Share(const std::string& hex_input) { - Pipe pipe(new Hex_Decoder); - pipe.process_msg(hex_input); - contents = pipe.read_all(); + contents = hex_decode(hex_input); } byte RTSS_Share::share_id() const @@ -121,9 +119,7 @@ byte RTSS_Share::share_id() const std::string RTSS_Share::to_string() const { - Pipe pipe(new Hex_Encoder); - pipe.process_msg(contents); - return pipe.read_all_as_string(); + return hex_encode(&contents[0], contents.size()); } std::vector<RTSS_Share> |