Browse Source

Init project

master
aeris 2 years ago
commit
834bdbb532
18 changed files with 383 additions and 0 deletions
  1. +11
    -0
      .gitignore
  2. +4
    -0
      .rspec
  3. +7
    -0
      .travis.yml
  4. +74
    -0
      CODE_OF_CONDUCT.md
  5. +10
    -0
      Gemfile
  6. +58
    -0
      Gemfile.lock
  7. +53
    -0
      README.md
  8. +6
    -0
      Rakefile
  9. +7
    -0
      bin/console
  10. +29
    -0
      bin/rake
  11. +29
    -0
      bin/rspec
  12. +8
    -0
      bin/setup
  13. +37
    -0
      cryptcheck-engine.gemspec
  14. +11
    -0
      lib/cryptcheck/engine.rb
  15. +5
    -0
      lib/cryptcheck/engine/version.rb
  16. +5
    -0
      spec/cryptcheck/engine_spec.rb
  17. +2
    -0
      spec/helpers.rb
  18. +27
    -0
      spec/spec_helper.rb

+ 11
- 0
.gitignore View File

@@ -0,0 +1,11 @@
/.bundle/
/.yardoc
/_yardoc/
/coverage/
/doc/
/pkg/
/spec/reports/
/tmp/

.rspec_status
.rspec_results

+ 4
- 0
.rspec View File

@@ -0,0 +1,4 @@
--format progress
--format documentation --out .rspec_results
--color
--require spec_helper

+ 7
- 0
.travis.yml View File

@@ -0,0 +1,7 @@
---
sudo: false
language: ruby
cache: bundler
rvm:
- 2.6.0
before_install: gem install bundler -v 2.0.1

+ 74
- 0
CODE_OF_CONDUCT.md View File

@@ -0,0 +1,74 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at aeris@imirhil.fr. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

+ 10
- 0
Gemfile View File

@@ -0,0 +1,10 @@
source 'https://rubygems.org'
gemspec

group :test do
gem 'rspec', '~> 3.0'
gem 'simplecov', require: false
# gem 'fuubar', require: false
gem 'pry-byebug'
gem 'colorize'
end

+ 58
- 0
Gemfile.lock View File

@@ -0,0 +1,58 @@
PATH
remote: .
specs:
cryptcheck-engine (0.0.1)

