Skip to content

Commit

Permalink
docs: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
thekuwayama committed Apr 17, 2024
1 parent 62e3e16 commit 878a2e0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/tttls1.3/message/extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ def <<(ex)
store(ex.extension_type, ex)
end

# removing and replacing extensions from EncodedClientHelloInner
# with a single "ech_outer_extensions"
#
# for example
# - before
# - self.keys: [A B C D E]
# - param : [D B]
# - after remove_and_replace!
# - self.keys: [A C E]
# - return : [A C E ech_outer_extensions[D B]]
# @param outer_extensions [Array of TTTLS13::Message::ExtensionType]
#
# @return [TTTLS13::Message::Extensions] for EncodedClientHelloInner
Expand All @@ -117,11 +127,8 @@ def remove_and_replace!(outer_extensions)
tmp1.each { |_, v| self << v; replaced << v }
tmp2.each { |_, v| self << v }

# removing and replacing extensions from EncodedClientHelloInner
# with a single "ech_outer_extensions"
replaced << Message::Extension::ECHOuterExtensions.new(tmp2.keys) \
unless tmp2.keys.empty?

replaced
end

Expand Down

0 comments on commit 878a2e0

Please sign in to comment.