Skip Menu |
 
Ticket metadata
The Basics
Id: 1933
Status: resolved
Priority: 0/
Queue: OpenSSL-Bugs

Custom Fields
Milestone: (no value)
Subsystem: (no value)
Severity: (no value)
Broken in: (no value)

People
Owner: Nobody in particular
Requestors: Bernhard Rosenkränzer
Mattias Ellert
Cc:
AdminCc:

More about the requestors
New reminder:
Subject:
Owner:
Due:

Dates
Created: Tue May 19 10:29:54 2009
Starts: Not set
Started: Not set
Last Contact: Sat Aug 09 05:04:32 2014
Due: Not set
Closed: Sat Aug 09 05:04:32 2014
Updated: Sat Aug 09 05:39:17 2014 by Rich Salz



Subject: OpenSSL 1.0.0 betas break C++ support
Date: Tue, 19 May 2009 10:54:48 +0200
To: rt@openssl.org
From: Bernhard Rosenkränzer <br@blankpage.ch>
Download (untitled) / with headers
text/plain 764b
Hi,
OpenSSL 1.0.0 works great for all C applications using OpenSSL I've tried so
far, but the changes break C++ applications rather badly.

e.g. when compiling kdelibs, this happens:

kopenssl.h:500: error: expected `;' before `(' token
kopenssl.h:506: error: `STACK' has not been declared
[...]

This is simple to fix because it's just caused by STACK being renamed to
_STACK, but after modifying the code to typedef _STACK STACK; for
compatibility with OpenSSL 0.9.x, the real problems start:

kssl.cpp:590: error: invalid conversion from `void*' to `STACK*'
kssl.cpp:590: error: initializing argument 1 of `STACK*
KOpenSSLProxy::sk_dup(STACK*)'

Without looking very deeply, my guess is that the new type checking system in
OpenSSL isn't C++ compatible.
Subject: Re: [openssl.org #1933] AutoReply: OpenSSL 1.0.0 betas break C++ support
Date: Tue, 19 May 2009 14:08:06 +0200
To: rt@openssl.org
From: Bernhard Rosenkränzer <br@blankpage.ch>
Download (untitled) / with headers
text/plain 1.6k
On a second look, KSSL is doing some fairly odd things...

http://bugs.kde.org/show_bug.cgi?id=193215

It would still be nice to restore source level compatibility though

On Tuesday 19 May 2009 10.29:55 The default queue via RT wrote:
Show quoted text
> Greetings,
>
> This message has been automatically generated in response to the
> creation of a trouble ticket regarding:
> "OpenSSL 1.0.0 betas break C++ support",
> a summary of which appears below.
>
> There is no need to reply to this message right now. Your ticket has been
> assigned an ID of [openssl.org #1933].
>
> Please include the string:
>
> [openssl.org #1933]
>
> in the subject line of all future correspondence about this issue. To do
> so, you may reply to this message.
>
> Thank you,
> rt@openssl.org
>
> -------------------------------------------------------------------------
> Hi,
> OpenSSL 1.0.0 works great for all C applications using OpenSSL I've tried
> so far, but the changes break C++ applications rather badly.
>
> e.g. when compiling kdelibs, this happens:
>
> kopenssl.h:500: error: expected `;' before `(' token
> kopenssl.h:506: error: `STACK' has not been declared
> [...]
>
> This is simple to fix because it's just caused by STACK being renamed to
> _STACK, but after modifying the code to typedef _STACK STACK; for
> compatibility with OpenSSL 0.9.x, the real problems start:
>
> kssl.cpp:590: error: invalid conversion from `void*' to `STACK*'
> kssl.cpp:590: error: initializing argument 1 of `STACK*
> KOpenSSLProxy::sk_dup(STACK*)'
>
> Without looking very deeply, my guess is that the new type checking system
> in OpenSSL isn't C++ compatible.
Download (untitled) / with headers
text/plain 1017b
Show quoted text
> [br@blankpage.ch - Tue May 19 10:29:54 2009]:
>
> Hi,
> OpenSSL 1.0.0 works great for all C applications using OpenSSL I've
> tried so
> far, but the changes break C++ applications rather badly.
>
> e.g. when compiling kdelibs, this happens:
>
> kopenssl.h:500: error: expected `;' before `(' token
> kopenssl.h:506: error: `STACK' has not been declared
> [...]
>
> This is simple to fix because it's just caused by STACK being renamed
> to
> _STACK, but after modifying the code to typedef _STACK STACK; for
> compatibility with OpenSSL 0.9.x, the real problems start:
>
> kssl.cpp:590: error: invalid conversion from `void*' to `STACK*'
> kssl.cpp:590: error: initializing argument 1 of `STACK*
> KOpenSSLProxy::sk_dup(STACK*)'
>
> Without looking very deeply, my guess is that the new type checking
> system in
> OpenSSL isn't C++ compatible.
>
>

Try a more recent snapshot. STACK is still renamed _STACK so
applications will use the correct STACK type but many of the C++ issues
should be resolved.
Subject: Buggy openssl header causes compilation errors
Date: Thu, 03 Dec 2009 12:23:04 +0100
To: rt@openssl.org
From: Mattias Ellert <mattias.ellert@fysast.uu.se>
Download (untitled) / with headers
text/plain 2.3k
Created from downstream bug report:

https://bugzilla.redhat.com/show_bug.cgi?id=543634


Description of problem:

The openssl/asn1.h header file is buggy. For a C program this causes compiler
warnings. For a C++ program this causes compiler errors, because C++ is a
strongly typed language.

Version-Release number of selected component (if applicable):

openssl-devel-1.0.0-0.13.beta4.fc12.x86_64

How reproducible:

Always.

Steps to Reproduce:

1. Compile the attatched test program:

https://bugzilla.redhat.com/attachment.cgi?id=375537

Actual results:

2. With gcc it compiles but gives warnings:

[ellert@localhost ~]$ LANG=C gcc -o test test.c -lssl
test.c: In function 'main':
test.c:12: warning: passing argument 1 of 'i2d_ASN1_SET' from incompatible
pointer type
/usr/include/openssl/asn1.h:894: note: expected 'struct stack_st_OPENSSL_BLOCK
*' but argument is of type 'struct _STACK *'
test.c:14: warning: passing argument 1 of 'i2d_ASN1_SET' from incompatible
pointer type
/usr/include/openssl/asn1.h:894: note: expected 'struct stack_st_OPENSSL_BLOCK
*' but argument is of type 'struct _STACK *'

3. With g++ it fails to compile, because the type mismatches are considered
errors:

[ellert@localhost ~]$ LANG=C g++ -o test test.c -lssl
test.c: In function 'int main()':
test.c:12: error: cannot convert '_STACK*' to 'stack_st_OPENSSL_BLOCK*' for
argument '1' to 'int i2d_ASN1_SET(stack_st_OPENSSL_BLOCK*, unsigned char**, int
(*)(void*, unsigned char**), int, int, int)'
test.c:14: error: cannot convert '_STACK*' to 'stack_st_OPENSSL_BLOCK*' for
argument '1' to 'int i2d_ASN1_SET(stack_st_OPENSSL_BLOCK*, unsigned char**, int
(*)(void*, unsigned char**), int, int, int)'

Expected results:

No warnings in C, working compilation in C++.

Additional info:

There are 4 macros in openssl/asn1.h which are defined using
STACK_OF(OPENSSL_BLOCK). However, by the time theses macros are being resolved
all the arguments have been put through the CHECKED_xxx macros and been
anonymized and are simply _STACK pointers. The 4 macros are:

i2d_ASN1_SET, d2i_ASN1_SET, ASN1_seq_unpack, and ASN1_seq_pack.



This is a rather clumsy workaround for the bug:

https://bugzilla.redhat.com/attachment.cgi?id=375568

This compiles without warnings/error for C and C++:

[ellert@localhost ~]$ gcc -o test test-wo.c -lssl
[ellert@localhost ~]$ g++ -o test test-wo.c -lssl
[ellert@localhost ~]$
yup, c++ works w/openssl.
-- 
Rich Salz, OpenSSL dev team; rsalz@openssl.org