-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace make_time function to work after 2050 #209
Conversation
By using ASN1_TIME_diff() instead of manually parsing the data, we make globus_gsi_cert_utils_make_time() a lot simpler and also work for ASN1_GENERALIZEDTIME and not just ASN1_UTCTIME (i.e. it can use ASN1_TIME). ASN1_TIME_diff requires OpenSSL >= 1.0.2. Also rework globus_gsi_cred_get_lifetime() to just use time(NULL) to get the current UNIX timestamp which means it no longer needs globus_gsi_cert_utils_make_time(). This fixes issue gridcf#208
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also also update the version numbers and packaging (RPM spec files and debian) in this PR?
done, not sure if these are all the files I needed to change. Also, I'm not a maintainer for the debian packages, so Mattias might need to take ownership of the changelog entries to prevent non-maintainer update issues (or make us all debian uploaders). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me*. IIUC with the usage of time_t
we are nowadays safe beyond 2038 for 64bit architectures (and GNU/Linux: time_t
is defined as __TIME64_T_TYPE
in /usr/include/x86_64-linux-gnu/bitstime64.h
on my Ubuntu 20.04), but 32bit architectures and other OSes (e.g. *BSDs) might not.
*) Only for the soname
value in packaging/fedora/globus-gsi-cert-utils.spec
I'm not sure about. So let's wait for clarifcation by Mattias (@ellert) before merging this.
Thanks!
I think Mattias will adapt these changelogs for the actual Debian/Ubuntu packages anyhow, so we are safe to change them here in our name. |
Btw, looks like we have our first difference between CentOS Stream 9 and Rocky Linux 9. The build build for CentOS Stream 9 doesn't work w/o #210 merged, the build for Rocky Linux 9 does work. I suspect the Docker images use different versions of OpenSSL, I'll check my VMs for any differences here. UPDATE: Indeed, for CentOS Stream 9 we have:
...and for Rocky Linux 9 we have:
|
considering |
Bit off-topic, but see also https://indico.cern.ch/event/1224843/#12-linux-future-in-wlcg-status i.e. WLCG also seems to be moving away from CentOS Stream in favour of ALMA and Rocky. |
Yeah, I read about that recently in some Linux newsletter. It's still good that we also build for CentOS Stream 9, because there might not always be a user that stumbles upon a mistake by me (see #207 and #210) and then the failing builds on CentOS Stream 9 would have uncovered it. ;-) |
I think we should avoid soname changes if possible.
So changing the argument from The calls to globus_gsi_cert_utils_make_time() in gsi/callback/source/library/globus_gsi_callback.c already calls it using a The same is true for the calls to globus_gsi_cert_utils_make_time() in gsi/credential/source/library/globus_gsi_cred_handle.c and myproxy/source/ssl_utils.c, since X509_get_notAfter() and X509_get_notBefore() return a So changing the type in the signature in the header actually reflects how the function is called now. |
Fine with me. :-) |
By using
ASN1_TIME_diff()
instead of manually parsing the data, we makeglobus_gsi_cert_utils_make_time()
a lot simpler and also work forASN1_GENERALIZEDTIME
and not justASN1_UTCTIME
(i.e. it can useASN1_TIME
).ASN1_TIME_diff()
requires OpenSSL >= 1.0.2.Also rework
globus_gsi_cred_get_lifetime()
to just usetime(NULL)
to get the current UNIX timestamp which means it no longer needsglobus_gsi_cert_utils_make_time()
.This fixes issue #208