From e85baad514e1c9f397ccc9d86c85047f3a21370f Mon Sep 17 00:00:00 2001
From: nterranova <nicholas.terranova@cnaf.infn.it>
Date: Mon, 5 Mar 2018 14:30:29 +0100
Subject: [PATCH] Expired proxy test

---
 t/README.md                               |  5 ++
 t/certs/0.cert.pem                        | 38 ++++++++++++
 t/certs/0.key.pem                         | 15 +++++
 t/certs/1.cert.pem                        | 71 ++++++++++++++++++++++
 t/certs/1.key.pem                         | 15 +++++
 t/certs/2.cert.pem                        | 71 ++++++++++++++++++++++
 t/certs/2.key.pem                         | 15 +++++
 t/{ => certs}/nginx_voms_example.cert.pem |  0
 t/{ => certs}/nginx_voms_example.key.pem  |  0
 t/{ => certs}/voms_example.cert.pem       |  0
 t/{ => certs}/voms_example.key.pem        |  0
 t/expired_proxy.t                         | 32 ++++++++++
 t/servroot/conf/nginx.conf                | 73 +++++++++++++++++++++++
 t/servroot/html/index.html                |  1 +
 t/servroot/logs/access.log                |  2 +
 t/servroot/logs/error.log                 | 11 ++++
 16 files changed, 349 insertions(+)
 create mode 100644 t/certs/0.cert.pem
 create mode 100644 t/certs/0.key.pem
 create mode 100644 t/certs/1.cert.pem
 create mode 100644 t/certs/1.key.pem
 create mode 100644 t/certs/2.cert.pem
 create mode 100644 t/certs/2.key.pem
 rename t/{ => certs}/nginx_voms_example.cert.pem (100%)
 rename t/{ => certs}/nginx_voms_example.key.pem (100%)
 rename t/{ => certs}/voms_example.cert.pem (100%)
 rename t/{ => certs}/voms_example.key.pem (100%)
 create mode 100644 t/expired_proxy.t
 create mode 100644 t/servroot/conf/nginx.conf
 create mode 100644 t/servroot/html/index.html
 create mode 100644 t/servroot/logs/access.log
 create mode 100644 t/servroot/logs/error.log

