diff options
-rw-r--r-- | cryptography/bindings/openssl/api.py | 2 | ||||
-rw-r--r-- | cryptography/bindings/openssl/rand.py | 37 | ||||
-rw-r--r-- | cryptography/bindings/openssl/rsa.py | 31 | ||||
-rw-r--r-- | docs/contributing.rst | 8 |
4 files changed, 74 insertions, 4 deletions
diff --git a/cryptography/bindings/openssl/api.py b/cryptography/bindings/openssl/api.py index 8b13277e..12927782 100644 --- a/cryptography/bindings/openssl/api.py +++ b/cryptography/bindings/openssl/api.py @@ -30,6 +30,8 @@ class API(object): "dh", "dsa", "evp", + "rand", + "rsa", "opensslv", ] diff --git a/cryptography/bindings/openssl/rand.py b/cryptography/bindings/openssl/rand.py new file mode 100644 index 00000000..e4f6be23 --- /dev/null +++ b/cryptography/bindings/openssl/rand.py @@ -0,0 +1,37 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +INCLUDES = """ +#include <openssl/rand.h> +""" + +TYPES = """ +""" + +FUNCTIONS = """ +void RAND_seed(const void *, int); +void RAND_add(const void *, int, double); +int RAND_status(); +int RAND_egd(const char *); +int RAND_egd_bytes(const char *, int); +int RAND_query_egd_bytes(const char *, unsigned char *, int); +const char *RAND_file_name(char *, size_t); +int RAND_load_file(const char *, long); +int RAND_write_file(const char *); +void RAND_cleanup(); +int RAND_bytes(unsigned char *, int); +int RAND_pseudo_bytes(unsigned char *, int); +""" + +MACROS = """ +""" diff --git a/cryptography/bindings/openssl/rsa.py b/cryptography/bindings/openssl/rsa.py new file mode 100644 index 00000000..c8bf1cc0 --- /dev/null +++ b/cryptography/bindings/openssl/rsa.py @@ -0,0 +1,31 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +INCLUDES = """ +#include <openssl/rsa.h> +""" + +TYPES = """ +typedef ... RSA; +typedef ... BN_GENCB; +""" + +FUNCTIONS = """ +RSA *RSA_new(); +void RSA_free(RSA *); +int RSA_generate_key_ex(RSA *, int, BIGNUM *, BN_GENCB *); +int RSA_check_key(const RSA *); +""" + +MACROS = """ +""" diff --git a/docs/contributing.rst b/docs/contributing.rst index 8f6a178e..1f4c1ca9 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -81,7 +81,7 @@ development dependencies. These are listed in ``dev-requirements.txt`` and they can be installed in a `virtualenv`_ using `pip`_. Once you've installed the dependencies, install ``cryptography`` in ``editable`` mode. For example: -.. code-block:: sh +.. code-block:: console # Create a virtualenv and activate it $ pip install --requirement dev-requirements.txt @@ -96,7 +96,7 @@ Running Tests designed to be run using `pytest`_. `pytest`_ will discover the tests automatically, so all you have to do is: -.. code-block:: sh +.. code-block:: console $ py.test ... @@ -108,7 +108,7 @@ You can also verify that the tests pass on other supported Python interpreters. For this we use `tox`_, which will automatically create a `virtualenv`_ for each supported Python version and run the tests. For example: -.. code-block:: sh +.. code-block:: console $ tox ... @@ -131,7 +131,7 @@ written in `reStructured Text`_ and rendered using `Sphinx`_. Use `tox`_ to build the documentation. For example: -.. code-block:: sh +.. code-block:: console $ tox -e docs ... |