[gnutls-devel] Guile-GnuTLS | 32bit time issues with gnutls_x509_crt_[get, set]-*-time (#33)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Tue Mar 4 18:58:36 CET 2025




Dariqq commented on a discussion: https://gitlab.com/gnutls/guile/-/issues/33#note_2378844018


Something like this?

```diff
diff --git a/guile/src/core.c b/guile/src/core.c
index dd13149..289a228 100644
--- a/guile/src/core.c
+++ b/guile/src/core.c
@@ -3351,7 +3351,7 @@ SCM_DEFINE (scm_gnutls_x509_certificate_activation_time,
   c_cert = scm_to_gnutls_x509_certificate (cert, 1, FUNC_NAME);
   c_time = gnutls_x509_crt_get_activation_time (c_cert);
 
-  return scm_from_int (c_time);
+  return scm_from_long (c_time);
 }
 
 #undef FUNC_NAME
@@ -3368,7 +3368,7 @@ SCM_DEFINE (scm_gnutls_set_x509_certificate_activation_time,
   time_t c_time;
 
   c_cert = scm_to_gnutls_x509_certificate (cert, 1, FUNC_NAME);
-  c_time = scm_to_int (time);
+  c_time = scm_to_long (time);
 
   err = gnutls_x509_crt_set_activation_time (c_cert, c_time);
   if (EXPECT_FALSE (err))
@@ -3390,7 +3390,7 @@ SCM_DEFINE (scm_gnutls_x509_certificate_expiration_time,
   c_cert = scm_to_gnutls_x509_certificate (cert, 1, FUNC_NAME);
   c_time = gnutls_x509_crt_get_expiration_time (c_cert);
 
-  return scm_from_int (c_time);
+  return scm_from_long (c_time);
 }
 
 #undef FUNC_NAME
@@ -3407,7 +3407,7 @@ SCM_DEFINE (scm_gnutls_set_x509_certificate_expiration_time,
   time_t c_time;
 
   c_cert = scm_to_gnutls_x509_certificate (cert, 1, FUNC_NAME);
-  c_time = scm_to_int (time);
+  c_time = scm_to_long (time);
 
   err = gnutls_x509_crt_set_expiration_time (c_cert, c_time);
   if (EXPECT_FALSE (err))
```

How would this work on a 32bit system with/without 64bit time_t?

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/guile/-/issues/33#note_2378844018
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20250304/762eb5b2/attachment.html>


More information about the Gnutls-devel mailing list