[gnutls-devel] GnuTLS | 32bit time issues with gnutls_x509_crt_[get, set]-*-time (#1670)
Read-only notification of GnuTLS library development activities
gnutls-devel at lists.gnutls.org
Tue Mar 4 17:51:39 CET 2025
Dariqq commented on a discussion: https://gitlab.com/gnutls/gnutls/-/issues/1670#note_2378723237
I think I made a mistake: when I checked 2 days ago i accidentally casted to int and when I redid it now I was looking at the wrong output of my test program.
gnutls indeed seems to return the correct value.
maybe the scm_from_int/scm_to_int in the 4 get/set functions are at fault? Not sure why this causes the weird error message in the `set-*`variants which suggests to me that gnutls gets the full number.
But I also dont know how `scm_to_int` works when it is trying to convert an arbitrary size guile integer to int.
In guile sources I found
```
#if SCM_SIZEOF_INT == 4
#define scm_to_int scm_to_int32
#define scm_from_int scm_from_int32
#define scm_to_uint scm_to_uint32
#define scm_from_uint scm_from_uint32
#else
#if SCM_SIZEOF_INT == 8
#define scm_to_int scm_to_int64
#define scm_from_int scm_from_int64
#define scm_to_uint scm_to_uint64
#define scm_from_uint scm_from_uint64
#else
#error sizeof(int) is not 4 or 8.
#endif
#endif
```
On my system `SCM_SIZEOF_INT` is `4` so guile seems to convert to/from int32_t
--
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/issues/1670#note_2378723237
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/a93f1a3a/attachment-0001.html>
More information about the Gnutls-devel
mailing list