Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c8f55400
Commit
c8f55400
authored
Mar 18, 2010
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revert part of r77938 which broke hashlib constructors #8167
parent
903fc516
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
13 deletions
+1
-13
Modules/_hashopenssl.c
Modules/_hashopenssl.c
+1
-13
No files found.
Modules/_hashopenssl.c
View file @
c8f55400
...
...
@@ -49,10 +49,6 @@
#define HASH_OBJ_CONSTRUCTOR 0
#endif
/* Minimum OpenSSL version needed to support sha224 and higher. */
#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x00908000)
#define _OPENSSL_SUPPORTS_SHA2
#endif
typedef
struct
{
PyObject_HEAD
...
...
@@ -74,12 +70,10 @@ static PyTypeObject EVPtype;
DEFINE_CONSTS_FOR_NEW
(
md5
)
DEFINE_CONSTS_FOR_NEW
(
sha1
)
#ifdef _OPENSSL_SUPPORTS_SHA2
DEFINE_CONSTS_FOR_NEW
(
sha224
)
DEFINE_CONSTS_FOR_NEW
(
sha256
)
DEFINE_CONSTS_FOR_NEW
(
sha384
)
DEFINE_CONSTS_FOR_NEW
(
sha512
)
#endif
static
EVPobject
*
...
...
@@ -543,12 +537,10 @@ EVP_new(PyObject *self, PyObject *args, PyObject *kwdict)
GEN_CONSTRUCTOR
(
md5
)
GEN_CONSTRUCTOR
(
sha1
)
#ifdef _OPENSSL_SUPPORTS_SHA2
GEN_CONSTRUCTOR
(
sha224
)
GEN_CONSTRUCTOR
(
sha256
)
GEN_CONSTRUCTOR
(
sha384
)
GEN_CONSTRUCTOR
(
sha512
)
#endif
/* List of functions exported by this module */
...
...
@@ -556,13 +548,11 @@ static struct PyMethodDef EVP_functions[] = {
{
"new"
,
(
PyCFunction
)
EVP_new
,
METH_VARARGS
|
METH_KEYWORDS
,
EVP_new__doc__
},
CONSTRUCTOR_METH_DEF
(
md5
),
CONSTRUCTOR_METH_DEF
(
sha1
),
#ifdef _OPENSSL_SUPPORTS_SHA2
CONSTRUCTOR_METH_DEF
(
sha224
),
CONSTRUCTOR_METH_DEF
(
sha256
),
CONSTRUCTOR_METH_DEF
(
sha384
),
CONSTRUCTOR_METH_DEF
(
sha512
),
#endif
{
NULL
,
NULL
}
/* Sentinel */
{
NULL
,
NULL
}
/* Sentinel */
};
...
...
@@ -609,11 +599,9 @@ PyInit__hashlib(void)
/* these constants are used by the convenience constructors */
INIT_CONSTRUCTOR_CONSTANTS
(
md5
);
INIT_CONSTRUCTOR_CONSTANTS
(
sha1
);
#ifdef _OPENSSL_SUPPORTS_SHA2
INIT_CONSTRUCTOR_CONSTANTS
(
sha224
);
INIT_CONSTRUCTOR_CONSTANTS
(
sha256
);
INIT_CONSTRUCTOR_CONSTANTS
(
sha384
);
INIT_CONSTRUCTOR_CONSTANTS
(
sha512
);
#endif
return
m
;
}
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