Skip to content

Commit

Permalink
Run Ubuntu 22.04 in test matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
adfoster-r7 committed Jul 19, 2022
1 parent cc52287 commit e0dac97
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 18 deletions.
31 changes: 27 additions & 4 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
name: Verify

# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
actions: none
checks: none
contents: none
deployments: none
id-token: none
issues: none
discussions: none
packages: none
pages: none
pull-requests: none
repository-projects: none
security-events: none
statuses: none

on:
push:
branches:
Expand All @@ -10,7 +26,7 @@ on:

jobs:
test:
runs-on: ubuntu-18.04
runs-on: ${{ matrix.os }}
timeout-minutes: 40

strategy:
Expand All @@ -19,15 +35,22 @@ jobs:
ruby:
- 2.6
- 2.7
- 3.0.3
- 3.1.1
- 3.0
- 3.1
os:
- ubuntu-18.04
- ubuntu-22.04
exclude:
- { os: ubuntu-22.04, ruby: 2.6 }
- { os: ubuntu-22.04, ruby: 2.7 }
- { os: ubuntu-22.04, ruby: 3.0 }
test_cmd:
- bundle exec rspec

env:
RAILS_ENV: test

name: Ruby ${{ matrix.ruby }} - ${{ matrix.test_cmd }}
name: ${{ matrix.os }} - Ruby ${{ matrix.ruby }} - ${{ matrix.test_cmd }}
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down
2 changes: 0 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ group :development do
end

group :test do
# simplecov test formatter and uploader for Coveralls.io
gem "coveralls", '~>0.8.23', :require => false
# Testing
gem 'rspec'
# Coverage reports
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# RubySMB

[![Code Climate](https://codeclimate.com/github/rapid7/ruby_smb.png)](https://codeclimate.com/github/rapid7/ruby_smb)
[![Coverage Status](https://coveralls.io/repos/github/rapid7/ruby_smb/badge.svg?branch=master)](https://coveralls.io/github/rapid7/ruby_smb?branch=master)

This is a native Ruby implementation of the SMB Protocol Family. It currently supports:

Expand Down
6 changes: 3 additions & 3 deletions lib/ruby_smb/signing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ module Signing
# @param [RubySMB::GenericPacket] packet The packet to sign.
# @return [RubySMB::GenericPacket] the signed packet
def smb1_sign(packet)
packet = Signing::smb1_sign(packet, @session_key, @sequence_counter)
@sequence_counter += 1
packet = Signing::smb1_sign(packet, session_key, sequence_counter)
self.sequence_counter += 1

packet
end
Expand Down Expand Up @@ -41,7 +41,7 @@ def self.smb1_sign(packet, session_key, sequence_counter)
# @param [RubySMB::GenericPacket] packet The packet to sign.
# @return [RubySMB::GenericPacket] the signed packet
def smb2_sign(packet)
Signing::smb2_sign(packet, @session_key)
Signing::smb2_sign(packet, session_key)
end

# Take an SMB2 packet and sign it. This version is a module function that
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/ruby_smb/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
subject(:client) { described_class.new(dispatcher, username: username, password: password) }
let(:smb1_client) { described_class.new(dispatcher, smb2: false, smb3: false, username: username, password: password) }
let(:smb2_client) { described_class.new(dispatcher, smb1: false, smb3: false, username: username, password: password) }
let(:smb3_client) { described_class.new(dispatcher, smb1: false, smb2: false, username: username, password: password) }
let(:smb3_client) { described_class.new(displib/msf/core/handler/reverse_ssh.rbatcher, smb1: false, smb2: false, username: username, password: password) }
let(:empty_packet) { RubySMB::SMB1::Packet::EmptyPacket.new }
let(:error_packet) { RubySMB::SMB2::Packet::ErrorPacket.new }

Expand Down
13 changes: 6 additions & 7 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Enable legacy providers
ENV['OPENSSL_CONF'] = File.expand_path(
File.join(File.dirname(__FILE__), 'fixtures', 'openssl.conf')
)

require 'simplecov'

SimpleCov.start unless SimpleCov.running
Expand All @@ -6,13 +11,7 @@
require 'coveralls'
require 'ruby_smb'

if ENV['CI'] == 'true'
# don't generate local report as it is inaccessible on travis-ci, which is
# why coveralls is being used.
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
else
SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
end
SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter

Dir['./spec/support/**/*.rb'].sort.each { |f| require f }

Expand Down
14 changes: 14 additions & 0 deletions spec/support/openssl.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
openssl_conf = openssl_init

[openssl_init]
providers = provider_sect

[provider_sect]
default = default_sect
legacy = legacy_sect

[default_sect]
activate = 1

[legacy_sect]
activate = 1

0 comments on commit e0dac97

Please sign in to comment.