X509_NAME_ENTRY_create_by_txt type signature fix

Pavel Shramov <[email protected]>
Newsgroups gmane.comp.python.cryptography
Message-ID <[email protected]>
X509_NAME_ENTRY_create_by_txt as other OpenSSL functions take 'bytes'
parameter of type 'unsigned char *' Python string is represented in
SWIG as 'char *'. Some functions that are used in Python code are exported 
with 'char * bytes'. For example code from SWIG/_x509.i

412 /* x509_name_add_entry_by_txt */
413 int x509_name_add_entry_by_txt(X509_NAME *name, char *field, int type, char *bytes, int len, int loc, int set) {
414     return X509_NAME_add_entry_by_txt(name, field, type, bytes, len, loc, set);
415 }

Attached patch fixes type signature of x509_name_entry_create_by_txt
function.
                                Pavel
name_entry_create.patch (text/x-diff, 825 B)
Type of bytes parameter in x509_name_entry_create_by_txt
functions changed from 'unsinged char *' to 'char *'
as in x509_name_add_entry_by_txt
---
 SWIG/_x509.i |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/SWIG/_x509.i b/SWIG/_x509.i
index a093bc1..7076416 100644
--- a/SWIG/_x509.i
+++ b/SWIG/_x509.i
@@ -468,7 +468,7 @@ int x509_req_add_extensions(X509_REQ *req, STACK *exts) {
     return X509_REQ_add_extensions(req, (STACK_OF(X509_EXTENSION) *)exts);
 }
 
-X509_NAME_ENTRY *x509_name_entry_create_by_txt( X509_NAME_ENTRY **ne, char *field, int type, unsigned char *bytes, int len) {
+X509_NAME_ENTRY *x509_name_entry_create_by_txt( X509_NAME_ENTRY **ne, char *field, int type, char *bytes, int len) {
     return X509_NAME_ENTRY_create_by_txt( ne, field, type, bytes, len);
 }
 
-- 
1.5.2.3
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.