stackless python 2.7.9 and openssl-1.1.1g

2020-09-24 Thread bhashkar prakash Singh
Hi,

I am using stackless Python 2.7.9 in my project and openssl-1.0.2q.
I just upgraded the Openssl  version to 1.1.1g, due to which python
compilation started failing. So, I patched  _hashopenssl.c and _ssl.c file
in Python Modules as per new openssl  to make compilation successful.
But when I run my image on  target HW,  I am getting below errors.  It
looks like Openssl 1.1.1g libraries are not linked to Python.
 I am struggling with this issue since many days. Looks like something I
missed in my patching. Could someone please help on this.

ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/usr/lib/python2.7/hashlib.py", line 147, in 
globals()[__func_name] = __get_hash(__func_name)
  File "/usr/lib/python2.7/hashlib.py", line 109, in
__get_openssl_constructor
return __get_builtin_constructor(name)
  File "/usr/lib/python2.7/hashlib.py", line 97, in
__get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
  File "/usr/lib/python2.7/hashlib.py", line 147, in 
globals()[__func_name] = __get_hash(__func_name)
  File "/usr/lib/python2.7/hashlib.py", line 109, in
__get_openssl_constructor
return __get_builtin_constructor(name)
  File "/usr/lib/python2.7/hashlib.py", line 97, in
__get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
  File "/usr/lib/python2.7/hashlib.py", line 147, in 
globals()[__func_name] = __get_hash(__func_name)
  File "/usr/lib/python2.7/hashlib.py", line 109, in
__get_openssl_constructor
return __get_builtin_constructor(name)
  File "/usr/lib/python2.7/hashlib.py", line 97, in
__get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
  File "/usr/lib/python2.7/hashlib.py", line 147, in 
globals()[__func_name] = __get_hash(__func_name)
  File "/usr/lib/python2.7/hashlib.py", line 109, in
__get_openssl_constructor
return __get_builtin_constructor(name)
  File "/usr/lib/python2.7/hashlib.py", line 97, in
__get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
  File "/usr/lib/python2.7/hashlib.py", line 147, in 
globals()[__func_name] = __get_hash(__func_name)
  File "/usr/lib/python2.7/hashlib.py", line 109, in
__get_openssl_constructor
return __get_builtin_constructor(name)
  File "/usr/lib/python2.7/hashlib.py", line 97, in
__get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
  File "/usr/lib/python2.7/hashlib.py", line 147, in 
globals()[__func_name] = __get_hash(__func_name)
  File "/usr/lib/python2.7/hashlib.py", line 109, in
__get_openssl_constructor
return __get_builtin_constructor(name)
  File "/usr/lib/python2.7/hashlib.py", line 97, in
__get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha512

Thanks & Regards,
Bhashkar
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: stackless python 2.7.9 and openssl-1.1.1g

2020-09-24 Thread bhashkar prakash Singh
Hi Barry,

Thanks for your response.

I am not an expert in python code. Could you please elaborate a bit more on
this.  Which cpython code are you referring to?
did you modify other files also apart from   _hashopenssl.c and _ssl.c to
work with openssl-1.1.1g ?

Regards,
Bhashkar

On Fri, Sep 25, 2020 at 2:40 AM Barry Scott  wrote:

>
>
> > On 24 Sep 2020, at 19:21, bhashkar prakash Singh <
> singh.bhash...@gmail.com> wrote:
> >
> > Hi,
> >
> > I am using stackless Python 2.7.9 in my project and openssl-1.0.2q.
> > I just upgraded the Openssl  version to 1.1.1g, due to which python
> > compilation started failing. So, I patched  _hashopenssl.c and _ssl.c
> file
> > in Python Modules as per new openssl  to make compilation successful.
> > But when I run my image on  target HW,  I am getting below errors.  It
> > looks like Openssl 1.1.1g libraries are not linked to Python.
> > I am struggling with this issue since many days. Looks like something I
> > missed in my patching. Could someone please help on this.
>
> I recently built python 2.7.18 against openssl 1.1.1g without issue.
> Maybe look see what is in the cpython code that works fine.
>
> Barry
> > Thanks & Regards,
> > Bhashkar
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> >
>
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: stackless python 2.7.9 and openssl-1.1.1g

2020-09-29 Thread bhashkar prakash Singh
>Get the source of python.org python 2.7.18 and you will find that builds
without patches >against OpenSSL 1.1.1g.
>I would then diff the C files that do not compile in stackless to look for
the required fixes.

Thanks Barry. Some warnings were left in code after patching cpython files.
After fixing them, all those errors are gone.

Now I have another issue. now the threading module in python is not found.
I don't see this is anyway related to openssl upgrade but this issue is not
occurred where openssl has not been upgraded.

 File "/usr/lib/python2.7/site-packages/websocket/__init__.py", line 22, in

from ._abnf import *
  File "/usr/lib/python2.7/site-packages/websocket/_abnf.py", line 30, in

from threading import Lock
  File "threading.py", line 6, in 
import thread
ImportError: No module named thread

Could you give any clue on this ?

Thanks & Regards,
Bhashkar

On Fri, Sep 25, 2020 at 12:43 PM Barry  wrote:

>
>
> On 25 Sep 2020, at 03:28, bhashkar prakash Singh 
> wrote:
>
> 
> Hi Barry,
>
> Thanks for your response.
>
> I am not an expert in python code. Could you please elaborate a bit more
> on this.  Which cpython code are you referring to?
> did you modify other files also apart from   _hashopenssl.c and _ssl.c to
> work with openssl-1.1.1g ?
>
>
> Get the source of python.org python 2.7.18 and you will find that builds
> without patches against OpenSSL 1.1.1g.
>
> I would then diff the C files that do not compile in stackless to look for
> the required fixes.
>
> Barry
>
>
> Regards,
> Bhashkar
>
> On Fri, Sep 25, 2020 at 2:40 AM Barry Scott 
> wrote:
>
>>
>>
>> > On 24 Sep 2020, at 19:21, bhashkar prakash Singh <
>> singh.bhash...@gmail.com> wrote:
>> >
>> > Hi,
>> >
>> > I am using stackless Python 2.7.9 in my project and openssl-1.0.2q.
>> > I just upgraded the Openssl  version to 1.1.1g, due to which python
>> > compilation started failing. So, I patched  _hashopenssl.c and _ssl.c
>> file
>> > in Python Modules as per new openssl  to make compilation successful.
>> > But when I run my image on  target HW,  I am getting below errors.  It
>> > looks like Openssl 1.1.1g libraries are not linked to Python.
>> > I am struggling with this issue since many days. Looks like something I
>> > missed in my patching. Could someone please help on this.
>>
>> I recently built python 2.7.18 against openssl 1.1.1g without issue.
>> Maybe look see what is in the cpython code that works fine.
>>
>> Barry
>> > Thanks & Regards,
>> > Bhashkar
>> > --
>> > https://mail.python.org/mailman/listinfo/python-list
>> >
>>
>>
-- 
https://mail.python.org/mailman/listinfo/python-list