diff --git a/t/README.md b/t/README.md
index e69de29..8a49daa 100644
--- a/t/README.md
+++ b/t/README.md
@@ -0,0 +1,5 @@
+# ngx_http_voms_module testing 
+
+## Description
+
+
diff --git a/t/certs/0.cert.pem b/t/certs/0.cert.pem
new file mode 100644
index 0000000..7597490
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hMn61sQIrepvhrKEUR4XVorH2Bj8ek1/iLlgcmFMBOds+PrehSRR8Gn0IjlEg
+C68EY6KPE+FKySuS7Ur7lTAjNdddfdAgKV6hJyST6/dx8ymIkb8nxCPnxCcT2I2N
+vDxcPMc/wmnMa+smNal0sJ6m
+-----END CERTIFICATE-----
diff --git a/t/certs/0.key.pem b/t/certs/0.key.pem
new file mode 100644
index 0000000..c073616
--- /dev/null
+++ b/t/certs/0.key.pem
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICWwIBAAKBgQCAK11gog0f+wKWZjDF5rzJ0lsFNHuPxd0ma5mADlzxgMuY3YQW
+jnRce1BdumY0a+45cLqfiFjX3egRxcvs34JOOUcSbHmKZo3MW9x8R2PHHQLK2qLE
+63W1uE69lRIxipwh0l89fbWfsPW05sjf/5xnXpEc1ZkX/CKB0uhKvqptnQIDAQAB
+AoGAIEVK5IrIzTWRKDcgrqNzA0nQmxXkyoViMktDQefb5P6txJZ5rIg/qg1uZbsK
+AsbuG05T3tkgrXF0/gyUVNbN4vKE1Po1HyCIz8ZO5ZoA+AB3W5swdkf/sP9/y5jG
+qrh58CM+IqpyVIf0ZYSv3j/WEGgocBuzBlgzsu81ruR4ym0CQQDIAzAu1KigbKNs
+kJvgjWGJK5fAF+eJgQ4waH1wnzlExgM8lBpQhNXiYnvcrTUBbBtc4onXbD1iiHkD
+M52BJNhjAkEApAvuiv8TjIK9T5EyCf3Zbk5g8I9XUTNk2Qq9Dc9NfXnE9OwjNss/
+hjvDCX89OA1DFRuud2a0qgvMSrVXnW+B/wJAJQzSJBqoke8N5tJyzYnjA3Hbzm2f
+Kk2Jv1Xbxrz38tFrUBFvPnMc2666mwpKw1SvTOl59znJtTLql7k79+xHWQJAKcrA
+YrjJCirkf7jFvrXlBq0BFUfvPsiREJojv7joTOcQvjTKY9Mzw8bF0U2REw6N4HrE
+37ZSoF+RFBdO0tTtkQJAFs+jv0al71WnqEwoF0R8iSACcgTU5pG2c5upMUFbq+3V
+Sc2mleRKf33pghtj1f/HP9+CXhUVG1rtLkcR6qW5Cg==
+-----END RSA PRIVATE KEY-----
diff --git a/t/certs/1.cert.pem b/t/certs/1.cert.pem
new file mode 100644
index 0000000..2e4a5e2
--- /dev/null
+++ b/t/certs/1.cert.pem
@@ -0,0 +1,71 @@
+-----BEGIN CERTIFICATE-----
+MIIIojCCB4ygAwIBAgIEcYDNoDALBgkqhkiG9w0BAQUwKzELMAkGA1UEBhMCSVQx
+DDAKBgNVBAoTA0lHSTEOMAwGA1UEAxMFdGVzdDAwHhcNMTgwMzAyMTczNjQyWhcN
+MjIwOTI0MTUzOTM0WjBAMQswCQYDVQQGEwJJVDEMMAoGA1UEChMDSUdJMQ4wDAYD
+VQQDEwV0ZXN0MDETMBEGA1UEAxMKMTkwNDI2NjY1NjCBnzANBgkqhkiG9w0BAQEF
+AAOBjQAwgYkCgYEAiC0Veis/ymIVjIsabZe30IIZggg1/FORMOy1fzI89eProMyf
+lBtCkP55z47JIzN68PiGSLhAAIp8jpIoRECVsKfOiPYqAC/8Wi3SN3VR0BD59iTC
+PoM0QDTw2vfCAiDffrhkIibveDKgDeEg33WQGmKnS6/1ajGPz1pNG/s/3ksCAwEA
+AaOCBj8wggY7MA4GA1UdDwEB/wQEAwIF4DAdBggrBgEFBQcBDgEB/wQOMAwwCgYI
+KwYBBQUHFQEwggYIBgorBgEEAb5FZGQFBIIF+DCCBfQwggXwMIIF7DCCBNQCAQEw
+NqA0MC+kLTArMQswCQYDVQQGEwJJVDEMMAoGA1UEChMDSUdJMQ4wDAYDVQQDEwV0
+ZXN0MAIBCaA4MDakNDAyMQswCQYDVQQGEwJJVDEMMAoGA1UECgwDSUdJMRUwEwYD
+VQQDDAx2b21zLmV4YW1wbGUwDQYJKoZIhvcNAQELBQACAQAwIhgPMjAxODAzMDIx
+NzM2NDJaGA8yMDE4MDMwMzA1MzY0MlowOzA5BgorBgEEAb5FZGQEMSswKaAehhx0
+ZXN0LnZvOi8vdm9t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8ClscoXyTO2BzHHZLxauEKIzUv7g2GehI+SckfZdjFyRXjD0+wMGwzX7MDu
+SL3CG2aWsYpkBnj6BMlr0P3kZEMqV5t2+2Tj0+aXppBPVwzJwRhnrSJiO5WIZAZf
+49YhMn61sQIrepvhrKEUR4XVorH2Bj8ek1/iLlgcmFMBOds+PrehSRR8Gn0IjlEg
+C68EY6KPE+FKySuS7Ur7lTAjNdddfdAgKV6hJyST6/dx8ymIkb8nxCPnxCcT2I2N
+vDxcPMc/wmnMa+smNal0sJ6m
+-----END CERTIFICATE-----
diff --git a/t/certs/1.key.pem b/t/certs/1.key.pem
new file mode 100644
index 0000000..a52ef5b
--- /dev/null
+++ b/t/certs/1.key.pem
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXQIBAAKBgQCILRV6Kz/KYhWMixptl7fQghmCCDX8U5Ew7LV/Mjz14+ugzJ+U
+G0KQ/nnPjskjM3rw+IZIuEAAinyOkihEQJWwp86I9ioAL/xaLdI3dVHQEPn2JMI+
+gzRANPDa98ICIN9+uGQiJu94MqAN4SDfdZAaYqdLr/VqMY/PWk0b+z/eSwIDAQAB
+AoGAJM8i9hIIvTkEIChdrXAMVMVGBdsYVKt2HKZvbQF0bvb780w8enlf5feTj6JG
+BkjdG5PiIHgFfN/ySUuCrOhUTbNhAx5a9YExqtJoiNaVBcIvlwVEK6Md8iYc9Opv
+RB7MOwVmzoQQzTbsKQMDj2Bn1IZmLXKlaW+OW/n/I5KnoYkCQQDsLIGpEdnDlK3e
+FaRaBSL8dlE6PA3HKokTeEoy9/yWGcvvtBAfsL8GhFAXEzrCNbuy0dGUymksCSp5
+NTRSe6pfAkEAk5uTf+6TlZaCNutG3H9ScLTvBef3qcrVx9CzsPH8NK6x6GGhpPzl
+FBmLtsRxeOGTIFbnEcbfImbuSQ1rcPBrlQJBALiJbia1E/qGSfSl5G2SZevuZzmh
+gwKEcecMrq10p6CBN6Bsicy5RgnJiOr+04K8iZUH7ULdhaAq6U0cDW4FwvECQDXm
+Om8dtCCMbBIXybFcgMMNHrbeZI5ItdWX/PWg90JZhDdh5z+y5Qd46I6dnv3QCQRn
+F0tjfjk2ss5UKyZ7dB0CQQDAGspYNiI7YQoJm7hIAwh332SGuVVqb6IL9rMfsVR6
+ffsKgAQtwl5JYGEKEXtO/yylfaiYqOMHNRJPsiI7IHLq
+-----END RSA PRIVATE KEY-----
diff --git a/t/certs/2.cert.pem b/t/certs/2.cert.pem
new file mode 100644
index 0000000..aea83e0
--- /dev/null
+++ b/t/certs/2.cert.pem
@@ -0,0 +1,71 @@
+-----BEGIN CERTIFICATE-----
+MIIIojCCB4ygAwIBAgIETKDkCTALBgkqhkiG9w0BAQUwKzELMAkGA1UEBhMCSVQx
+DDAKBgNVBAoTA0lHSTEOMAwGA1UEAxMFdGVzdDAwHhcNMTgwMzAyMTc0MzQ5WhcN
+MTgwMzAyMTc0NDQ5WjBAMQswCQYDVQQGEwJJVDEMMAoGA1UEChMDSUdJMQ4wDAYD
+VQQDEwV0ZXN0MDETMBEGA1UEAxMKMTI4NTYxMjU1MzCBnzANBgkqhkiG9w0BAQEF
+AAOBjQAwgYkCgYEAn32CSq6B3ukrNYp+s5LoUp3I24j94ISIzML+ptf2znLsqsya
+V2VqCxFr7nBuYWi2dOR6Nbtfcc0pZKrEsnOWC8FYbB21GBdP9yBwQbQnQkoVgLPQ
+ZN6uf4d8AZXIgmP7C2p34lCJYlJ7MdC6LyzA08OYTfhM+YivX+bQJKV1/aMCAwEA
+AaOCBj8wggY7MA4GA1UdDwEB/wQEAwIF4DAdBggrBgEFBQcBDgEB/wQOMAwwCgYI
+KwYBBQUHFQEwggYIBgorBgEEAb5FZGQFBIIF+DCCBfQwggXwMIIF7DCCBNQCAQEw
+NqA0MC+kLTArMQswCQYDVQQGEwJJVDEMMAoGA1UEChMDSUdJMQ4wDAYDVQQDEwV0
+ZXN0MAIBCaA4MDakNDAyMQswCQYDVQQGEwJJVDEMMAoGA1UECgwDSUdJMRUwEw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xjAnBgNVHREEIDAe
+gRxhbmRyZWEuY2VjY2FudGlAY25hZi5pbmZuLml0MA0GCSqGSIb3DQEBBQUAA4IB
+AQANYtWXetheSeVpCfnId9TkKyKTAp8RahNZl4XFrWWn2S9We7ACK/G7u1DebJYx
+d8POo8ClscoXyTO2BzHHZLxauEKIzUv7g2GehI+SckfZdjFyRXjD0+wMGwzX7MDu
+SL3CG2aWsYpkBnj6BMlr0P3kZEMqV5t2+2Tj0+aXppBPVwzJwRhnrSJiO5WIZAZf
+49YhMn61sQIrepvhrKEUR4XVorH2Bj8ek1/iLlgcmFMBOds+PrehSRR8Gn0IjlEg
+C68EY6KPE+FKySuS7Ur7lTAjNdddfdAgKV6hJyST6/dx8ymIkb8nxCPnxCcT2I2N
+vDxcPMc/wmnMa+smNal0sJ6m
+-----END CERTIFICATE-----
diff --git a/t/certs/2.key.pem b/t/certs/2.key.pem
new file mode 100644
index 0000000..e829c42
--- /dev/null
+++ b/t/certs/2.key.pem
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXQIBAAKBgQCffYJKroHe6Ss1in6zkuhSncjbiP3ghIjMwv6m1/bOcuyqzJpX
+ZWoLEWvucG5haLZ05Ho1u19xzSlkqsSyc5YLwVhsHbUYF0/3IHBBtCdCShWAs9Bk
+3q5/h3wBlciCY/sLanfiUIliUnsx0LovLMDTw5hN+Ez5iK9f5tAkpXX9owIDAQAB
+AoGAbxTOQ0+JeoSxqIe+OTnvf2MPuv+Nuur0EJEbJX8zEZTviwIX2Rj0I6NNpfM+
+na99rKpZB8Vp82vuEYPynUtty77UJ7o0iziWQoyb0OsY/U8C0DL0jInicEa7exGP
+jWch1d9mFz5A4+mo8QFApo88Cx7ENHvWftro4CWPYkvEEikCQQD/28TpNbAAnJB7
+99S5QaXqAxaPdQIwff5T2OncIsmzL/DHbkp21tPccZ+LVtZp3/2vNF11HT8FYEbW
+bcsSZa2/AkEAn5QX82MXrcqEt0pdoU04UdNeSAXY8zaiRinPWlVAOjYl2kDcgInV
+DVx0psaoUYbvg+hxzKKunuHChytTYcBxHQJBAPq2hJatWCDRSjdf22AJNyY/Dm1W
+j+WqoHvTEx32LMVcVclmhqs6yXG7GUZ1ujcXGUQEwQuQs/91nxRhk9scLYsCQQCT
+MSSOaR6UPTMBZeTLPdDvGMnkIRCl9gTkNvh92BiwGPX9RMqe/YO5GUi39JGY8Z/H
+ygX9vSjYgGDQERSOG9W5AkAOhzoSyonBVeIvc7ky4F0KQSQupvyAQpTIZ/wkjbGo
+W5z9Y3TbN0zJA7Qnx6oEV5ZHshplSdZXYJNvVe5qGvG1
+-----END RSA PRIVATE KEY-----
diff --git a/t/nginx_voms_example.cert.pem b/t/certs/nginx_voms_example.cert.pem
similarity index 100%
rename from t/nginx_voms_example.cert.pem
rename to t/certs/nginx_voms_example.cert.pem
diff --git a/t/nginx_voms_example.key.pem b/t/certs/nginx_voms_example.key.pem
similarity index 100%
rename from t/nginx_voms_example.key.pem
rename to t/certs/nginx_voms_example.key.pem
diff --git a/t/voms_example.cert.pem b/t/certs/voms_example.cert.pem
similarity index 100%
rename from t/voms_example.cert.pem
rename to t/certs/voms_example.cert.pem
diff --git a/t/voms_example.key.pem b/t/certs/voms_example.key.pem
similarity index 100%
rename from t/voms_example.key.pem
rename to t/certs/voms_example.key.pem
diff --git a/t/expired_proxy.t b/t/expired_proxy.t
new file mode 100644
index 0000000..e064f60
--- /dev/null
+++ b/t/expired_proxy.t
@@ -0,0 +1,32 @@
+
+use Test::Nginx::Socket 'no_plan';
+
+run_tests();
+
+__DATA__
+
+=== TEST 1: https with x509 client authentication, expired client certificate
+--- main_config
+    env OPENSSL_ALLOW_PROXY_CERTS=1; 
+--- http_config
+    server {
+        error_log logs/error.log debug;
+        listen 8443 ssl;
+        ssl_certificate ../../certs/nginx_voms_example.cert.pem;
+        ssl_certificate_key ../../certs/nginx_voms_example.key.pem;
+        ssl_client_certificate ../../trust-anchors/igi-test-ca.pem;
+        ssl_verify_depth 10;
+        ssl_verify_client on;
+    }
+--- config
+    location = / {
+        proxy_pass https://localhost:8443/;
+        proxy_ssl_certificate ../../certs/2.cert.pem;
+        proxy_ssl_certificate_key ../../certs/2.key.pem;
+    }
+--- request
+GET /
+--- response_body_like: 400 Bad Request 
+--- error_code: 400
+--- error_log 
+certificate has expired
diff --git a/t/servroot/conf/nginx.conf b/t/servroot/conf/nginx.conf
new file mode 100644
index 0000000..bd4fda8
--- /dev/null
+++ b/t/servroot/conf/nginx.conf
@@ -0,0 +1,73 @@
+worker_processes  1;
+daemon on;
+master_process off;
+error_log /home/build/ngx_http_voms_module/t/servroot/logs/error.log debug;
+pid       /home/build/ngx_http_voms_module/t/servroot/logs/nginx.pid;
+env MOCKEAGAIN_VERBOSE;
+env MOCKEAGAIN;
+env MOCKEAGAIN_WRITE_TIMEOUT_PATTERN;
+env LD_PRELOAD;
+env LD_LIBRARY_PATH;
+env DYLD_INSERT_LIBRARIES;
+env DYLD_FORCE_FLAT_NAMESPACE;
+#env LUA_PATH;
+#env LUA_CPATH;
+
+    env OPENSSL_ALLOW_PROXY_CERTS=1; 
+
+
+http {
+    access_log /home/build/ngx_http_voms_module/t/servroot/logs/access.log;
+    #access_log off;
+
+    default_type text/plain;
+    keepalive_timeout  68;
+
+    server {
+        error_log logs/error.log debug;
+        listen 8443 ssl;
+        ssl_certificate ../../certs/nginx_voms_example.cert.pem;
+        ssl_certificate_key ../../certs/nginx_voms_example.key.pem;
+        ssl_client_certificate ../../trust-anchors/igi-test-ca.pem;
+        ssl_verify_depth 10;
+        ssl_verify_client on;
+    }
+
+
+    server {
+        listen          1984;
+        server_name     'localhost';
+
+        client_max_body_size 30M;
+        #client_body_buffer_size 4k;
+
+        # Begin preamble config...
+
+        # End preamble config...
+
+        # Begin test case config...
+    location = / {
+        proxy_pass https://localhost:8443/;
+        proxy_ssl_certificate ../../certs/2.cert.pem;
+        proxy_ssl_certificate_key ../../certs/2.key.pem;
+    }
+
+        # End test case config.
+
+        location / {
+            root /home/build/ngx_http_voms_module/t/servroot/html;
+            index index.html index.htm;
+        }
+    }
+}
+
+
+
+#timer_resolution 100ms;
+
+events {
+    accept_mutex off;
+
+    worker_connections  64;
+}
+env ASAN_OPTIONS;
diff --git a/t/servroot/html/index.html b/t/servroot/html/index.html
new file mode 100644
index 0000000..d99c1a6
--- /dev/null
+++ b/t/servroot/html/index.html
@@ -0,0 +1 @@
+<html><head><title>It works!</title></head><body>It works!</body></html>
\ No newline at end of file
diff --git a/t/servroot/logs/access.log b/t/servroot/logs/access.log
new file mode 100644
index 0000000..8ab584c
--- /dev/null
+++ b/t/servroot/logs/access.log
@@ -0,0 +1,2 @@
+127.0.0.1 - - [05/Mar/2018:13:23:08 +0000] "GET / HTTP/1.0" 400 237 "-" "-"
+127.0.0.1 - - [05/Mar/2018:13:23:08 +0000] "GET / HTTP/1.1" 400 237 "-" "-"
diff --git a/t/servroot/logs/error.log b/t/servroot/logs/error.log
new file mode 100644
index 0000000..fcce3a0
--- /dev/null
+++ b/t/servroot/logs/error.log
@@ -0,0 +1,11 @@
+2018/03/05 13:23:08 [notice] 8663#8663: using the "epoll" event method
+2018/03/05 13:23:08 [notice] 8663#8663: openresty/1.13.6.1
+2018/03/05 13:23:08 [notice] 8663#8663: built by gcc 7.2.1 20170829 (Red Hat 7.2.1-1) (GCC) 
+2018/03/05 13:23:08 [notice] 8663#8663: OS: Linux 4.13.0-26-generic
+2018/03/05 13:23:08 [notice] 8663#8663: getrlimit(RLIMIT_NOFILE): 1048576:1048576
+2018/03/05 13:23:08 [info] 8664#8664: *3 client SSL certificate verify error: (10:certificate has expired) while reading client request headers, client: 127.0.0.1, server: , request: "GET / HTTP/1.0", host: "localhost:8443"
+2018/03/05 13:23:08 [notice] 8664#8664: signal 3 (SIGQUIT) received from 8650, shutting down
+2018/03/05 13:23:08 [info] 8664#8664: epoll_wait() failed (4: Interrupted system call)
+2018/03/05 13:23:08 [notice] 8664#8664: signal 15 (SIGTERM) received from 8650, exiting
+2018/03/05 13:23:08 [notice] 8664#8664: exiting
+2018/03/05 13:23:08 [notice] 8664#8664: exit
-- 
GitLab