Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 293219 Details for
Bug 430597
crashes while creating X509Extension objects
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch which seems to work
pyOpenSSL-asn1item.patch (text/plain), 4.26 KB, created by
Nalin Dahyabhai
on 2008-01-28 22:50:07 UTC
(
hide
)
Description:
patch which seems to work
Filename:
MIME Type:
Creator:
Nalin Dahyabhai
Created:
2008-01-28 22:50:07 UTC
Size:
4.26 KB
patch
obsolete
>diff -up pyOpenSSL-0.6/src/crypto/x509ext.c pyOpenSSL-0.6/src/crypto/x509ext.c >--- pyOpenSSL-0.6/src/crypto/x509ext.c 2008-01-28 17:38:01.000000000 -0500 >+++ pyOpenSSL-0.6/src/crypto/x509ext.c 2008-01-28 17:38:10.000000000 -0500 >@@ -59,7 +59,7 @@ crypto_X509Extension_New(char *type_name > int ext_len, ext_nid; > unsigned char *ext_der, *p; > X509V3_EXT_METHOD *ext_method = NULL; >- ASN1_OCTET_STRING *ext_oct; >+ ASN1_OCTET_STRING *ext_oct = NULL; > STACK_OF(CONF_VALUE) *nval; > void * ext_struct; > X509_EXTENSION *extension = NULL; >@@ -86,48 +86,70 @@ crypto_X509Extension_New(char *type_name > /* Look if it has a function to convert value to an > * internal structure. > */ >- if (!ext_method->v2i) >+ if ((!ext_method->v2i && !ext_method->s2i) || >+ (!ext_method->i2d && !ext_method->it)) > { >- PyErr_SetString(PyExc_ValueError, "Can't initialize exception"); >+ PyErr_SetString(PyExc_ValueError, "Can't initialize extension"); > return NULL; > } > > /* Parse the value */ >- nval = X509V3_parse_list(value); >- if (!nval) >- { >- PyErr_SetString(PyExc_ValueError, "Invalid extension string"); >- return NULL; >- } >- >- /* And use it to get the internal structure */ >- if(!(ext_struct = ext_method->v2i(ext_method, NULL, nval))) { >- exception_from_error_queue(); >- return NULL; >- } >- >- /* Deallocate the configuration value stack */ >- sk_CONF_VALUE_pop_free(nval, X509V3_conf_free); >+ if (ext_method->s2i) >+ { >+ /* Parse the value as a string and get an internal representation */ >+ if(!(ext_struct = ext_method->s2i(ext_method, NULL, value))) { >+ exception_from_error_queue(); >+ return NULL; >+ } >+ } >+ else >+ { >+ /* Parse the value as a list */ >+ nval = X509V3_parse_list(value); >+ if (!nval) >+ { >+ PyErr_SetString(PyExc_ValueError, "Invalid extension string"); >+ return NULL; >+ } >+ /* And use it to get the internal structure */ >+ if(!(ext_struct = ext_method->v2i(ext_method, NULL, nval))) { >+ exception_from_error_queue(); >+ return NULL; >+ } >+ /* Deallocate the configuration value stack */ >+ sk_CONF_VALUE_pop_free(nval, X509V3_conf_free); >+ } > >- /* Find out how much memory we need */ >- ext_len = ext_method->i2d(ext_struct, NULL); >- >- /* Allocate */ >- if(!(ext_der = malloc(ext_len))) { >- PyErr_SetString(PyExc_MemoryError, "Could not allocate memory"); >- return NULL; >- } >- >- /* And create the ASN1_OCTET_STRING */ >- p = ext_der; >- ext_method->i2d(ext_struct, &p); >- if(!(ext_oct = M_ASN1_OCTET_STRING_new())) { >- exception_from_error_queue(); >- return NULL; >- } >- >- ext_oct->data = ext_der; >- ext_oct->length = ext_len; >+ /* Encode the value */ >+ if (ext_method->it) >+ { >+ if (!ASN1_item_pack(ext_struct, ext_method->it, &ext_oct)) { >+ PyErr_SetString(PyExc_ValueError, "Error initializing extension"); >+ return NULL; >+ } >+ } >+ else >+ { >+ /* Find out how much memory we need */ >+ ext_len = ext_method->i2d(ext_struct, NULL); >+ >+ /* Allocate */ >+ if(!(ext_der = malloc(ext_len))) { >+ PyErr_SetString(PyExc_MemoryError, "Could not allocate memory"); >+ return NULL; >+ } >+ >+ /* And create the ASN1_OCTET_STRING */ >+ p = ext_der; >+ ext_method->i2d(ext_struct, &p); >+ if(!(ext_oct = M_ASN1_OCTET_STRING_new())) { >+ exception_from_error_queue(); >+ return NULL; >+ } >+ >+ ext_oct->data = ext_der; >+ ext_oct->length = ext_len; >+ } > > /* Now that we got all ingredients, make the extension */ > extension = X509_EXTENSION_create_by_NID(NULL, ext_nid, critical, ext_oct); >@@ -140,7 +162,15 @@ crypto_X509Extension_New(char *type_name > } > > M_ASN1_OCTET_STRING_free(ext_oct); >- ext_method->ext_free(ext_struct); >+ >+ if (ext_method->it) >+ { >+ ASN1_item_free(ext_struct, ext_method->it); >+ } >+ else >+ { >+ ext_method->ext_free(ext_struct); >+ } > > self->x509_extension = extension; > self->dealloc = 1;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 430597
: 293219 |
293225
|
293226