Bug 839475

Summary: srtp-devel missed file /usr/include/srtp/config.h
Product: [openSUSE] openSUSE 12.3 Reporter: Vladimir Anufriev <avn>
Component: DevelopmentAssignee: Stanislav Brabec <sbrabec>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: meissner
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE 12.3   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Vladimir Anufriev 2013-09-10 16:45:36 UTC
User-Agent:       Mozilla/5.0 (Windows NT 5.1; rv:23.0) Gecko/20100101 Firefox/23.0

RPM package srtp-devel has missed file /usr/include/srtp/config.h, which is included in /usr/include/srtp/integers.h line 50

Reproducible: Always

Steps to Reproduce:
1. Try to compile a C program with /usr/include/srtp/integers.h included
Actual Results:  
Can't open "config.h"

Expected Results:  
Compiled successfully

This is required for building Asterisk PBX.
You need to add srtp/crypto/include/config.h in spec file for rpmbuild
Comment 1 Stanislav Brabec 2013-09-18 15:10:56 UTC
They attempt to include autoconf style config.h. It is bad, as it is not intended to be a public include (it causes symbol conflicts).

There is a new development of srtp in Cisco repositories:
https://github.com/cisco/libsrtp

It contains security fix (bug 828009). I'll check whether it fixes also this bug and whether it makes sense to switch for openSUSE 13.1.
Comment 2 Stanislav Brabec 2013-09-18 18:40:28 UTC
New upstream does not address this issue.

Debian does not address this issue.

Fedora addresses this issue, but in a bit hacky way - rename config.h to config-32/64.h and create a new dedicated file.

This does not change anything on the fact, that include file named config.h (even worse, "config.h" with quotes, i. e. prefer build-time local file) is a bad idea.
Comment 3 Stanislav Brabec 2013-09-18 20:11:51 UTC
I have upgraded to Cisco repository (which is not a branch but a regular development migration from CVS to GIT)

Then I have created a fix, that installs config.h and rewrites all potentially colliding symbols and include file references to a safe form.

Project:
https://build.opensuse.org/package/show/home:sbrabec:branches:network:telephony/libsrtp

Packages:
http://download.opensuse.org/repositories/home:/sbrabec:/branches:/network:/telephony/

Could you test whether you can compile asterisk with it? (Or send me a link to Build Service project.)
Comment 4 Stanislav Brabec 2013-09-19 14:19:29 UTC
Vladimir Anufriev wrote:

configure:27417: checking for srtp_init in -lsrtp 
configure:27442: gcc -o conftest -g -O2    conftest.c -lsrtp   -lm  >&5 
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../lib64/libsrtp.so: undefined reference to `ekt_alloc' 
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../lib64/libsrtp.so: undefined reference to `ekt_octets_after_base_tag' 
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../lib64/libsrtp.so: undefined reference to `ekt_stream_init_from_policy' 
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../lib64/libsrtp.so: undefined reference to `ekt_write_data' 
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../lib64/libsrtp.so: undefined reference to `srtp_stream_init_from_ekt' 
collect2: error: ld returned 1 exit status 

It is my fault. The libsrtp-automake.patch needs deeper changes to incorporate the new source files.
Comment 5 Stanislav Brabec 2013-09-26 17:48:45 UTC
I just finished fixing of headers to be able to compile asterisk-1.8.23.1.

Not only that srtp/config.h was incorrect, but also /usr/share/openh323/openh323u.mak from openh323-devel-1.19.0.1 was broken, and pointed to the build directories instead of install directories.

Now I can compile asterisk configured by ./configure --with-srtp without any change.

Please test, whether it compiles and works in a real world use. Thanks.

Note: You may need to install also openh323-debugsource. Asterisk refers to source files, and is is the easiest way to provide source files.
Comment 6 Stanislav Brabec 2013-10-03 16:48:07 UTC
From the e-mail:

Now it is compiled ok. Functionality I'll check later because of it needs more work. 
I think that your packages may be included in factory line of OpenSuse and updates for 12.3.
Comment 7 Stanislav Brabec 2013-10-03 17:53:55 UTC
Created maintenance requests:
obs maintenance request id 202073 for openh323 (12.2, 12.3)
obs maintenance request id 202074 for srtp (12.3; just the header fix and nothing else)

Submitted to network:telephony and waiting for review and re-sending to Factory:
openh323: obs request id 202064
libsrtp:  obs request id 202067 (upgrade, fix and all above mentioned changes)
srtp: osc drop request id 202068 (rename is not implemented in OBS, drop and create new project with a different name)
Comment 8 Marcus Meissner 2013-10-08 09:05:46 UTC
this debugsource dependency is very ugly.

what files does it need from there, and why are they not in -devel?
Comment 9 Stanislav Brabec 2013-10-08 12:59:25 UTC
Yes, it is ugly. That is why I added it only as a Suggests, the weakest dependency possible.

The problem is in the /usr/share/openh323/openh323u.mak, which contains variable OH323_SRCDIR. And OH323_SRCDIR is used in the LIBRARY_MAKEFILE rule below.

If the OH323_SRCDIR is set to non-existing directory, then for example compilation of asterisk fails.

openh323-debuginfo provides files that make asterisk build process happy.

Maybe it could be solved by a detailed analysis of the exact purpose of the OH323_SRCDIR and then rewriting of openh323u.mak and/or providing needed source files in the devel package.
Comment 10 Bernhard Wiedemann 2013-10-11 08:00:14 UTC
This is an autogenerated message for OBS integration:
This bug (839475) was mentioned in
https://build.opensuse.org/request/show/202932 Factory / openh323
Comment 11 Swamp Workflow Management 2013-10-28 12:04:25 UTC
openSUSE-RU-2013:1581-1: An update that has one recommended fix can now be installed.

Category: recommended (low)
Bug References: 839475
CVE References: 
Sources used:
openSUSE 12.3 (src):    srtp-1.4.4-2.8.1
Comment 12 Swamp Workflow Management 2013-10-28 12:05:29 UTC
openSUSE-RU-2013:1585-1: An update that has one recommended fix can now be installed.

Category: recommended (low)
Bug References: 839475
CVE References: 
Sources used:
openSUSE 12.3 (src):    openh323-1.19.0.1-252.4.1
openSUSE 12.2 (src):    openh323-1.19.0.1-249.4.1