From f1e5cecef8c7c14c330a19ea6e1ba8dcb9ddc123 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Mon, 4 Mar 2024 13:38:25 +0100 Subject: [PATCH] `adjust` was unexported from `Dates` in Julia 1.11 (#33) --- src/OpenSSL.jl | 6 +++--- test/runtests.jl | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/OpenSSL.jl b/src/OpenSSL.jl index 91176a3..abdfa0f 100644 --- a/src/OpenSSL.jl +++ b/src/OpenSSL.jl @@ -181,7 +181,7 @@ const BIO_TYPE_SOURCE_SINK = 0x0400 BIO_TYPE_MD = 8 | BIO_TYPE_FILTER, # BIO_TYPE_BUFFER = 9 | BIO_TYPE_FILTER, - # + # BIO_TYPE_CIPHER = 10 | BIO_TYPE_FILTER, # BIO_TYPE_BASE64 = 11 | BIO_TYPE_FILTER, @@ -1748,9 +1748,9 @@ function Dates.adjust(asn1_time::Asn1Time, seconds::Second) end end -Dates.adjust(asn1_time::Asn1Time, days::Day) = adjust(asn1_time, Second(days)) +Dates.adjust(asn1_time::Asn1Time, days::Day) = Dates.adjust(asn1_time, Second(days)) -Dates.adjust(asn1_time::Asn1Time, years::Year) = adjust(asn1_time, Day(365 * years.value)) +Dates.adjust(asn1_time::Asn1Time, years::Year) = Dates.adjust(asn1_time, Day(365 * years.value)) """ EVP_PKEY, EVP Public Key interface. diff --git a/test/runtests.jl b/test/runtests.jl index 96d4449..d820ce3 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -63,7 +63,7 @@ end @test String(Asn1Time(2)) == "Jan 1 00:00:02 1970 GMT" asn1_time = Asn1Time() - OpenSSL.adjust(asn1_time, Dates.Second(4)) + Dates.adjust(asn1_time, Dates.Second(4)) OpenSSL.free(asn1_time) @test String(asn1_time) == "C_NULL" @@ -72,10 +72,10 @@ end OpenSSL.free(asn1_time) @test String(asn1_time) == "C_NULL" - OpenSSL.adjust(asn1_time, Dates.Second(4)) - OpenSSL.adjust(asn1_time, Dates.Second(4)) - OpenSSL.adjust(asn1_time, Dates.Day(4)) - OpenSSL.adjust(asn1_time, Dates.Year(2)) + Dates.adjust(asn1_time, Dates.Second(4)) + Dates.adjust(asn1_time, Dates.Second(4)) + Dates.adjust(asn1_time, Dates.Day(4)) + Dates.adjust(asn1_time, Dates.Year(2)) @show asn1_time end @@ -277,8 +277,8 @@ end x509_certificate.subject_name = x509_name x509_certificate.issuer_name = x509_name - adjust(x509_certificate.time_not_before, Second(0)) - adjust(x509_certificate.time_not_after, Year(1)) + Dates.adjust(x509_certificate.time_not_before, Second(0)) + Dates.adjust(x509_certificate.time_not_after, Year(1)) add_extension(x509_certificate, X509Extension("basicConstraints", "CA:TRUE")) add_extension(x509_certificate, X509Extension("keyUsage", "keyCertSign")) @@ -327,8 +327,8 @@ end x509_certificate.subject_name = x509_name x509_certificate.issuer_name = x509_name - adjust(x509_certificate.time_not_before, Second(0)) - adjust(x509_certificate.time_not_after, Year(1)) + Dates.adjust(x509_certificate.time_not_before, Second(0)) + Dates.adjust(x509_certificate.time_not_after, Year(1)) add_extension(x509_certificate, X509Extension("basicConstraints", "CA:TRUE")) add_extension(x509_certificate, X509Extension("keyUsage", "keyCertSign")) @@ -379,8 +379,8 @@ end # Set public key x509_certificate.public_key = x509_request.public_key - adjust(x509_certificate.time_not_before, Second(0)) - adjust(x509_certificate.time_not_after, Year(1)) + Dates.adjust(x509_certificate.time_not_before, Second(0)) + Dates.adjust(x509_certificate.time_not_after, Year(1)) sign_certificate(x509_certificate, evp_pkey_ca) end @@ -441,8 +441,8 @@ end x509_certificate.subject_name = x509_name x509_certificate.issuer_name = x509_name - adjust(x509_certificate.time_not_before, Second(0)) - adjust(x509_certificate.time_not_after, Year(1)) + Dates.adjust(x509_certificate.time_not_before, Second(0)) + Dates.adjust(x509_certificate.time_not_after, Year(1)) sign_certificate(x509_certificate, evp_pkey)