aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_ts.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'maint-2.2'Kazuki Yamaguchi2021-10-161-3/+13
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint-2.2: (43 commits) Ruby/OpenSSL 2.2.1 openssl is ractor-safe Fixed the results of OpenSSL::Timestamp::Response#failure_info Don't redefine #rb_intern over and over again Use rb_intern_const instead of rb_intern in Init functions Remove trailing spaces [ci skip] test/openssl/test_ssl: use TLS 1.2 for finished_messages on LibreSSL Ruby/OpenSSL 2.1.3 ssl: avoid directly storing String object in NPN callback x509store: explicitly call rb_gc_mark() against Store/StoreContext ssl: explicitly call rb_gc_mark() against SSLContext/SSLSocket objects digest: load digest library using Kernel#require pkey: use RSTRING_LENINT() instead of casting to int fix segv in Timestamp::{Request,Response,TokenInfo}.new ts: libressl build fix warning ext/openssl/extconf.rb: require OpenSSL version >= 1.0.1, < 3 .github/workflows: update OpenSSL/LibreSSL versions test: adjust test cases for LibreSSL 3.2.4 ssl: temporary lock string buffer while reading ssl: create a temporary frozen string buffer when writing ...
| * Fixed the results of OpenSSL::Timestamp::Response#failure_infoNobuyoshi Nakada2021-10-161-11/+11
| | | | | | | | | | | | | | | | | | | | | | [ This is a backport to the 2.2 branch. ] Made stored values `Symbol`s instead of `ID`s. Fixes https://bugs.ruby-lang.org/issues/17625 Co-Authored-By: xtkoba (Tee KOBAYASHI) <xtkoba+ruby@gmail.com> (cherry picked from commit f2d004679a62408a89d7304b229c24e789b94776)
| * Use rb_intern_const instead of rb_intern in Init functionsNobuyoshi Nakada2021-10-161-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | [ This is a backport to the 2.2 branch. ] ``` find . -name \*.o -exec nm {} + |& sed '/Init_.*\.rbimpl_id/!d;s/^.* b //;s/\.[1-9][0-9]*$//;s/\.rbimpl_id$//' | uniq ``` should be empty. (cherry picked from commit 9e4d4704e65bccd3cedeb9a07c9101f3c2eb02e9)
| * Merge pull request #407 from no6v/fix-timestamp-segvKazuki Yamaguchi2021-09-271-3/+9
| |\ | | | | | | fix segv in Timestamp::{Request,Response,TokenInfo}.new
| | * fix segv in Timestamp::{Request,Response,TokenInfo}.newNobuhiro IMAI2021-09-271-3/+9
| | | | | | | | | | | | prevent `ossl_ts_*_free()` from calling when `d2i_TS_*_bio()` failed.
| * | ts: libressl build fix warningDavid Carlier2021-09-271-0/+4
| |/ | | | | | | TS_time_cb on libressl expects an long long/time_t 64 bits long instead.
* | Merge pull request #456 from ruby/compilation-warningsKazuki Yamaguchi2021-09-121-3/+21
|\ \ | | | | | | Suppress compilation warnings
| * | Suppress cast-function-type warningsNobuyoshi Nakada2021-09-121-3/+21
| | |
* | | Separate formatting from ossl_make_errorNobuyoshi Nakada2021-09-121-1/+1
|/ / | | | | | | | | | | Just append OpenSSL error reason to the given message string object, which would be alreadly formatted. Suppress -Wformat-security warning in `ossl_tsfac_create_ts`.
* | require OpenSSL >= 1.0.2 and LibreSSL >= 3.1Kazuki Yamaguchi2021-04-041-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clean up old version guards in preparation for the upcoming OpenSSL 3.0 support. OpenSSL 1.0.1 reached its EOL on 2016-12-31. At that time, we decided to keep 1.0.1 support because many major Linux distributions were still shipped with 1.0.1. Now, nearly 4 years later, most Linux distributions are reaching their EOL and it should be safe to assume nobody uses them anymore. Major ones that were using 1.0.1: - Ubuntu 14.04 is EOL since 2019-04-30 - RHEL 6 will reach EOL on 2020-11-30 LibreSSL 3.0 and older versions are no longer supported by the LibreSSL team as of October 2020. Note that OpenSSL 1.0.2 also reached EOL on 2019-12-31 and 1.1.0 also did on 2018-08-31.
* | Fixed the results of OpenSSL::Timestamp::Response#failure_infoNobuyoshi Nakada2021-02-141-11/+11
| | | | | | | | | | | | | | | | Made stored values `Symbol`s instead of `ID`s. Fixes https://bugs.ruby-lang.org/issues/17625 Co-Authored-By: xtkoba (Tee KOBAYASHI) <xtkoba+ruby@gmail.com>
* | Use rb_intern_const instead of rb_intern in Init functionsNobuyoshi Nakada2020-12-141-13/+13
| | | | | | | | | | | | | | | | | | ``` find . -name \*.o -exec nm {} + |& sed '/Init_.*\.rbimpl_id/!d;s/^.* b //;s/\.[1-9][0-9]*$//;s/\.rbimpl_id$//' | uniq ``` should be empty.
* | digest, hmac, ts, x509: use IO.binread in examples where appropriateKazuki Yamaguchi2020-05-131-9/+9
|/ | | | | | | IO.read may mangle line separator, which will corrupt binary data including DER-encoded X.509 certificates and such. Fixes: https://github.com/ruby/openssl/issues/243
* Look up digest by name instead of constantBart de Water2020-04-211-3/+3
|
* ts: simplify OpenSSL::Timestamp::Request#algorithmky/ts-simplify-tsreq-get-algorithmKazuki Yamaguchi2020-02-171-6/+1
| | | | | | | | | | | | | | Stop the special treatment of invalid hashAlgorithm of the message imprint. Those invalid values can only appear after the object is instantiated, before the user sets an actual message digest algorithm. OpenSSL::Timestamp::TokenInfo#algorithm already does the same. Also, remove the test case "test_create_request" since it does not make much sense. Those fields are to be set by the user after creation of the object and checking the initial value is pointless. Fixes: https://github.com/ruby/openssl/issues/335
* expand tabsBen Toews2019-10-011-113/+113
|
* ts: require list of allowed digest algos for FactoryBen Toews2019-10-011-27/+45
|
* ts: address more feedbackBen Toews2019-10-011-39/+48
|
* ts: move TS_TST_INFO accessors to a new Timestamp::TokenInfo classBen Toews2019-10-011-188/+289
|
* ts: fix another leakBen Toews2019-10-011-4/+5
|
* ts: don't do anything that might raise in callbacksBen Toews2019-10-011-22/+20
|
* ts: simplify signature for TimestampFactory#additional_certs alsoBen Toews2019-10-011-19/+11
|
* ts: simplify TimestampResponse#response signatureBen Toews2019-10-011-123/+55
| | | | | | | This method allowed roots and intermediates to be specified in a number of ways. This complexity wasn't super valuable though and its better to only allow an X509::Store with an optional Array of intermediates. This greatly simplifies the code and fixes a few leaks.
* ts: address minor feedback from rhenium (more changes coming)Ben Toews2019-10-011-116/+57
| | | | | | | | | | | | | | - make some global variables static instead of extern - get rid of GetTsReqPtr/GetTsRespPtr functions - don't use c99 comments - fix some leaks - clarify what numeric type is returned (Integer or BN, never Fixnum) - typos - add missing checks, remove unecessary checks - use OPENSSL_NO_TS instead of our own macros checking for ts support - use EVP_{digest-name} instead of looking up algos by NID - don't differentiate between failure reasons when verifying - rename Response#pkcs7 to #token
* ts: fix windows buildBen Toews2019-10-011-14/+1
|
* ts: fix for libresslBen Toews2019-10-011-1/+5
| | | | | - define missing TS_RESP_CTX_set_time_cb - handle alternate case for nil oid
* ts: clean up some memory leaksBen Toews2019-10-011-38/+50
|
* ts: use newer TypedData_* macros instead of Data_* onesBen Toews2019-10-011-129/+153
|
* ts: update to work with openssl 1.1.xBen Toews2019-10-011-265/+235
| | | | | | | - clean up whitespace - be consistent with not returning after ossl_raise - use accessor functions when working with openssl TS_* structs - backport accessors for TS_STATUS_INFO, TS_VERIFY_CTX, and TS_RESP_CTX as macros
* ts: get tests running/passingBen Toews2019-10-011-8/+14
| | | | | | | A number of conventions seem to have changed, causing a fair bit of breakage: - `Data_*` was deprecated in favor of `TypedData_*` - `ossl_obj2bio` takes a `VALUE*` instead of `VALUE` now - `time_to_time_t()` was removed
* ts: Timestamp support (3/3)Martin Bosslet2019-10-011-3/+3
| | | | This commit applies the third patches (tsr3.tar.gz) from https://bugs.ruby-lang.org/issues/4183
* ts: Timestamp support (2/3)Martin Bosslet2019-10-011-41/+19
| | | | This commit applies the second patches (ts2.tar.gz) from https://bugs.ruby-lang.org/issues/4183
* ts: Timestamp support (1/3)Martin Bosslet2019-10-011-0/+1546
This commit applies the initial patches (ts.tar.gz) from https://bugs.ruby-lang.org/issues/4183 This compiles with several warnings. Tests don't run yet.