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
9bc844e7
Commit
9bc844e7
authored
Mar 01, 2006
by
Thomas Wouters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make Py_ssize_t-clean.
parent
f98db65e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
Modules/_hashopenssl.c
Modules/_hashopenssl.c
+13
-8
No files found.
Modules/_hashopenssl.c
View file @
9bc844e7
...
...
@@ -11,6 +11,8 @@
*
*/
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "structmember.h"
...
...
@@ -166,12 +168,13 @@ static PyObject *
EVP_update
(
EVPobject
*
self
,
PyObject
*
args
)
{
unsigned
char
*
cp
;
in
t
len
;
Py_ssize_
t
len
;
if
(
!
PyArg_ParseTuple
(
args
,
"s#:update"
,
&
cp
,
&
len
))
return
NULL
;
EVP_DigestUpdate
(
&
self
->
ctx
,
cp
,
len
);
EVP_DigestUpdate
(
&
self
->
ctx
,
cp
,
Py_SAFE_DOWNCAST
(
len
,
Py_ssize_t
,
unsigned
int
));
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -238,7 +241,7 @@ EVP_tp_init(EVPobject *self, PyObject *args, PyObject *kwds)
PyObject
*
name_obj
=
NULL
;
char
*
nameStr
;
unsigned
char
*
cp
=
NULL
;
unsigned
in
t
len
;
Py_ssize_
t
len
;
const
EVP_MD
*
digest
;
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwds
,
"O|s#:HASH"
,
kwlist
,
...
...
@@ -262,7 +265,8 @@ EVP_tp_init(EVPobject *self, PyObject *args, PyObject *kwds)
Py_INCREF
(
self
->
name
);
if
(
cp
&&
len
)
EVP_DigestUpdate
(
&
self
->
ctx
,
cp
,
len
);
EVP_DigestUpdate
(
&
self
->
ctx
,
cp
,
Py_SAFE_DOWNCAST
(
len
,
Py_ssize_t
,
unsigned
int
));
return
0
;
}
...
...
@@ -375,7 +379,7 @@ EVP_new(PyObject *self, PyObject *args, PyObject *kwdict)
char
*
name
;
const
EVP_MD
*
digest
;
unsigned
char
*
cp
=
NULL
;
unsigned
in
t
len
;
Py_ssize_
t
len
;
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwdict
,
"O|s#:new"
,
kwlist
,
&
name_obj
,
&
cp
,
&
len
))
{
...
...
@@ -389,7 +393,8 @@ EVP_new(PyObject *self, PyObject *args, PyObject *kwdict)
digest
=
EVP_get_digestbyname
(
name
);
return
EVPnew
(
name_obj
,
digest
,
NULL
,
cp
,
len
);
return
EVPnew
(
name_obj
,
digest
,
NULL
,
cp
,
Py_SAFE_DOWNCAST
(
len
,
Py_ssize_t
,
unsigned
int
));
}
/*
...
...
@@ -404,7 +409,7 @@ EVP_new(PyObject *self, PyObject *args, PyObject *kwdict)
EVP_new_ ## NAME (PyObject *self, PyObject *args) \
{ \
unsigned char *cp = NULL; \
unsigned in
t len; \
Py_ssize_
t len; \
\
if (!PyArg_ParseTuple(args, "|s#:" #NAME , &cp, &len)) { \
return NULL; \
...
...
@@ -414,7 +419,7 @@ EVP_new(PyObject *self, PyObject *args, PyObject *kwdict)
CONST_ ## NAME ## _name_obj, \
NULL, \
CONST_new_ ## NAME ## _ctx_p, \
cp,
len
); \
cp,
Py_SAFE_DOWNCAST(len, Py_ssize_t, unsigned int)
); \
}
/* a PyMethodDef structure for the constructor */
...
...
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