[Git][haskell-team/DHG_packages][master] hsopenssl: Fix OpenSSL 4.0 compatibility

Scott Talbert (@swt2c) gitlab at salsa.debian.org
Tue Jun 30 16:03:52 BST 2026



Scott Talbert pushed to branch master at Debian Haskell Group / DHG_packages


Commits:
9c7df859 by Scott Talbert at 2026-06-30T10:56:20-04:00
hsopenssl: Fix OpenSSL 4.0 compatibility

- - - - -


3 changed files:

- p/haskell-hsopenssl/debian/changelog
- + p/haskell-hsopenssl/debian/patches/openssl-4.0-compat.patch
- p/haskell-hsopenssl/debian/patches/series


Changes:

=====================================
p/haskell-hsopenssl/debian/changelog
=====================================
@@ -1,3 +1,9 @@
+haskell-hsopenssl (0.11.7.9-2) unstable; urgency=medium
+
+  * Fix OpenSSL 4.0 compatibility (Closes: #1138469)
+
+ -- Scott Talbert <swt at techie.net>  Tue, 30 Jun 2026 10:55:53 -0400
+
 haskell-hsopenssl (0.11.7.9-1) unstable; urgency=medium
 
   * Build using dh-haskell


=====================================
p/haskell-hsopenssl/debian/patches/openssl-4.0-compat.patch
=====================================
@@ -0,0 +1,39 @@
+From d90408d57858fd8826b347b2b479265807ab3fad Mon Sep 17 00:00:00 2001
+From: Ravi Kant Sharma <ravi.kant.sharma at canonical.com>
+Date: Fri, 26 Jun 2026 16:50:56 +0200
+Subject: [PATCH] Fix OpenSSL 4.0 compatibility: replace #peek with accessor
+ functions
+
+ASN1_STRING is opaque in OpenSSL 4.0. Replace direct struct member
+access via #peek with ASN1_STRING_get0_data() and ASN1_STRING_length()
+accessor functions. These accessors have been available since
+OpenSSL 1.1.0 and are compatible with both 3.x and 4.0.
+
+Fixes: https://github.com/haskell-cryptography/HsOpenSSL/issues/105
+---
+ OpenSSL/ASN1.hsc | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/OpenSSL/ASN1.hsc b/OpenSSL/ASN1.hsc
+index 6376102..d8bfb4d 100644
+--- a/OpenSSL/ASN1.hsc
++++ b/OpenSSL/ASN1.hsc
+@@ -61,10 +61,16 @@ nid2ln nid = _nid2ln nid >>= peekCString
+ 
+ data {-# CTYPE "openssl/asn1.h" "ASN1_STRING" #-} ASN1_STRING
+ 
++foreign import capi unsafe "openssl/asn1.h ASN1_STRING_get0_data"
++        _ASN1_STRING_get0_data :: Ptr ASN1_STRING -> IO (Ptr CChar)
++
++foreign import capi unsafe "openssl/asn1.h ASN1_STRING_length"
++        _ASN1_STRING_length :: Ptr ASN1_STRING -> IO CInt
++
+ peekASN1String :: Ptr ASN1_STRING -> IO String
+ peekASN1String strPtr
+-    = do buf <- (#peek ASN1_STRING, data  ) strPtr
+-         len <- (#peek ASN1_STRING, length) strPtr :: IO CInt
++    = do buf <- _ASN1_STRING_get0_data strPtr
++         len <- _ASN1_STRING_length strPtr
+          peekCStringLen (buf, fromIntegral len)
+ 
+ 


=====================================
p/haskell-hsopenssl/debian/patches/series
=====================================
@@ -1 +1,2 @@
 gcc14-fix
+openssl-4.0-compat.patch



View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/-/commit/9c7df8598e402f19ce7c90446b67c7bce152c2fd

-- 
View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/-/commit/9c7df8598e402f19ce7c90446b67c7bce152c2fd
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-haskell-commits/attachments/20260630/0df2173c/attachment-0001.htm>


More information about the Pkg-haskell-commits mailing list