Bug 543634 - Buggy openssl header caused compilation errors
Summary: Buggy openssl header caused compilation errors
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: openssl
Version: 12
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Tomas Mraz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-12-02 18:50 UTC by Mattias Ellert
Modified: 2010-05-25 18:41 UTC (History)
1 user (show)

Fixed In Version: openssl-1.0.0-4.fc12
Clone Of:
Environment:
Last Closed: 2010-05-25 18:41:56 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Simple test program that illustrates the issue. (387 bytes, text/x-csrc)
2009-12-02 18:50 UTC, Mattias Ellert
no flags Details
Workaround fro the bug (1.28 KB, text/x-csrc)
2009-12-02 19:36 UTC, Mattias Ellert
no flags Details

Description Mattias Ellert 2009-12-02 18:50:42 UTC
Created attachment 375537 [details]
Simple test program that illustrates the issue.

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.

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.

Comment 1 Mattias Ellert 2009-12-02 19:36:37 UTC
Created attachment 375568 [details]
Workaround fro the bug

This is a rather clumsy workaround for the bug.

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 ~]$

Comment 2 Tomas Mraz 2009-12-02 19:47:16 UTC
Can you please report that upstream to the openssl RT by sending e-mail with the bug report to rt? Thank you.

Comment 3 Mattias Ellert 2009-12-03 18:17:52 UTC
I have tried to send a mail to rt. It doesn't work. My report didn't make it into the RT tracker. And I didn't get any reply at all from the server - not even a reject message. I have tried it twice with 5 hours between the attempts. Is there a know problem with the server?

Comment 4 Tomas Mraz 2009-12-03 20:36:14 UTC
The RT queue is moderated so the report will make it to the RT tracker as soon as the moderator comes to look at the queue.

Thanks for your effort.

Comment 5 Tomas Mraz 2009-12-03 20:52:47 UTC
Here it is: http://rt.openssl.org/index.html?q=2123

Comment 6 Fedora Update System 2010-05-18 16:46:01 UTC
openssl-1.0.0-4.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/openssl-1.0.0-4.fc12

Comment 7 Fedora Update System 2010-05-19 19:09:55 UTC
openssl-1.0.0-4.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update openssl'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/openssl-1.0.0-4.fc12

Comment 8 Fedora Update System 2010-05-25 18:40:52 UTC
openssl-1.0.0-4.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.