Project

General

Profile

Feature #630

port to libgcrypt20

Added by Yves-Alexis Perez about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
libstrongswan
Target version:
Start date:
29.06.2014
Due date:
Estimated time:
Resolution:
Fixed

Description

Hi,

it seems that the gcrypt plugin needs some porting to libgcrypt20. Apparently the gcry_thread_cbs structure changed:

http://sources.debian.net/src/libgcrypt11/1.5.3-4/src/gcrypt.h.in?hl=204#L204
http://sources.debian.net/src/libgcrypt20/1.6.1-2/src/gcrypt.h.in?hl=213#L213

Associated revisions

Revision bad9c894 (diff)
Added by Martin Willi about 6 years ago

gcrypt: Use predefined pthread locking functions instead of custom hooks

Starting with libgcrypt 1.6, it seems that custom locking functions are not
supported anymore. Instead, the user has to select from one of the pre-defined
set of locking functions.

Given that we have a proper threading abstraction API with optional profiling
on all platforms, this is somewhat annoying. However, there does not seem to be
a way to use custom functions, and we have no other choice than using the
provided macro magic to support all libgcrypt versions.

Fixes #630.

Revision 6fb12832 (diff)
Added by Martin Willi about 6 years ago

gcrypt: Use predefined pthread locking functions instead of custom hooks

Starting with libgcrypt 1.6, it seems that custom locking functions are not
supported anymore. Instead, the user has to select from one of the pre-defined
set of locking functions.

Given that we have a proper threading abstraction API with optional profiling
on all platforms, this is somewhat annoying. However, there does not seem to be
a way to use custom functions, and we have no other choice than using the
provided macro magic to support all libgcrypt versions.

Fixes #630.

History

#1 Updated by Yves-Alexis Perez about 6 years ago

It also seems that gcry_thread_cbs is deprecated and that native thread implementation should be use. But I couldnt really find a porting guide.

#2 Updated by Martin Willi about 6 years ago

  • Category set to libstrongswan
  • Status changed from New to Feedback
  • Assignee set to Martin Willi
  • Priority changed from Normal to High

Yves-Alexis,

It also seems that gcry_thread_cbs is deprecated and that native thread implementation should be use. But I couldnt really find a porting guide.

Some more information can be found here.

In fact it seems that custom threading functions are gone. So I see currently no other way than to go for the provided pthread functions to support all library versions, even if it brings us a hard dependency on pthread in gcrypt :-/.

Please try the attached patch; I'll merge it for 5.2.0 if that works for you. I could test it against 1.5.x only.

Regards
Martin

#3 Updated by Yves-Alexis Perez about 6 years ago

Thanks, I'll try the patch, although right now I'm a bit unsure how to do it.

I have the feeling our current Debian builds are broken (since gcry_thread_cbs structure is wrongly initialized), but the build checks didn't seem to reveal it.

I don't use the gcrypt plugin personally, so I'd need to setup a test bench or something.

#4 Updated by Martin Willi about 6 years ago

  • Tracker changed from Issue to Feature
  • Status changed from Feedback to Closed
  • Resolution set to Fixed

I have the feeling our current Debian builds are broken (since gcry_thread_cbs structure is wrongly initialized), but the build checks didn't seem to reveal it.

At least the testing packages seems to build-depend on libgcrypt20-dev, so it actually should fail. Not sure what is wrong here.

Anyway, I've successfully built and tested against libgcrypt11-dev and libgcrypt20-dev. So I'll merge the commit, closing the issue for now.

Regards
Martin

#5 Updated by Martin Willi about 6 years ago

  • Target version set to 5.2.0

Also available in: Atom PDF