diff options
author | Linus Nordberg <linus@nordberg.se> | 2014-09-25 17:02:03 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 2014-09-25 17:02:03 +0200 |
commit | 8ca2b519859e9ed2284f596a907b63ba615bb7c5 (patch) | |
tree | 416469a5ff4ffb8293d8a7787972f7b6bddc72da /src | |
parent | 256ec932dc0621c64a427da7ea76531c116263e7 (diff) |
Use correct LogID.
Diffstat (limited to 'src')
-rw-r--r-- | src/plop.erl | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/plop.erl b/src/plop.erl index b549616..d9daf8d 100644 --- a/src/plop.erl +++ b/src/plop.erl @@ -81,10 +81,7 @@ init([PrivKeyfile, PubKeyfile]) -> %% LogID = crypto:hash(sha256, %% public_key:der_encode('RSAPublicKey', Public_key)), %% Read EC keypair. - {Private_key, Public_key} = read_keyfiles_ec(PrivKeyfile, PubKeyfile), - LogID = crypto:hash(sha256, public_key:der_encode( - 'ECPoint', - element(2, element(1, Public_key)))), % FIXME! + {Private_key, Public_key, LogID} = read_keyfiles_ec(PrivKeyfile, PubKeyfile), _Tree = ht:reset_tree([db:size() - 1]), {ok, #state{pubkey = Public_key, privkey = Private_key, @@ -297,7 +294,9 @@ read_keyfiles_ec(PrivkeyFile, Pubkeyfile) -> Point = #'ECPoint'{point = Octets}, Publickey = {Point, Params}, - {Privatekey, Publickey}. + KeyID = crypto:hash(sha256, AlgoDer), + + {Privatekey, Publickey, KeyID}. decode_key(Entry) -> public_key:pem_entry_decode(Entry). |