diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/changelog.rst | 9 | ||||
-rw-r--r-- | docs/conf.py | 11 | ||||
-rw-r--r-- | docs/contributing.rst | 10 | ||||
-rw-r--r-- | docs/hazmat/backends/commoncrypto.rst | 20 | ||||
-rw-r--r-- | docs/hazmat/backends/index.rst | 1 | ||||
-rw-r--r-- | docs/hazmat/backends/interfaces.rst | 19 | ||||
-rw-r--r-- | docs/hazmat/backends/openssl.rst | 6 | ||||
-rw-r--r-- | docs/hazmat/bindings/commoncrypto.rst | 2 | ||||
-rw-r--r-- | docs/hazmat/primitives/symmetric-encryption.rst | 5 | ||||
-rw-r--r-- | docs/spelling_wordlist.txt | 1 |
10 files changed, 62 insertions, 22 deletions
diff --git a/docs/changelog.rst b/docs/changelog.rst index 41db635e..0a03c396 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,11 +1,18 @@ Changelog ========= + 0.2 - 2014-XX-XX ~~~~~~~~~~~~~~~~ -* In development. +**In development** + +* Added :doc:`/hazmat/backends/commoncrypto` with hash and HMAC support. +* Added initial :doc:`/hazmat/bindings/commoncrypto`. +* Removed ``register_cipher_adapter`` method from + :class:`~cryptography.hazmat.backends.interfaces.CipherBackend`. 0.1 - 2014-01-08 ~~~~~~~~~~~~~~~~ * Initial release. + diff --git a/docs/conf.py b/docs/conf.py index a42dcb22..3486fb38 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -19,6 +19,11 @@ try: except ImportError: sphinx_rtd_theme = None +try: + from sphinxcontrib import spelling +except ImportError: + spelling = None + # 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 @@ -38,9 +43,11 @@ extensions = [ 'sphinx.ext.intersphinx', 'sphinx.ext.viewcode', 'cryptography-docs', - 'sphinxcontrib.spelling', ] +if spelling is not None: + extensions.append('sphinxcontrib.spelling') + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -263,3 +270,5 @@ texinfo_documents = [ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {'http://docs.python.org/': None} + +epub_theme = 'epub' diff --git a/docs/contributing.rst b/docs/contributing.rst index 8e32c368..4bb1461d 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -250,6 +250,16 @@ each supported Python version and run the tests. For example: You may not have all the required Python versions installed, in which case you will see one or more ``InterpreterNotFound`` errors. + +Explicit Backend Selection +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +While testing you may want to run tests against a subset of the backends that +cryptography supports. Explicit backend selection can be done via the +``--backend`` flag. This flag should be passed to ``py.test`` with a comma +delimited list of backend names. To use it with ``tox`` you must pass it as +``tox -- --backend=openssl``. + Building Documentation ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/hazmat/backends/commoncrypto.rst b/docs/hazmat/backends/commoncrypto.rst new file mode 100644 index 00000000..af2032b6 --- /dev/null +++ b/docs/hazmat/backends/commoncrypto.rst @@ -0,0 +1,20 @@ +.. hazmat:: + +CommonCrypto Backend +==================== + +The `CommonCrypto`_ C library provided by Apple on OS X and iOS. + +.. currentmodule:: cryptography.hazmat.backends.commoncrypto.backend + +.. versionadded:: 0.2 + +.. data:: cryptography.hazmat.backends.commoncrypto.backend + + This is the exposed API for the CommonCrypto backend. It has one public attribute. + + .. attribute:: name + + The string name of this backend: ``"commoncrypto"`` + +.. _`CommonCrypto`: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/Common%20Crypto.3cc.html diff --git a/docs/hazmat/backends/index.rst b/docs/hazmat/backends/index.rst index 06951281..dbc0724e 100644 --- a/docs/hazmat/backends/index.rst +++ b/docs/hazmat/backends/index.rst @@ -31,4 +31,5 @@ Individual Backends :maxdepth: 1 openssl + commoncrypto interfaces diff --git a/docs/hazmat/backends/interfaces.rst b/docs/hazmat/backends/interfaces.rst index 5b6cd64d..11e2f2a2 100644 --- a/docs/hazmat/backends/interfaces.rst +++ b/docs/hazmat/backends/interfaces.rst @@ -33,25 +33,6 @@ A specific ``backend`` may provide one or more of these interfaces. :returns: ``True`` if the specified ``cipher`` and ``mode`` combination is supported by this backend, otherwise ``False`` - .. method:: register_cipher_adapter(cipher_cls, mode_cls, adapter) - - Register an adapter which can be used to create a backend specific - object from instances of the - :class:`~cryptography.hazmat.primitives.interfaces.CipherAlgorithm` and - the :class:`~cryptography.hazmat.primitives.interfaces.Mode` primitives. - - :param cipher_cls: A class whose instances provide - :class:`~cryptography.hazmat.primitives.interfaces.CipherAlgorithm` - :param mode_cls: A class whose instances provide: - :class:`~cryptography.hazmat.primitives.interfaces.Mode` - :param adapter: A ``function`` that takes 3 arguments, ``backend`` (a - :class:`CipherBackend` provider), ``cipher`` (a - :class:`~cryptography.hazmat.primitives.interfaces.CipherAlgorithm` - provider ), and ``mode`` (a - :class:`~cryptography.hazmat.primitives.interfaces.Mode` provider). - It returns a backend specific object which may be used to construct - a :class:`~cryptogrpahy.hazmat.primitives.interfaces.CipherContext`. - .. method:: create_symmetric_encryption_ctx(cipher, mode) diff --git a/docs/hazmat/backends/openssl.rst b/docs/hazmat/backends/openssl.rst index 404573a3..a1f2d28a 100644 --- a/docs/hazmat/backends/openssl.rst +++ b/docs/hazmat/backends/openssl.rst @@ -7,7 +7,11 @@ The `OpenSSL`_ C library. .. data:: cryptography.hazmat.backends.openssl.backend - This is the exposed API for the OpenSSL backend. It has no public attributes. + This is the exposed API for the OpenSSL backend. It has one public attribute. + + .. attribute:: name + + The string name of this backend: ``"openssl"`` Using your own OpenSSL on Linux ------------------------------- diff --git a/docs/hazmat/bindings/commoncrypto.rst b/docs/hazmat/bindings/commoncrypto.rst index 25535e02..c4f614c2 100644 --- a/docs/hazmat/bindings/commoncrypto.rst +++ b/docs/hazmat/bindings/commoncrypto.rst @@ -5,6 +5,8 @@ CommonCrypto Binding .. currentmodule:: cryptography.hazmat.bindings.commoncrypto.binding +.. versionadded:: 0.2 + These are `CFFI`_ bindings to the `CommonCrypto`_ C library. It is available on Mac OS X. diff --git a/docs/hazmat/primitives/symmetric-encryption.rst b/docs/hazmat/primitives/symmetric-encryption.rst index 83165690..7d954046 100644 --- a/docs/hazmat/primitives/symmetric-encryption.rst +++ b/docs/hazmat/primitives/symmetric-encryption.rst @@ -324,6 +324,11 @@ Modes return (iv, ciphertext, encryptor.tag) def decrypt(key, associated_data, iv, ciphertext, tag): + if len(tag) != 16: + raise ValueError( + "tag must be 16 bytes -- truncation not supported" + ) + # Construct a Cipher object, with the key, iv, and additionally the # GCM tag used for authenticating the message. decryptor = Cipher( diff --git a/docs/spelling_wordlist.txt b/docs/spelling_wordlist.txt index 97356c24..75628ba5 100644 --- a/docs/spelling_wordlist.txt +++ b/docs/spelling_wordlist.txt @@ -14,6 +14,7 @@ hazmat indistinguishability introspectability invariants +iOS pickleable plaintext testability |