From 55eeab6529d2eb238bbfa96fadf466ad5d430f93 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Mon, 20 Apr 2020 01:03:26 +1200 Subject: [PATCH 1/6] Fuzz the framer. --- fuzz/framer/bake.rb | 16 ++++++++++++++++ fuzz/framer/input/data.txt | Bin 0 -> 20 bytes fuzz/framer/script.rb | 26 ++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 fuzz/framer/bake.rb create mode 100644 fuzz/framer/input/data.txt create mode 100755 fuzz/framer/script.rb diff --git a/fuzz/framer/bake.rb b/fuzz/framer/bake.rb new file mode 100644 index 0000000..4a8a51f --- /dev/null +++ b/fuzz/framer/bake.rb @@ -0,0 +1,16 @@ + +# Run the fuzz test. +def run + system("AFL_SKIP_BIN_CHECK=1 afl-fuzz -i input/ -o output/ -t 1000 -m 1000 -- ruby script.rb") +end + +def generate + require_relative '../../lib/protocol/http2/framer' + + framer = Protocol::HTTP2::Framer.new($stdout) + + frame = Protocol::HTTP2::DataFrame.new + frame.pack("Hello World") + + framer.write_frame(frame) +end diff --git a/fuzz/framer/input/data.txt b/fuzz/framer/input/data.txt new file mode 100644 index 0000000000000000000000000000000000000000..0a3680b0a04351fd9b35d62192ea2fb179659026 GIT binary patch literal 20 XcmZQz;AQ{=kJOx;e1-7*qMQ@}7}^9V literal 0 HcmV?d00001 diff --git a/fuzz/framer/script.rb b/fuzz/framer/script.rb new file mode 100755 index 0000000..b1dd74c --- /dev/null +++ b/fuzz/framer/script.rb @@ -0,0 +1,26 @@ +#!/usr/bin/env ruby + +require 'socket' +require_relative '../../lib/protocol/http2/framer' + +def test + framer = Protocol::HTTP2::Framer.new($stdin) + + while frame = framer.read_frame + pp frame + end +rescue EOFError + # Ignore. +end + +if ENV["_"] =~ /afl/ + require 'kisaten' + + Kisaten.crash_at [Exception], [EOFError, Protocol::HTTP2::FrameSizeError], Signal.list['USR1'] + + while Kisaten.loop 10_000 + test + end +else + test +end From a53da1a94b248d8c2ac4109f1ee4b65434e6719f Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Mon, 20 Apr 2020 11:23:21 +1200 Subject: [PATCH 2/6] Ignore expected errors. --- fuzz/framer/script.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuzz/framer/script.rb b/fuzz/framer/script.rb index b1dd74c..89b1457 100755 --- a/fuzz/framer/script.rb +++ b/fuzz/framer/script.rb @@ -16,7 +16,7 @@ def test if ENV["_"] =~ /afl/ require 'kisaten' - Kisaten.crash_at [Exception], [EOFError, Protocol::HTTP2::FrameSizeError], Signal.list['USR1'] + Kisaten.crash_at [Exception], [EOFError, Protocol::HTTP2::FrameSizeError, Protocol::HTTP2::ProtocolError], Signal.list['USR1'] while Kisaten.loop 10_000 test From 9e945fcaacb8f75e41332990d9de7f0898bc4934 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Mon, 20 Apr 2020 14:49:49 +1200 Subject: [PATCH 3/6] Better determination if the connection is closed. --- lib/protocol/http2/connection.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/protocol/http2/connection.rb b/lib/protocol/http2/connection.rb index 05373e6..f81f24a 100644 --- a/lib/protocol/http2/connection.rb +++ b/lib/protocol/http2/connection.rb @@ -99,8 +99,9 @@ def maximum_concurrent_streams # The highest stream_id that has been successfully accepted by this connection. attr :remote_stream_id + # Whether the connection is effectively or actually closed. def closed? - @state == :closed + @state == :closed || @framer.nil? end def delete(id) From 35839179bd0e96ffc75c3602482e692097274c3b Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Mon, 20 Apr 2020 14:50:03 +1200 Subject: [PATCH 4/6] Let afl figure out latency. --- fuzz/framer/bake.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuzz/framer/bake.rb b/fuzz/framer/bake.rb index 4a8a51f..da71bd1 100644 --- a/fuzz/framer/bake.rb +++ b/fuzz/framer/bake.rb @@ -1,7 +1,7 @@ # Run the fuzz test. def run - system("AFL_SKIP_BIN_CHECK=1 afl-fuzz -i input/ -o output/ -t 1000 -m 1000 -- ruby script.rb") + system("AFL_SKIP_BIN_CHECK=1 afl-fuzz -i input/ -o output/ -m 100 -- ruby script.rb") end def generate From c62c43a6bf5c8d2456b2243cad6ee77df2e82481 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Mon, 20 Apr 2020 14:57:36 +1200 Subject: [PATCH 5/6] Prefer github actions. --- .github/workflows/development.yml | 48 +++++++++++++++++++++++++++++++ .travis.yml | 22 -------------- README.md | 2 +- 3 files changed, 49 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/development.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml new file mode 100644 index 0000000..4bd7f9e --- /dev/null +++ b/.github/workflows/development.yml @@ -0,0 +1,48 @@ +name: Development + +on: [push, pull_request] + +jobs: + test: + runs-on: ${{matrix.os}}-latest + continue-on-error: ${{matrix.experimental}} + + strategy: + matrix: + experimental: [false] + + os: + - ubuntu + - macos + + ruby: + - 2.5 + - 2.6 + - 2.7 + + include: + # - experimental: true + # os: ubuntu + # ruby: truffleruby + # - experimental: true + # os: ubuntu + # ruby: jruby + - experimental: true + os: ubuntu + ruby: head + - experimental: true + os: ubuntu + ruby: 2.6 + env: COVERAGE=PartialSummary,Coveralls + + steps: + - uses: actions/checkout@v1 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{matrix.ruby}} + + - name: Install dependencies + run: ${{matrix.env}} bundle install + + - name: Run tests + run: ${{matrix.env}} bundle exec rspec diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 29285b3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: ruby -dist: xenial -cache: bundler - -script: bundle exec rspec - -matrix: - include: - - rvm: 2.5 - - rvm: 2.6 - - rvm: 2.7 - - rvm: 2.6 - env: COVERAGE=PartialSummary,Coveralls - - rvm: 2.7 - - rvm: truffleruby - - rvm: jruby-head - env: JRUBY_OPTS="--debug -X+O" - - rvm: ruby-head - allow_failures: - - rvm: truffleruby - - rvm: ruby-head - - rvm: jruby-head diff --git a/README.md b/README.md index bef0f06..72d076d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Provides a low-level implementation of the HTTP/2 protocol. -[![Build Status](https://travis-ci.com/socketry/protocol-http2.svg?branch=master)](https://travis-ci.com/socketry/protocol-http2?branch=master) +[![Actions Status](https://github.com/socketry/protocol-http2/workflows/Development/badge.svg)](https://github.com/socketry/protocol-http2/actions?workflow=Development) ## Installation From 70982fb77216d9e9e3681e70b8ec1a1b817f8f39 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Mon, 20 Apr 2020 15:08:18 +1200 Subject: [PATCH 6/6] Minor version bump. --- lib/protocol/http2/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protocol/http2/version.rb b/lib/protocol/http2/version.rb index 3ef7e89..0881dd7 100644 --- a/lib/protocol/http2/version.rb +++ b/lib/protocol/http2/version.rb @@ -20,6 +20,6 @@ module Protocol module HTTP2 - VERSION = "0.13.3" + VERSION = "0.14.0" end end pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy