Re: [openssl-users] ECDSA_SIG_new and ECDSA_SIG_free details

2017-01-11 Thread Stephan Mühlstrasser
Am 03.01.17 um 21:26 schrieb Viktor Dukhovni: On Jan 3, 2017, at 2:55 PM, Ken Goldman wrote: 1 - Is this a bit of a bug? ECDSA_SIG_free() frees the r and s BIGNUMs before is frees the structure itself. However, ECDSA_SIG_new() doesn't set r and s to NULL. It calls

Re: [openssl-users] ECDSA_SIG_new and ECDSA_SIG_free details

2017-01-11 Thread Salz, Rich
> > OpenSSL does not support platforms where the memory representation of > > the NULL pointer contains non-zero bytes. IIRC there are even tests for > this. > > Could someone from the OpenSSL team please explain the rationale for this > decision? What is the problem with using assignments with 0

Re: [openssl-users] ECDSA_SIG_new and ECDSA_SIG_free details

2017-01-11 Thread Viktor Dukhovni
On Wed, Jan 11, 2017 at 05:27:47PM +, Michael Wojcik wrote: > Unfortunately writing proper C is a rare skill - relatively few C > programmers have ever even read the language specification - and much C > code is saddled with lots of ancient technical debt. Also, of course, it > often doesn't

Re: [openssl-users] ECDSA_SIG_new and ECDSA_SIG_free details - NULL vs zeros

2017-01-11 Thread Salz, Rich
> I suspect that it was a shortcut, where they used memset() on an entire > structure, and it hopefully set pointers to NULL. > > What I pointed out is that if NULL is not all zeros, this breaks. And OpenSSL does not work on those platforms. It is part of the test suite to check for this. See

Re: [openssl-users] ECDSA_SIG_new and ECDSA_SIG_free details

2017-01-11 Thread Jeffrey Walton
> Could someone from the OpenSSL team please explain the rationale for this > decision? What is the problem with using assignments with 0 or NULL to > initialize pointers? I'm not from the team, so take it for what its worth... On some systems, NULL is _not_ 0. NULL can be anywhere in memory the

Re: [openssl-users] ECDSA_SIG_new and ECDSA_SIG_free details

2017-01-11 Thread Jakob Bohm
On 11/01/2017 16:32, Stephan Mühlstrasser wrote: Am 03.01.17 um 21:26 schrieb Viktor Dukhovni: On Jan 3, 2017, at 2:55 PM, Ken Goldman wrote: 1 - Is this a bit of a bug? ECDSA_SIG_free() frees the r and s BIGNUMs before is frees the structure itself. However,

Re: [openssl-users] ssl_pending returns 0 despite having data to read

2017-01-11 Thread Michael Wojcik
> From: openssl-users [mailto:openssl-users-boun...@openssl.org] On Behalf > Of Nadia Lapkovskaya > Sent: Wednesday, January 11, 2017 15:08 > > During first ssl_read we received eight bytes, and after that ssl_pending > returns 0. If we continue reading despite having no pending data, ssl_read >

Re: [openssl-users] ssl_pending returns 0 despite having data to read

2017-01-11 Thread Ryan Murray
Situation maybe a security issue Ryan Murray On Jan 11, 2017 4:14 PM, "Ryan Murray" wrote: > Could you give me a hand on a issue I've seem to of picked up with my > device . You and the colleagues if possible. My SamsungGalaxy s2 tablet not > responding. Power button

[openssl-users] ssl_pending returns 0 despite having data to read

2017-01-11 Thread Nadia Lapkovskaya
Hi, We are using openssl-1.0.2j. Noticed, that for http protocol everything is working fine, but when we are using our own binary protocol ssl_pending returns 0 all the time. We are using blocking socket. Tried with SSL_CTX_set_read_ahead set and unset. Out test server sends back any info

Re: [openssl-users] ssl_pending returns 0 despite having data to read

2017-01-11 Thread Ryan Murray
Could you give me a hand on a issue I've seem to of picked up with my device . You and the colleagues if possible. My SamsungGalaxy s2 tablet not responding. Power button and display goes black and does not turn on for a period of time. I believe the programs running in background or in a rooted

Re: [openssl-users] ssl_pending returns 0 despite having data to read

2017-01-11 Thread Salz, Rich
> During first ssl_read we received eight bytes, and after that ssl_pending > returns 0. If we continue reading despite having no pending data, ssl_read > returns the rest of the data. > Could you please suggest what is wrong here. Pending is an indication that there is unread data *on the local

Re: [openssl-users] ECDSA_SIG_new and ECDSA_SIG_free details

2017-01-11 Thread Erwann Abalea
ISO/C 2011, clause 6.3.2.3: An integer constant expression with the value 0, or such an expression cast to type void *, is called a null pointer constant. If a null pointer constant is converted to a pointer type, the resulting pointer, called a null pointer, is guaranteed to compare

Re: [openssl-users] ssl_pending returns 0 despite having data to read

2017-01-11 Thread Matt Caswell
On 11/01/17 20:07, Nadia Lapkovskaya wrote: > Hi, > > We are using openssl-1.0.2j. Noticed, that for http protocol everything is > working fine, but when we are using our own binary protocol ssl_pending > returns 0 all the time. We are using blocking socket. Tried with >

Re: [openssl-users] ECDSA_SIG_new and ECDSA_SIG_free details

2017-01-11 Thread Michael Wojcik
> From: openssl-users [mailto:openssl-users-boun...@openssl.org] On Behalf > Of Jeffrey Walton > Sent: Wednesday, January 11, 2017 11:19 > To: OpenSSL Users > Subject: Re: [openssl-users] ECDSA_SIG_new and ECDSA_SIG_free details > > > Could someone from the OpenSSL team please explain the

Re: [openssl-users] ECDSA_SIG_new and ECDSA_SIG_free details

2017-01-11 Thread Salz, Rich
> The representation in memory of a null pointer need not be all-bits-zero. > (The representation in memory of an integer constant with the value zero > can either be all-bits-zero or, in the unlikely case of sign-magnitude > integers, > a sign bit of 1 followed by all-other-bits-zero.) And,