mutable: remove some dead code, rearrange use of populate_pubkey
This commit is contained in:
parent
db4ddfc1bd
commit
7e1f9761e8
|
@ -137,12 +137,6 @@ class MutableFileNode:
|
||||||
privkey = enc.process(enc_privkey)
|
privkey = enc.process(enc_privkey)
|
||||||
return privkey
|
return privkey
|
||||||
|
|
||||||
def _populate(self, stuff):
|
|
||||||
# the Retrieval object calls this with values it discovers when
|
|
||||||
# downloading the slot. This is how a MutableFileNode that was
|
|
||||||
# created from a URI learns about its full key.
|
|
||||||
pass
|
|
||||||
|
|
||||||
def _populate_pubkey(self, pubkey):
|
def _populate_pubkey(self, pubkey):
|
||||||
self._pubkey = pubkey
|
self._pubkey = pubkey
|
||||||
def _populate_required_shares(self, required_shares):
|
def _populate_required_shares(self, required_shares):
|
||||||
|
|
|
@ -558,13 +558,13 @@ class ServermapUpdater:
|
||||||
(seqnum, root_hash, IV, k, N, segsize, datalength,
|
(seqnum, root_hash, IV, k, N, segsize, datalength,
|
||||||
pubkey_s, signature, prefix) = unpack_prefix_and_signature(data)
|
pubkey_s, signature, prefix) = unpack_prefix_and_signature(data)
|
||||||
|
|
||||||
if not self._node._pubkey:
|
if not self._node.get_pubkey():
|
||||||
fingerprint = hashutil.ssk_pubkey_fingerprint_hash(pubkey_s)
|
fingerprint = hashutil.ssk_pubkey_fingerprint_hash(pubkey_s)
|
||||||
assert len(fingerprint) == 32
|
assert len(fingerprint) == 32
|
||||||
if fingerprint != self._node._fingerprint:
|
if fingerprint != self._node._fingerprint:
|
||||||
raise CorruptShareError(peerid, shnum,
|
raise CorruptShareError(peerid, shnum,
|
||||||
"pubkey doesn't match fingerprint")
|
"pubkey doesn't match fingerprint")
|
||||||
self._node._pubkey = self._deserialize_pubkey(pubkey_s)
|
self._node._populate_pubkey(self._deserialize_pubkey(pubkey_s))
|
||||||
|
|
||||||
if self._need_privkey:
|
if self._need_privkey:
|
||||||
self._try_to_extract_privkey(data, peerid, shnum)
|
self._try_to_extract_privkey(data, peerid, shnum)
|
||||||
|
|
Loading…
Reference in New Issue