Skip to content

Commit

Permalink
Merge pull request #631 from tomato42/sphinx-docs
Browse files Browse the repository at this point in the history
Change to Sphinx for documentation generation
  • Loading branch information
tomato42 committed Jan 29, 2020
2 parents ca536d1 + bcd7101 commit d9fec58
Show file tree
Hide file tree
Showing 28 changed files with 736 additions and 255 deletions.
22 changes: 11 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@

1. [Fork it](https://github.com/tomato42/tlsfuzzer/fork)
1. Clone it
* `git clone git@github.com:<your-github-nick>/tlsfuzzer.git`
* `cd tlsfuzzer`
* `git clone git@github.com:<your-github-nick>/tlsfuzzer.git`
* `cd tlsfuzzer`
1. Install dependencies (as root)
* `pip2 install coverage ecdsa epydoc unittest2 mock`
* `pip3 install coverage ecdsa`
* `pip2 install -r build-requirements.txt`
* `pip3 install -r build-requirements.txt`
* `pip2 install coverage ecdsa Sphinx sphinx-rtd-theme unittest2 mock`
* `pip3 install coverage ecdsa`
* `pip2 install -r build-requirements.txt`
* `pip3 install -r build-requirements.txt`
1. Download tlslite-ng
* `git clone https://github.com/tomato42/tlslite-ng.git .tlslite-ng`
* `ln -s .tlslite-ng/tlslite tlslite`
* `git clone https://github.com/tomato42/tlslite-ng.git .tlslite-ng`
* `ln -s .tlslite-ng/tlslite tlslite`
1. Verify installation
* `make test`
* `make test`
1. Create your feature branch (`git checkout -b my-new-feature`)
1. Write changes, follow Python standard guidelines, include test cases
1. Run tests (`make test`)
Expand Down Expand Up @@ -101,7 +101,7 @@ On Fedora they can be installed using:
dnf install python2-ecdsa python3-ecdsa pylint python3-pylint \
python2-diff-cover python3-diff-cover python2-coverage python3-coverage \
python2-hypothesis python3-hypothesis python3-libs python2-unittest2 \
python2-mock epydoc
python2-mock
```

On RHEL 7 you will need to enable [EPEL](https://fedoraproject.org/wiki/EPEL),
Expand All @@ -111,7 +111,7 @@ after which you can install the dependencies using:
```
yum install python-ecdsa python34-ecdsa pylint \
python-coverage python34-coverage python2-hypothesis \
python34-libs python-unittest2 python-mock python-pip epydoc
python34-libs python-unittest2 python-mock python-pip
pip2 install diff-cover
pip3 install hypothesis diff-cover pylint
```
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ clean:
rm -rf coverage.xml
rm -rf dist/ build/
rm -rf htmlcov/
$(MAKE) -C docs clean

.PHONY : install
install:
./setup.py install

epydoc:
epydoc --html -v -o epydoc --graph all tlsfuzzer
.PHONY : docs
docs:
$(MAKE) -C docs html

test:
epydoc --check --fail-on-error -v tlsfuzzer
test: docs
coverage2 run --branch --source tlsfuzzer -m unittest discover -v
coverage3 run --append --branch --source tlsfuzzer -m unittest discover -v
coverage3 report -m
Expand Down
19 changes: 19 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%

:end
popd
187 changes: 187 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('../../'))


# -- Project information -----------------------------------------------------

project = u'tlsfuzzer'
copyright = u'2020, Red Hat'
author = u'Hubert Kario'

# The short X.Y version
version = u''
# The full version, including alpha/beta/rc tags
release = u'0.0.0'


# -- General configuration ---------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.coverage',
'sphinx.ext.imgmath',
'sphinx.ext.viewcode',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = None


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}


# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'tlsfuzzerdoc'


# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'tlsfuzzer.tex', u'tlsfuzzer Documentation',
u'Hubert Kario', 'manual'),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'tlsfuzzer', u'tlsfuzzer Documentation',
[author], 1)
]


# -- Options for Texinfo output ----------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'tlsfuzzer', u'tlsfuzzer Documentation',
author, 'tlsfuzzer', 'Framework and test suite for the TLS protocol.',
'Miscellaneous'),
]


# -- Options for Epub output -------------------------------------------------

# Bibliographic Dublin Core info.
epub_title = project

# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#
# epub_identifier = ''

# A unique identification for the text.
#
# epub_uid = ''

# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']


# -- Extension configuration -------------------------------------------------

# -- Options for intersphinx extension ---------------------------------------

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None,
'https://tlslite-ng.readthedocs.io/en/latest/': None}
44 changes: 44 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.. tlsfuzzer documentation master file, created by
sphinx-quickstart on Wed Jan 22 18:09:38 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to tlsfuzzer!
=====================

``tlsfuzzer`` is a framework for testing SSL and TLS implementations.

It allows for testing standards-compliance of a given implementation, testing
for presence of known vulnerabilities as well as fuzzing of the SSL and TLS
connections.

Ready-to-use scripts are already provided for testing significant parts of
the TLS protocols.

This framework is commonly used to test OpenSSL, GnuTLS,
`NSS <https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS>`_ and many
other implementations.

While not all features standardised for TLS are supported (it's a work
in progress), the most common features are fully supported:
TLS 1.2, TLS 1.3, RSA certificates, ECDSA certificates, ECDHE key exchange,
client certificates, AES-GCM, Chacha20-Poly1305 ciphers, etc. See the
`issue tracker <https://github.com/tomato42/tlsfuzzer/issues>`_ on GitHub
to see wanted, but not yet implemented features.


.. toctree::
:maxdepth: 2
:caption: Contents:
:hidden:

installation
modules


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

0 comments on commit d9fec58

Please sign in to comment.