Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 787314

Summary: net-misc/ptpd-2.3.1-r2 - /.../ossl_typ.h: error: conflicting types for EVP_MD_CTX; have struct evp_md_ctx_st
Product: Gentoo Linux Reporter: Toralf Förster <toralf>
Component: Current packagesAssignee: Jan Breuer <honza.breuer>
Status: CONFIRMED ---    
Severity: normal CC: l_indien, proxy-maint
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 797325    
Attachments: emerge-info.txt
emerge-history.txt
environment
etc.portage.tar.bz2
logs.tar.bz2
net-misc:ptpd-2.3.1-r2:20210501-055617.log
temp.tar.bz2
Patch to properly use recent openssl API

Description Toralf Förster gentoo-dev 2021-05-01 09:00:47 UTC
                 from /usr/include/net-snmp/net-snmp-includes.h:35,
                 from dep/net.c:73:
/usr/include/openssl/ossl_typ.h:92:30: error: conflicting types for ‘EVP_MD_CTX’; have ‘struct evp_md_ctx_st’
   92 | typedef struct evp_md_ctx_st EVP_MD_CTX;
      |                              ^~~~~~~~~~
In file included from dep/../ptpd.h:153,
                 from dep/net.c:57:

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_desktop_plasma-20210420-165442

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-7.3.1
 [2] x86_64-pc-linux-gnu-11.1.0 *
clang version 12.0.0
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/12/bin
/usr/lib/llvm/12
12.0.0
Python 3.8.9
Available Ruby profiles:
  [1]   ruby26 (with Rubygems)
  [2]   ruby30 (with Rubygems) *
Available Rust versions:
  [1]   rust-bin-1.51.0
  [2]   rust-1.51.0 *
The Glorious Glasgow Haskell Compilation System, version 8.10.4
  [1]   php7.4
  [2]   php8.0 *

  timestamp(s) of HEAD at this tinderbox image:
/var/db/repos/gentoo	Sat May  1 05:35:31 UTC 2021

emerge -qpvO net-misc/ptpd
[ebuild  N    ] net-misc/ptpd-2.3.1-r2  USE="pcap snmp statistics -debug -experimental -ntp -slave-only"
Comment 1 Toralf Förster gentoo-dev 2021-05-01 09:00:48 UTC
Created attachment 704898 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2021-05-01 09:00:50 UTC
Created attachment 704901 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2021-05-01 09:00:51 UTC
Created attachment 704904 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2021-05-01 09:00:53 UTC
Created attachment 704907 [details]
etc.portage.tar.bz2
Comment 5 Toralf Förster gentoo-dev 2021-05-01 09:00:54 UTC
Created attachment 704910 [details]
logs.tar.bz2
Comment 6 Toralf Förster gentoo-dev 2021-05-01 09:00:55 UTC
Created attachment 704913 [details]
net-misc:ptpd-2.3.1-r2:20210501-055617.log
Comment 7 Toralf Förster gentoo-dev 2021-05-01 09:00:56 UTC
Created attachment 704916 [details]
temp.tar.bz2
Comment 8 Toralf Förster gentoo-dev 2022-05-14 08:15:47 UTC
*** Bug 844166 has been marked as a duplicate of this bug. ***
Comment 9 Jocelyn Mayer 2022-10-17 06:18:46 UTC
The following patch seems to fix this issue:

--- ptpd-ptpd-2.3.1/src/dep/ntpengine/ntp_isc_md5.c     2015-06-29 17:13:29.000000000 +0200
+++ ptpd-ptpd-2.3.1/src/dep/ntpengine/ntp_isc_md5.c     2021-10-25 19:02:24.014329912 +0200
@@ -262,7 +262,7 @@ MD5authencrypt(
 {
        u_char  digest[64];
        u_int   len;
-       EVP_MD_CTX ctx;
+       _EVP_MD_CTX ctx;
         pkt[length / 4] = htonl(keyid); 
        EVP_DigestInit(&ctx);
        EVP_DigestUpdate(&ctx, (u_char *)key, (u_int)strlen(key));
--- ptpd-ptpd-2.3.1/src/dep/ntpengine/ntp_isc_md5.h     2015-06-29 17:13:29.000000000 +0200
+++ ptpd-ptpd-2.3.1/src/dep/ntpengine/ntp_isc_md5.h     2021-10-25 19:02:42.974909067 +0200
@@ -80,7 +80,7 @@ isc_md5_final(isc_md5_t *ctx, unsigned c
 # define MD5Init(c)             isc_md5_init(c)
 # define MD5Update(c, p, s)     isc_md5_update(c, p, s)
 # define MD5Final(d, c)         isc_md5_final((c), (d)) /* swapped */
-  typedef MD5_CTX                       EVP_MD_CTX;
+  typedef MD5_CTX                       _EVP_MD_CTX;
 # define EVP_DigestInit(c)              MD5Init(c)
 # define EVP_DigestUpdate(c, p, s)      MD5Update(c, p, s)
 # define EVP_DigestFinal(c, d, pdl)     \
Comment 10 Jocelyn Mayer 2022-12-17 22:41:51 UTC
Created attachment 843279 [details, diff]
Patch to properly use recent openssl API

Here's an updated patch introducing changes for proper use of recent openssl API
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-12-18 01:39:15 UTC
(In reply to Jocelyn Mayer from comment #10)
> Created attachment 843279 [details, diff] [details, diff]
> Patch to properly use recent openssl API
> 
> Here's an updated patch introducing changes for proper use of recent openssl
> API

Thanks. Could you send it upstream at https://github.com/ptpd/ptpd/pulls?
Comment 12 Jocelyn Mayer 2022-12-18 08:24:02 UTC
Should have checked upstream before posting...
Already fixed in trunk, they did choose the first way, ie renaming the EVP_MD_CTX type, in order to be able to use libressl as well, as far as I've understood.
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-16 14:20:45 UTC
I can't actually reproduce this error, but I suppose we could take a snapshot or something.
Comment 14 Toralf Förster gentoo-dev 2023-10-11 06:59:51 UTC
(In reply to Sam James from comment #13)
> I can't actually reproduce this error, but I suppose we could take a
> snapshot or something.

reproduced today at 17.1_desktop_gnome_systemd-20231009-071016