aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Toews <mastahyeti@gmail.com>2018-07-06 10:00:07 -0600
committerSamuel Williams <samuel.williams@oriontransfer.co.nz>2019-10-01 11:25:06 +1300
commitfe642e702bf460e04f22c870e21a0810fffcb442 (patch)
treeeedbf909902614d2e31a9505ce0d465c57299013
parent8ed5a079a446bfc60a9a6929e877bb4ac55808b8 (diff)
downloadruby-openssl-fe642e702bf460e04f22c870e21a0810fffcb442.tar.gz
ts: fix windows build
-rwxr-xr-xext/openssl/ossl_ts.c15
-rwxr-xr-xtest/test_ts.rb18
2 files changed, 8 insertions, 25 deletions
diff --git a/ext/openssl/ossl_ts.c b/ext/openssl/ossl_ts.c
index 6581c5bf..8a0f7a17 100755
--- a/ext/openssl/ossl_ts.c
+++ b/ext/openssl/ossl_ts.c
@@ -7,19 +7,6 @@
* This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
-
-#include <openssl/asn1.h>
-#include <openssl/ossl_typ.h>
-#include <openssl/x509.h>
-#include <openssl/pkcs7.h>
-#include <openssl/objects.h>
-#include <openssl/evp.h>
-#include <openssl/err.h>
-#include <unistd.h>
-#include <openssl/bio.h>
-#include <openssl/crypto.h>
-#include <openssl/x509_vfy.h>
-
#include "ossl.h"
#if HAVE_OPENSSL_TS_H
@@ -1049,7 +1036,7 @@ ossl_ts_resp_verify(int argc, VALUE *argv, VALUE self)
TS_VERIFY_CTX *ctx;
X509_STORE *store;
TS_REQ *req;
- STACK_OF(X509) *certs;
+ STACK_OF(X509) *certs = NULL;
VALUE cert;
int i;
diff --git a/test/test_ts.rb b/test/test_ts.rb
index 38898f47..3b8e8311 100755
--- a/test/test_ts.rb
+++ b/test/test_ts.rb
@@ -342,17 +342,13 @@ _end_of_pem_
end
def test_verify_ee_root_from_file
- begin
- ts, req = timestamp_ee
- File.open('root_ca', 'wb') do |file|
- file.print(ca_cert.to_pem)
- end
- ts.verify(req, File.open('root_ca', 'rb'), intermediate_cert)
- ensure
- if File.exists?('root_ca')
- File.delete('root_ca')
- end
- end
+ file = Tempfile.new('root_ca', Dir.tmpdir, :mode => File::BINARY)
+ ts, req = timestamp_ee
+ file.print(ca_cert.to_pem)
+ file.close
+ ts.verify(req, File.open(file.path, 'rb'), intermediate_cert)
+ ensure
+ file.unlink
end
def test_verify_ee_def_policy