GEM
remote: https://rubygems.org/
specs:
awesome_print (1.8.0)
byebug (11.0.0)
coderay (1.1.2)
colorize (0.8.1)
diff-lcs (1.3)
docile (1.3.1)
json (2.2.0)
method_source (0.9.2)
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
pry-byebug (3.7.0)
byebug (~> 11.0)
pry (~> 0.10)
rake (10.5.0)
rspec (3.8.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-core (3.8.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
simplecov (0.16.1)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)

PLATFORMS
ruby

DEPENDENCIES
awesome_print (~> 1.8.0)
bundler (~> 2.0)
colorize
cryptcheck-engine!
pry (~> 0.12.2)
pry-byebug
rake (~> 10.0)
rspec (~> 3.0)
simplecov

BUNDLED WITH
2.0.1

+ 53
- 0
README.md View File

@@ -0,0 +1,53 @@
# Cryptcheck::Engine

CryptCheck needs support of old, unsecured and so deprecated protocols (SSLv2, SSLv3…) or cipher suite (RC4, 3DES…) to be able to fully cover SSL/TLS verifications.

OpenSSL 1.0 is necessary to support such deprecated things, but new TLS features like TLSv1.3 requires 1.2.
And currently, Ruby is tied to a single OpenSSL binding, only old Ruby version (2.3) supports OpenSSL 1.0 and at the opposite, only 2.5+ supports 1.2.

It will be a real mess to use multiple binding to fully check a server

- multiple OpenSSL bindings
- multiple Ruby versions
- RPC or equivalent
- not totally ordered set for server preferences
- …
This project is a SSL/TLS pure Ruby implementation to remove CryptCheck OpenSSL dependency and so to support together old and new SSL/TLS features.

__**/!\ DON'T USE IT IN PRODUCTION /!\**__
This is not a cryptographic safe implementation!

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'cryptcheck-engine'
```

And then execute:

$ bundle

Or install it yourself as:

$ gem install cryptcheck-engine

## Usage

TODO: Write usage instructions here

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/aeris/cryptcheck-tls. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## Code of Conduct

Everyone interacting in the Cryptcheck::Engine project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://git.imirhil.fr/aeris/cryptcheck-engine/src/branch/master/CODE_OF_CONDUCT.md).

+ 6
- 0
Rakefile View File

@@ -0,0 +1,6 @@
require "bundler/gem_tasks"
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec)

task :default => :spec

+ 7
- 0
bin/console View File

@@ -0,0 +1,7 @@
#!/usr/bin/env ruby
require 'bundler/setup'
require 'cryptcheck/engine'
# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.
require 'pry'
Pry.start

+ 29
- 0
bin/rake View File

@@ -0,0 +1,29 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'rake' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

bundle_binstub = File.expand_path("../bundle", __FILE__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require "rubygems"
require "bundler/setup"

load Gem.bin_path("rake", "rake")

+ 29
- 0
bin/rspec View File

@@ -0,0 +1,29 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'rspec' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

bundle_binstub = File.expand_path("../bundle", __FILE__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require "rubygems"
require "bundler/setup"

load Gem.bin_path("rspec-core", "rspec")

+ 8
- 0
bin/setup View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
set -vx

bundle install

# Do any other automated setup that you need to do here

+ 37
- 0
cryptcheck-engine.gemspec View File

@@ -0,0 +1,37 @@
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'cryptcheck/engine/version'

Gem::Specification.new do |spec|
spec.name = 'cryptcheck-engine'
spec.version = Cryptcheck::Engine::VERSION
spec.authors = %w[aeris]
spec.email = %w[aeris@imirhil.fr]
spec.license = 'AGPL-3.0-or-later'

spec.summary = %q{Pure ruby SSL/TLS engine}
spec.description = <<-EOF
Pure ruby SSL/TLS engine.
This engine is design to test server handshake without relying on OpenSSL,
and so to include together deprecated and newest SSL/TLS protocols, cipher
suites and features.
/!\ DON'T USE IT IN PRODUCTION /!\
This is not a cryptographic safe implementation!
EOF
spec.homepage = 'https://git.imirhil.fr/aeris/cryptcheck-engine/'

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
end
spec.bindir = 'exe'
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = %w[lib]

spec.add_development_dependency 'bundler', '~> 2.0'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'pry', '~> 0.12.2'
spec.add_development_dependency 'awesome_print', '~> 1.8.0'
end

+ 11
- 0
lib/cryptcheck/engine.rb View File

@@ -0,0 +1,11 @@
require 'cryptcheck/engine/version'

fixtures = File.join __dir__, 'engine/fixtures/*.rb'
Dir[fixtures].each { |f| require f }

module Cryptcheck
module Engine
class Error < StandardError;
end
end
end

+ 5
- 0
lib/cryptcheck/engine/version.rb View File

@@ -0,0 +1,5 @@
module Cryptcheck
module Engine
VERSION = '0.0.1'
end
end

+ 5
- 0
spec/cryptcheck/engine_spec.rb View File

@@ -0,0 +1,5 @@
RSpec.describe Cryptcheck::Engine do
it 'has a version number' do
expect(Cryptcheck::Engine::VERSION).not_to be nil
end
end

+ 2
- 0
spec/helpers.rb View File

@@ -0,0 +1,2 @@
module Helpers
end

+ 27
- 0
spec/spec_helper.rb View File

@@ -0,0 +1,27 @@
require 'bundler/setup'
require 'cryptcheck/engine'

require 'awesome_print'
require 'colorize'
require 'pry-byebug'
require 'simplecov'
SimpleCov.start do
add_filter 'spec/'
end

require './spec/helpers'
RSpec.configure do |c|
c.include Helpers
end

RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = '.rspec_status'

# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!

config.expect_with :rspec do |c|
c.syntax = :expect
end
end

Loading…
Cancel
Save