Rename .find_message to .read_message. Enforce stricter signature lengths in ::Lexer

This commit is contained in:
Netscape Navigator 2020-04-06 07:35:27 -05:00
parent 8a7eec964a
commit 29c67be3ca
4 changed files with 4 additions and 4 deletions

View File

@ -4,7 +4,7 @@ module Pigeon
s = Pigeon::Storage.current
content = s
.find_all(Pigeon::LocalIdentity.current.multihash)
.map { |multihash| s.find_message(multihash) }
.map { |multihash| s.read_message(multihash) }
.sort_by(&:depth)
.map { |message| message.render }
.join(BUNDLE_MESSAGE_SEPARATOR)

View File

@ -27,7 +27,7 @@ module Pigeon
KIND = /kind #{ALPHANUMERICISH}\n/
BODY_ENTRY = /#{ALPHANUMERICISH}:#{ANY_VALUE}\n/
FOOTER_ENTRY = /signature .*{87,88}\.sig\.ed25519\n?/
FOOTER_ENTRY = /signature .*{103}\.sig\.ed25519\n?/
LEXER_STATES = [HEADER = :header, BODY = :body, FOOTER = :footer]

View File

@ -46,7 +46,7 @@ module Pigeon
end
def save!
return store.find_message(multihash) if store.message?(multihash)
return store.read_message(multihash) if store.message?(multihash)
calculate_signature
verify_depth_prev_and_depth
verify_signature

View File

@ -37,7 +37,7 @@ module Pigeon
end
end
def find_message(multihash)
def read_message(multihash)
read { store[MESG_NS].fetch(multihash) }
end