From 1f33553b8d33770572d4982e3862ed5bc52ea9c7 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sat, 5 Oct 2013 17:52:09 -0500 Subject: Bindings for OpenSSL's RSA. Refs #77 --- cryptography/bindings/openssl/api.py | 1 + cryptography/bindings/openssl/rsa.py | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 cryptography/bindings/openssl/rsa.py diff --git a/cryptography/bindings/openssl/api.py b/cryptography/bindings/openssl/api.py index 8b13277e..0da1af61 100644 --- a/cryptography/bindings/openssl/api.py +++ b/cryptography/bindings/openssl/api.py @@ -30,6 +30,7 @@ class API(object): "dh", "dsa", "evp", + "rsa", "opensslv", ] diff --git a/cryptography/bindings/openssl/rsa.py b/cryptography/bindings/openssl/rsa.py new file mode 100644 index 00000000..03892135 --- /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 +""" + +TYPES = """ +typedef ... RSA; +typedef ... BN_GENCB; +""" + +FUNCTIONS = """ +RSA * RSA_new(void); +void RSA_free(RSA *r); +int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb); +int RSA_check_key(const RSA *); +""" + +MACROS = """ +""" -- cgit v1.2.3 From 31f4047b3d945555b8c1aefccb1038a0919266e6 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sat, 5 Oct 2013 18:00:08 -0500 Subject: remove local variable names from function declarations --- cryptography/bindings/openssl/rsa.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cryptography/bindings/openssl/rsa.py b/cryptography/bindings/openssl/rsa.py index 03892135..49cde721 100644 --- a/cryptography/bindings/openssl/rsa.py +++ b/cryptography/bindings/openssl/rsa.py @@ -21,9 +21,9 @@ typedef ... BN_GENCB; """ FUNCTIONS = """ -RSA * RSA_new(void); -void RSA_free(RSA *r); -int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb); +RSA* RSA_new(); +void RSA_free(RSA *); +int RSA_generate_key_ex(RSA *rsa, int, BIGNUM *, BN_GENCB *); int RSA_check_key(const RSA *); """ -- cgit v1.2.3 From dddbc837cc927b18fccc1b01677a4e2dbed7e2b1 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sat, 5 Oct 2013 18:04:52 -0500 Subject: too many rsas makes me rsa blind --- cryptography/bindings/openssl/rsa.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cryptography/bindings/openssl/rsa.py b/cryptography/bindings/openssl/rsa.py index 49cde721..75afb578 100644 --- a/cryptography/bindings/openssl/rsa.py +++ b/cryptography/bindings/openssl/rsa.py @@ -23,7 +23,7 @@ typedef ... BN_GENCB; FUNCTIONS = """ RSA* RSA_new(); void RSA_free(RSA *); -int RSA_generate_key_ex(RSA *rsa, int, BIGNUM *, BN_GENCB *); +int RSA_generate_key_ex(RSA *, int, BIGNUM *, BN_GENCB *); int RSA_check_key(const RSA *); """ -- cgit v1.2.3 From 64c0fd9271c2716f11f529b86148f73b84cad420 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sat, 5 Oct 2013 18:09:39 -0500 Subject: jokers to the left, pointers to the right --- cryptography/bindings/openssl/rsa.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cryptography/bindings/openssl/rsa.py b/cryptography/bindings/openssl/rsa.py index 75afb578..c8bf1cc0 100644 --- a/cryptography/bindings/openssl/rsa.py +++ b/cryptography/bindings/openssl/rsa.py @@ -21,7 +21,7 @@ typedef ... BN_GENCB; """ FUNCTIONS = """ -RSA* RSA_new(); +RSA *RSA_new(); void RSA_free(RSA *); int RSA_generate_key_ex(RSA *, int, BIGNUM *, BN_GENCB *); int RSA_check_key(const RSA *); -- cgit v1.2.3