Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
shrapnel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
shrapnel
Commits
dc7042cc
Commit
dc7042cc
authored
Jun 27, 2014
by
Sam Rushing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow curves params to come from private key (where openssl DER-encodes them).
parent
0ac2c550
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
9 deletions
+14
-9
coro/ssl/openssl.pxi
coro/ssl/openssl.pxi
+1
-0
coro/ssl/openssl.pyx
coro/ssl/openssl.pyx
+13
-9
No files found.
coro/ssl/openssl.pxi
View file @
dc7042cc
...
...
@@ -157,6 +157,7 @@ cdef extern from "openssl/evp.h":
cdef
extern
from
"openssl/ec.h"
:
ctypedef
struct
EC_KEY
ctypedef
struct
EC_POINT
EC_KEY
*
EC_KEY_new
()
EC_KEY
*
EC_KEY_new_by_curve_name
(
int
)
int
EC_KEY_generate_key
(
EC_KEY
*
)
void
EC_KEY_free
(
EC_KEY
*
)
...
...
coro/ssl/openssl.pyx
View file @
dc7042cc
...
...
@@ -18,7 +18,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# -*- Mode:
Pyrex
-*-
# -*- Mode:
Cython; indent-tabs-mode: nil
-*-
from
libc.errno
cimport
errno
...
...
@@ -1283,16 +1283,20 @@ cdef class ecdsa:
def
__init__
(
self
,
object
curve
):
cdef
int
nid
if
type
(
curve
)
is
int
:
nid
=
curve
if
curve
is
None
:
# no curve specified
self
.
key
=
EC_KEY_new
()
else
:
nid
=
OBJ_sn2nid
(
curve
)
if
nid
==
0
:
raise_ssl_error
()
else
:
self
.
key
=
EC_KEY_new_by_curve_name
(
nid
)
if
self
.
key
is
NULL
:
if
type
(
curve
)
is
int
:
nid
=
curve
else
:
nid
=
OBJ_sn2nid
(
curve
)
if
nid
==
0
:
raise_ssl_error
()
else
:
self
.
key
=
EC_KEY_new_by_curve_name
(
nid
)
if
self
.
key
is
NULL
:
raise_ssl_error
()
def
__dealloc__
(
self
):
if
self
.
key
is
not
NULL
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment