зеркало из https://github.com/mono/mono-tls.git
Initial import.
This commit is contained in:
Коммит
90561a4767
|
@ -0,0 +1,3 @@
|
|||
packages
|
||||
bin
|
||||
obj
|
|
@ -0,0 +1,3 @@
|
|||
lib/
|
||||
*.xcuserstate
|
||||
xcshareddata
|
|
@ -0,0 +1 @@
|
|||
*.old
|
|
@ -0,0 +1,54 @@
|
|||
-----BEGIN ENCRYPTED PRIVATE KEY-----
|
||||
MIIJjjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIgKxI+vvd7jgCAggA
|
||||
MBQGCCqGSIb3DQMHBAitmHheLrJYYwSCCUjnQ/qCyQhV3qoacSpoWsbEuQ2m3W5X
|
||||
Lg4TfsaDpsy6KrSzcXcrPkECwTje8RW1w3QqRSEG3ChRMKPqW7/HZ93pK6zq8b+z
|
||||
jhkhkK8200gWr0I0Z5mdFi8qG7tBdAEkO71EcVsK7K+xaL62RPVEEY/r7ubVj18Z
|
||||
oPm+96NZ03RNZ1N2vvtprF/0vozYUPmBWwJvtUyIg/N7GMHnMAjkkRo3N5f+OJVK
|
||||
65MoibzLYxVdlj5NSSPEulrnCE7StkZDpQ77RtggRk8Aqwzt/ba4EPXJowYTOq6z
|
||||
oFtKps9Q9nc+GimsS7AjmOnhLx7p+II/Y4r3GmuZMvZGEkpX4zfVxYpOEoRmEbG5
|
||||
Knuzq327QiPubqrO+cFv1+iFMeQzRt5jorcrn+ZZs3e73tCWk3jFt4SfPUwxAhge
|
||||
UyamUNbH+3CNwJ1jXpWjzNY7csNFvm4O8oNG5oYNyJEp8SkYEOcRjkaCqgyWMR+X
|
||||
JWRW9qU42f5dCTwf9RuHS9f2w2VHm3dIvCuoUYgLQoYY0GOgWJSR5YqWSAE94xDQ
|
||||
GoZ5azwYR0wngTrMhPNlL0RNv+5iWxWfR/7GPN6w7NOSTVl3CWugX0svpOEA3/ey
|
||||
lxPK+k2r7Z8ny5kkOkAawkKdpYa2h14bwocw2ks+ivtjEmWdfHDCZcr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g2U
|
||||
TQQzdhp1sSA9rZfyq4DOtOweQLXInT52r6zFGmygY+SrgYqk9uW6X8pp2ObbaZcl
|
||||
Oz0G/wsYfZSf6te3KkXtW40klYh35bPus83qOuTOXdu8fhhqxiHg9ymMRUq/3MtZ
|
||||
lI8uOxsnvj1XxGT7QR3C6kxQq9jcZ7AcufXmiQ9aJbkvPGJwo4rim1B/R/fTUnxG
|
||||
iTskBLMUAwF4jKJFpuBm61rgnxO4x8+5SXECBpG9Wsr0h16Qb3CfWm4VlSu9nplV
|
||||
JqM2xT7H9+Yh3u5HLrSWTvS9dKuY2VmtSXFfqMkzmqr+n9gzt/NZ6cktml2dIh8C
|
||||
BNm2G5IrvHvva432V/qf2/Ea9yXph+8iIsrRxVtvaoxqDBf/4fmTatVQQFVatDJq
|
||||
aO5wTL1zqAxd4kVkHA7QPB+VXt3qu0cWk625lJ7I22gY/uW0/Jz5D4F2sg77yD62
|
||||
xIVmnSKNbVXm4aS5lpyQJBepp/5Vl9xgbNlZmzcdi8NghmEQufeRa4nX/aFdvLxR
|
||||
ibRwMFOD9vd3Wh8i4GCHzvbwpZFLUy3XR7BDrRFkr30Lzx6N7aQ2BZ/JCn69dXlm
|
||||
9fci+a68
|
||||
-----END CERTIFICATE-----
|
|
@ -0,0 +1,22 @@
|
|||
Initialize:
|
||||
$ echo '100001' >serial
|
||||
$ touch certindex.txt
|
||||
$ mkdir certs
|
||||
|
||||
Create CA:
|
||||
/usr/local/bin/openssl req -new -x509 -days 3650 -keyout cakey.pem -out cacert.pem
|
||||
|
||||
Create Certificate Request:
|
||||
/usr/local/bin/openssl req -new -nodes -out monkey-req.pem -keyout monkey-key.pem -days 3650
|
||||
|
||||
Create Certificate:
|
||||
/usr/local/bin/openssl ca -cert cacert.pem -keyfile cakey.pem -out monkey-cert.pem -days 3650 -infiles monkey-req.pem
|
||||
|
||||
Create .PFX:
|
||||
/usr/local/bin/openssl pkcs12 -export -out monkey.pfx -inkey monkey-key.pem -in monkey-cert.pem
|
||||
|
||||
Password is 'monkey'.
|
||||
|
||||
Create CR for the Server Certificate:
|
||||
openssl req -config server-cert.conf -extensions server_exts -nodes -days 3650 -newkey rsa:4096 -keyout server-cert.key -out server-cert.crt
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
V 241118194510Z 100001 unknown /C=US/ST=Massachusetts/O=Xamarin/OU=Engineering/CN=Hamiller-Tube.local
|
||||
V 241119221622Z 100002 unknown /C=US/ST=Massachusetts/O=Xamarin/OU=Engineering/CN=Monkey
|
|
@ -0,0 +1 @@
|
|||
unique_subject = yes
|
|
@ -0,0 +1,112 @@
|
|||
Certificate:
|
||||
Data:
|
||||
Version: 1 (0x0)
|
||||
Serial Number: 1048577 (0x100001)
|
||||
Signature Algorithm: md5WithRSAEncryption
|
||||
Issuer: C=US, ST=Massachusetts, O=Xamarin, OU=Engineering, CN=Hamiller-Tube CA/emailAddress=martin.baulig@xamarin.com
|
||||
Validity
|
||||
Not Before: Nov 21 19:45:10 2014 GMT
|
||||
Not After : Nov 18 19:45:10 2024 GMT
|
||||
Subject: C=US, ST=Massachusetts, O=Xamarin, OU=Engineering, CN=Hamiller-Tube.local
|
||||
Subject Public Key Info:
|
||||
Public Key Algorithm: rsaEncryption
|
||||
Public-Key: (4096 bit)
|
||||
Modulus:
|
||||
00:bf:7b:2b:8b:ef:98:21:28:1e:2f:8b:3c:ca:f8:
|
||||
89:36:89:ef:3c:ee:cb:41:d0:e7:46:08:86:65:31:
|
||||
77:b9:18:61:36:00:c7:d2:92:cd:c6:c3:23:05:67:
|
||||
fc:f1:8d:40:a6:5b:45:c8:5f:d7:6f:2b:8f:4b:36:
|
||||
d7:4a:df:f6:f8:17:33:1d:ce:59:82:ec:dd:06:e9:
|
||||
82:42:e4:1f:f3:e3:15:60:bb:24:b3:09:e0:84:78:
|
||||
e1:31:35:87:bb:93:f0:a4:28:ef:e4:37:cf:ca:69:
|
||||
f5:74:9f:6d:25:fe:45:e2:23:c0:92:43:eb:b0:31:
|
||||
22:1a:92:4f:ba:72:70:69:e6:34:65:d8:9d:ed:76:
|
||||
08:3f:2e:8b:f8:ba:3b:bb:4d:26:81:b7:ec:79:1f:
|
||||
12:a7:dc:bb:fd:3c:71:d5:d5:e7:7e:48:02:a3:bb:
|
||||
66:66:d9:93:98:cd:6a:27:a4:b7:0c:f1:d9:02:44:
|
||||
26:9e:99:ac:51:6a:90:c4:b2:0a:bf:89:a2:d7:2f:
|
||||
49:b9:85:3c:47:99:22:a9:ff:ee:bb:c2:80:e6:17:
|
||||
09:19:ca:97:b2:6b:25:31:f2:54:52:e2:04:00:f9:
|
||||
84:8b:c7:3b:af:41:15:1a:23:8e:c0:81:8b:25:24:
|
||||
8c:63:4c:4f:9c:d6:fd:12:28:38:f8:91:77:9d:bb:
|
||||
55:8d:89:43:c0:51:92:87:4f:a3:79:62:e5:08:06:
|
||||
74:31:b4:26:6a:81:e6:db:05:d0:69:61:a0:f7:38:
|
||||
2c:9a:0d:a6:d9:c2:3c:ed:d7:69:c9:13:54:1d:6c:
|
||||
91:6d:81:b3:24:e2:0f:0b:12:81:ff:f8:e3:9f:63:
|
||||
b7:3a:5a:83:18:b9:ec:05:9f:a1:31:23:82:0a:ef:
|
||||
c2:a4:d0:7f:36:4b:58:9c:43:e9:a5:b7:ea:f2:2a:
|
||||
de:29:03:34:64:86:0e:81:60:b4:93:42:16:3c:fb:
|
||||
8e:d6:5e:b4:84:87:68:2b:2f:58:13:40:d6:81:ff:
|
||||
84:7d:60:f1:b5:eb:aa:fc:73:48:93:8e:be:74:a2:
|
||||
da:ff:94:18:d7:41:06:25:56:37:a5:f6:5b:24:c4:
|
||||
c3:e0:f9:b6:b8:8a:28:77:ee:e7:a3:80:97:85:12:
|
||||
9e:f5:1b:99:83:2e:ca:a9:bc:68:fa:30:0c:d7:0e:
|
||||
f8:f1:2f:68:cb:38:a1:72:73:40:b5:e6:4e:f8:eb:
|
||||
02:3f:dd:3c:d7:e9:8d:48:51:d5:0b:81:a6:1e:9e:
|
||||
ac:3a:be:52:aa:f7:5b:75:be:fe:92:90:22:0a:02:
|
||||
ae:45:ea:05:07:d2:84:af:a5:46:bb:35:3d:1c:81:
|
||||
de:a3:1c:3d:ea:1e:ee:ae:49:df:86:dd:cc:53:56:
|
||||
21:22:67
|
||||
Exponent: 65537 (0x10001)
|
||||
Signature Algorithm: md5WithRSAEncryption
|
||||
6d:dd:34:c6:9a:2a:e5:d0:d2:c2:11:91:16:e2:da:90:46:45:
|
||||
78:f8:7e:83:4f:58:87:66:86:11:49:3e:87:1f:d8:57:9e:84:
|
||||
7f:1c:b3:37:ca:8d:93:ef:75:29:6c:db:51:ad:bd:77:e9:77:
|
||||
a7:5a:70:f9:a3:fd:8a:2f:3a:a6:e0:99:64:eb:10:81:74:bf:
|
||||
f2:a4:38:fe:72:93:61:e6:7b:b3:14:af:e7:a2:56:09:51:af:
|
||||
0e:5c:7b:51:70:67:dd:6e:6e:cb:a4:bf:fe:5c:0c:41:6e:14:
|
||||
a1:ff:a4:56:79:a2:37:82:88:bf:66:53:59:d0:6a:9a:94:74:
|
||||
d9:0b:5b:9b:83:7e:49:46:f4:03:6c:3f:50:db:a1:84:8d:d8:
|
||||
79:d4:bf:33:aa:43:bf:e7:c0:4b:48:47:a5:20:fb:64:f5:77:
|
||||
34:1e:cd:85:8e:48:6b:5f:68:e5:91:8c:07:d4:db:ee:86:70:
|
||||
d3:59:2a:86:79:48:f4:2a:f5:41:92:c9:cd:05:65:16:61:45:
|
||||
01:9f:bb:45:aa:0b:84:4c:0f:df:05:b0:7a:88:a4:ee:3a:a9:
|
||||
a4:e2:68:ed:58:39:3f:80:e9:8a:b1:d1:98:ed:74:6b:46:5f:
|
||||
fa:a6:d0:94:f9:a3:f5:c7:dd:4c:77:30:e8:e8:be:da:7d:aa:
|
||||
f0:2e:89:a4:54:ce:0a:d0:a4:be:6e:45:34:04:4c:0d:21:e4:
|
||||
06:a1:b1:7a:24:2b:9c:6d:8d:74:57:77:43:c1:2b:73:d3:14:
|
||||
20:53:a4:ff:d5:15:1b:27:93:a9:a9:10:e6:3e:01:94:1c:f4:
|
||||
3b:0c:ae:c5:0c:4c:5d:4f:84:26:fa:e2:b8:e9:d2:b0:05:71:
|
||||
99:53:4c:ae:2f:f0:df:35:53:e3:d4:04:10:ee:6d:66:7a:15:
|
||||
8c:8e:81:2a:0d:74:b6:fc:93:82:13:0d:ff:71:21:44:4d:e2:
|
||||
86:4b:26:37:7e:04:15:55:f0:33:92:bd:7d:29:ae:db:b9:07:
|
||||
96:aa:a1:ec:2b:e0:cb:9a:0c:dd:bf:b2:ac:66:99:ec:d0:29:
|
||||
77:80:f8:63:32:3c:2f:0b:1f:04:19:e6:c9:df:d0:b9:23:be:
|
||||
e8:dd:98:3a:5b:21:55:0c:8a:a6:e5:3b:46:3c:bb:d3:92:4e:
|
||||
4c:86:b2:31:5e:a0:ae:fc:2f:3a:32:39:f7:26:69:5b:16:45:
|
||||
90:33:2f:12:f5:4a:6a:22:35:95:1f:25:00:8a:87:05:39:13:
|
||||
ac:60:d7:19:57:da:e6:ac:fa:18:c3:b2:83:e2:a1:b6:37:82:
|
||||
86:5d:a7:7d:1b:c3:d2:25:fd:d2:eb:d9:9d:74:76:b7:fc:dd:
|
||||
76:f7:8d:95:a2:c5:46:1c
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIFdDCCA1wCAxAAATANBgkqhkiG9w0BAQQFADCBkjELMAkGA1UEBhMCVVMxFjAU
|
||||
BgNVBAgTDU1hc3NhY2h1c2V0dHMxEDAOBgNVBAoTB1hhbWFyaW4xFDASBgNVBAsT
|
||||
C0VuZ2luZWVyaW5nMRkwFwYDVQQDExBIYW1pbGxlci1UdWJlIENBMSgwJgYJKoZI
|
||||
hvcNAQkBFhltYXJ0aW4uYmF1bGlnQHhhbWFyaW4uY29tMB4XDTE0MTEyMTE5NDUx
|
||||
MFoXDTI0MTExODE5NDUxMFowazELMAkGA1UEBhMCVVMxFjAUBgNVBAgTDU1hc3Nh
|
||||
Y2h1c2V0dHM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XBn3W5uy6S//lwMQW4Uof+kVnmiN4KIv2ZT
|
||||
WdBqmpR02Qtbm4N+SUb0A2w/UNuhhI3YedS/M6pDv+fAS0hHpSD7ZPV3NB7NhY5I
|
||||
a19o5ZGMB9Tb7oZw01kqhnlI9Cr1QZLJzQVlFmFFAZ+7RaoLhEwP3wWweoik7jqp
|
||||
pOJo7Vg5P4DpirHRmO10a0Zf+qbQlPmj9cfdTHcw6Oi+2n2q8C6JpFTOCtCkvm5F
|
||||
NARMDSHkBqGxeiQrnG2NdFd3Q8Erc9MUIFOk/9UVGyeTqakQ5j4BlBz0OwyuxQxM
|
||||
XU+EJvriuOnSsAVxmVNMri/w3zVT49QEEO5tZnoVjI6BKg10tvyTghMN/3EhRE3i
|
||||
hksmN34EFVXwM5K9fSmu27kHlqqh7Cvgy5oM3b+yrGaZ7NApd4D4YzI8LwsfBBnm
|
||||
yd/QuSO+6N2YOlshVQyKpuU7Rjy705JOTIayMV6grvwvOjI59yZpWxZFkDMvEvVK
|
||||
aiI1lR8lAIqHBTkTrGDXGVfa5qz6GMOyg+KhtjeChl2nfRvD0iX90uvZnXR2t/zd
|
||||
dveNlaLFRhw=
|
||||
-----END CERTIFICATE-----
|
|
@ -0,0 +1,77 @@
|
|||
Certificate:
|
||||
Data:
|
||||
Version: 1 (0x0)
|
||||
Serial Number: 1048578 (0x100002)
|
||||
Signature Algorithm: md5WithRSAEncryption
|
||||
Issuer: C=US, ST=Massachusetts, O=Xamarin, OU=Engineering, CN=Hamiller-Tube CA/emailAddress=martin.baulig@xamarin.com
|
||||
Validity
|
||||
Not Before: Nov 22 22:16:22 2014 GMT
|
||||
Not After : Nov 19 22:16:22 2024 GMT
|
||||
Subject: C=US, ST=Massachusetts, O=Xamarin, OU=Engineering, CN=Monkey
|
||||
Subject Public Key Info:
|
||||
Public Key Algorithm: rsaEncryption
|
||||
Public-Key: (1024 bit)
|
||||
Modulus:
|
||||
00:b4:60:e0:ff:ca:38:65:06:b7:6a:11:97:3a:53:
|
||||
06:18:c7:cb:d8:78:47:7c:b4:7f:b0:9d:ad:dd:12:
|
||||
50:ff:3a:2e:21:5b:91:4e:77:79:52:92:68:61:f4:
|
||||
ef:6f:ba:39:0a:bb:fa:04:7e:d8:39:c0:87:fd:8b:
|
||||
ca:56:79:69:78:b9:59:65:0f:9c:a6:88:f1:9b:7b:
|
||||
15:17:97:72:44:8e:1e:ee:62:df:62:00:41:4d:81:
|
||||
91:6e:e0:eb:cc:fb:9f:67:22:35:43:79:df:7f:45:
|
||||
74:10:ae:1b:37:ce:b5:2b:ec:ba:97:fb:2f:a9:94:
|
||||
8f:97:34:c3:e4:df:ce:c6:73
|
||||
Exponent: 65537 (0x10001)
|
||||
Signature Algorithm: md5WithRSAEncryption
|
||||
96:e7:04:f1:a8:9f:2e:93:8f:f4:84:be:74:32:ab:8f:ec:fd:
|
||||
eb:25:8b:89:d3:a8:f0:ba:76:11:2c:01:44:b9:f0:61:21:59:
|
||||
8c:fb:13:47:31:41:ee:61:df:96:08:47:a8:52:b6:87:ae:c8:
|
||||
3a:f3:da:9d:7f:f5:c1:2a:7e:b2:3e:f4:30:39:7a:21:ea:07:
|
||||
0a:af:4d:c5:7f:7e:49:70:b8:ec:96:b3:13:64:28:cf:32:06:
|
||||
51:39:8f:7b:16:5c:33:65:4c:e0:af:04:72:2d:b7:f8:0c:99:
|
||||
8a:f8:61:91:0a:7f:19:a6:bf:95:51:a9:8c:e4:52:8f:43:2f:
|
||||
47:e9:06:b2:c0:7d:4b:c5:60:83:30:7b:ea:b4:87:a9:a1:34:
|
||||
d1:90:58:c0:57:8e:c1:d5:6a:b5:e4:b2:0b:73:06:9a:5b:26:
|
||||
4b:68:7d:da:e1:93:66:ee:cc:10:6c:94:85:05:88:fc:00:a1:
|
||||
63:48:e0:13:b5:f9:f0:71:43:21:3b:80:cc:ec:2f:96:d6:a3:
|
||||
58:24:e7:73:8b:ca:a2:c9:b2:23:a6:94:1b:9e:1d:b4:28:a2:
|
||||
43:ac:83:2b:c0:bd:e0:8c:3a:33:14:67:4d:d5:aa:9d:2f:f6:
|
||||
1b:c4:16:a7:35:21:6e:68:8b:7a:b1:66:30:fb:04:60:e8:82:
|
||||
9c:7c:f8:55:40:e5:f5:fa:34:c4:17:d7:d0:ab:8f:74:93:df:
|
||||
82:36:49:b2:d4:fc:a3:93:04:e7:6c:92:47:fe:0c:65:55:7f:
|
||||
b9:5d:2e:d8:69:57:2d:7a:a3:a1:84:43:5e:2e:3c:b6:7e:5e:
|
||||
04:fd:41:2f:25:56:be:7c:61:f3:af:39:a8:b6:01:ae:d5:3d:
|
||||
dd:56:ca:a9:2c:e7:87:90:48:94:a1:a7:6f:3a:26:56:6d:f0:
|
||||
e7:29:fe:49:7d:f7:d5:d3:85:26:15:dc:02:60:e9:4e:c9:64:
|
||||
9f:70:66:c1:fb:d8:66:7a:a1:ac:98:74:ad:f8:2c:4d:a2:50:
|
||||
74:3c:53:20:3c:1b:34:71:e3:d7:64:56:21:b8:11:12:a9:b1:
|
||||
4d:c1:b2:e2:45:5d:fe:92:94:bd:2a:7f:1e:35:c9:f1:5a:d1:
|
||||
7f:36:58:0c:93:a1:d0:76:d2:c7:55:36:b3:ef:01:5c:ba:37:
|
||||
27:ef:34:b9:b3:c8:62:ae:1f:d3:8c:cb:a4:31:69:38:6a:46:
|
||||
70:dd:46:bf:e5:fc:d2:5a:ec:36:7c:49:01:86:24:3e:a7:5d:
|
||||
87:46:ae:84:3a:3a:dd:88:1a:a4:3f:68:7b:e4:b3:e3:40:9e:
|
||||
82:3f:30:d3:3a:bb:56:fc:b1:43:8f:0e:87:b5:4c:1e:76:ae:
|
||||
f4:c5:b3:cf:34:64:b7:ce
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIID4zCCAcsCAxAAAjANBgkqhkiG9w0BAQQFADCBkjELMAkGA1UEBhMCVVMxFjAU
|
||||
BgNVBAgTDU1hc3NhY2h1c2V0dHMxEDAOBgNVBAoTB1hhbWFyaW4xFDASBgNVBAsT
|
||||
C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kl999XThSYV3AJg6U7JZJ9wZsH72GZ6oayYdK34LE2i
|
||||
UHQ8UyA8GzRx49dkViG4ERKpsU3BsuJFXf6SlL0qfx41yfFa0X82WAyTodB20sdV
|
||||
NrPvAVy6NyfvNLmzyGKuH9OMy6QxaThqRnDdRr/l/NJa7DZ8SQGGJD6nXYdGroQ6
|
||||
Ot2IGqQ/aHvks+NAnoI/MNM6u1b8sUOPDoe1TB52rvTFs880ZLfO
|
||||
-----END CERTIFICATE-----
|
|
@ -0,0 +1,93 @@
|
|||
Certificate:
|
||||
Data:
|
||||
Version: 1 (0x0)
|
||||
Serial Number: 1048578 (0x100002)
|
||||
Signature Algorithm: md5WithRSAEncryption
|
||||
Issuer: C=US, ST=Massachusetts, O=Xamarin, OU=Engineering, CN=Hamiller-Tube CA/emailAddress=martin.baulig@xamarin.com
|
||||
Validity
|
||||
Not Before: Nov 22 22:16:22 2014 GMT
|
||||
Not After : Nov 19 22:16:22 2024 GMT
|
||||
Subject: C=US, ST=Massachusetts, O=Xamarin, OU=Engineering, CN=Monkey
|
||||
Subject Public Key Info:
|
||||
Public Key Algorithm: rsaEncryption
|
||||
Public-Key: (1024 bit)
|
||||
Modulus:
|
||||
00:b4:60:e0:ff:ca:38:65:06:b7:6a:11:97:3a:53:
|
||||
06:18:c7:cb:d8:78:47:7c:b4:7f:b0:9d:ad:dd:12:
|
||||
50:ff:3a:2e:21:5b:91:4e:77:79:52:92:68:61:f4:
|
||||
ef:6f:ba:39:0a:bb:fa:04:7e:d8:39:c0:87:fd:8b:
|
||||
ca:56:79:69:78:b9:59:65:0f:9c:a6:88:f1:9b:7b:
|
||||
15:17:97:72:44:8e:1e:ee:62:df:62:00:41:4d:81:
|
||||
91:6e:e0:eb:cc:fb:9f:67:22:35:43:79:df:7f:45:
|
||||
74:10:ae:1b:37:ce:b5:2b:ec:ba:97:fb:2f:a9:94:
|
||||
8f:97:34:c3:e4:df:ce:c6:73
|
||||
Exponent: 65537 (0x10001)
|
||||
Signature Algorithm: md5WithRSAEncryption
|
||||
96:e7:04:f1:a8:9f:2e:93:8f:f4:84:be:74:32:ab:8f:ec:fd:
|
||||
eb:25:8b:89:d3:a8:f0:ba:76:11:2c:01:44:b9:f0:61:21:59:
|
||||
8c:fb:13:47:31:41:ee:61:df:96:08:47:a8:52:b6:87:ae:c8:
|
||||
3a:f3:da:9d:7f:f5:c1:2a:7e:b2:3e:f4:30:39:7a:21:ea:07:
|
||||
0a:af:4d:c5:7f:7e:49:70:b8:ec:96:b3:13:64:28:cf:32:06:
|
||||
51:39:8f:7b:16:5c:33:65:4c:e0:af:04:72:2d:b7:f8:0c:99:
|
||||
8a:f8:61:91:0a:7f:19:a6:bf:95:51:a9:8c:e4:52:8f:43:2f:
|
||||
47:e9:06:b2:c0:7d:4b:c5:60:83:30:7b:ea:b4:87:a9:a1:34:
|
||||
d1:90:58:c0:57:8e:c1:d5:6a:b5:e4:b2:0b:73:06:9a:5b:26:
|
||||
4b:68:7d:da:e1:93:66:ee:cc:10:6c:94:85:05:88:fc:00:a1:
|
||||
63:48:e0:13:b5:f9:f0:71:43:21:3b:80:cc:ec:2f:96:d6:a3:
|
||||
58:24:e7:73:8b:ca:a2:c9:b2:23:a6:94:1b:9e:1d:b4:28:a2:
|
||||
43:ac:83:2b:c0:bd:e0:8c:3a:33:14:67:4d:d5:aa:9d:2f:f6:
|
||||
1b:c4:16:a7:35:21:6e:68:8b:7a:b1:66:30:fb:04:60:e8:82:
|
||||
9c:7c:f8:55:40:e5:f5:fa:34:c4:17:d7:d0:ab:8f:74:93:df:
|
||||
82:36:49:b2:d4:fc:a3:93:04:e7:6c:92:47:fe:0c:65:55:7f:
|
||||
b9:5d:2e:d8:69:57:2d:7a:a3:a1:84:43:5e:2e:3c:b6:7e:5e:
|
||||
04:fd:41:2f:25:56:be:7c:61:f3:af:39:a8:b6:01:ae:d5:3d:
|
||||
dd:56:ca:a9:2c:e7:87:90:48:94:a1:a7:6f:3a:26:56:6d:f0:
|
||||
e7:29:fe:49:7d:f7:d5:d3:85:26:15:dc:02:60:e9:4e:c9:64:
|
||||
9f:70:66:c1:fb:d8:66:7a:a1:ac:98:74:ad:f8:2c:4d:a2:50:
|
||||
74:3c:53:20:3c:1b:34:71:e3:d7:64:56:21:b8:11:12:a9:b1:
|
||||
4d:c1:b2:e2:45:5d:fe:92:94:bd:2a:7f:1e:35:c9:f1:5a:d1:
|
||||
7f:36:58:0c:93:a1:d0:76:d2:c7:55:36:b3:ef:01:5c:ba:37:
|
||||
27:ef:34:b9:b3:c8:62:ae:1f:d3:8c:cb:a4:31:69:38:6a:46:
|
||||
70:dd:46:bf:e5:fc:d2:5a:ec:36:7c:49:01:86:24:3e:a7:5d:
|
||||
87:46:ae:84:3a:3a:dd:88:1a:a4:3f:68:7b:e4:b3:e3:40:9e:
|
||||
82:3f:30:d3:3a:bb:56:fc:b1:43:8f:0e:87:b5:4c:1e:76:ae:
|
||||
f4:c5:b3:cf:34:64:b7:ce
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIID4zCCAcsCAxAAAjANBgkqhkiG9w0BAQQFADCBkjELMAkGA1UEBhMCVVMxFjAU
|
||||
BgNVBAgTDU1hc3NhY2h1c2V0dHMxEDAOBgNVBAoTB1hhbWFyaW4xFDASBgNVBAsT
|
||||
C0VuZ2luZWVyaW5nMRkwFwYDVQQDExBIYW1pbGxlci1UdWJlIENBMSgwJgYJKoZI
|
||||
hvcNAQkBFhltYXJ0aW4uYmF1bGlnQHhhbWFyaW4uY29tMB4XDTE0MTEyMjIyMTYy
|
||||
MloXDTI0MTExOTIyMTYyMlowXjELMAkGA1UEBhMCVVMxFjAUBgNVBAgTDU1hc3Nh
|
||||
Y2h1c2V0dHMxEDAOBgNVBAoTB1hhbWFyaW4xFDASBgNVBAsTC0VuZ2luZWVyaW5n
|
||||
MQ8wDQYDVQQDEwZNb25rZXkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALRg
|
||||
4P/KOGUGt2oRlzpTBhjHy9h4R3y0f7Cdrd0SUP86LiFbkU53eVKSaGH072+6OQq7
|
||||
+gR+2DnAh/2LylZ5aXi5WWUPnKaI8Zt7FReXckSOHu5i32IAQU2BkW7g68z7n2ci
|
||||
NUN5339FdBCuGzfOtSvsupf7L6mUj5c0w+TfzsZzAgMBAAEwDQYJKoZIhvcNAQEE
|
||||
BQADggIBAJbnBPGony6Tj/SEvnQyq4/s/esli4nTqPC6dhEsAUS58GEhWYz7E0cx
|
||||
Qe5h35YIR6hStoeuyDrz2p1/9cEqfrI+9DA5eiHqBwqvTcV/fklwuOyWsxNkKM8y
|
||||
BlE5j3sWXDNlTOCvBHItt/gMmYr4YZEKfxmmv5VRqYzkUo9DL0fpBrLAfUvFYIMw
|
||||
e+q0h6mhNNGQWMBXjsHVarXksgtzBppbJktofdrhk2buzBBslIUFiPwAoWNI4BO1
|
||||
+fBxQyE7gMzsL5bWo1gk53OLyqLJsiOmlBueHbQookOsgyvAveCMOjMUZ03Vqp0v
|
||||
9hvEFqc1IW5oi3qxZjD7BGDogpx8+FVA5fX6NMQX19Crj3ST34I2SbLU/KOTBOds
|
||||
kkf+DGVVf7ldLthpVy16o6GEQ14uPLZ+XgT9QS8lVr58YfOvOai2Aa7VPd1Wyqks
|
||||
54eQSJShp286JlZt8Ocp/kl999XThSYV3AJg6U7JZJ9wZsH72GZ6oayYdK34LE2i
|
||||
UHQ8UyA8GzRx49dkViG4ERKpsU3BsuJFXf6SlL0qfx41yfFa0X82WAyTodB20sdV
|
||||
NrPvAVy6NyfvNLmzyGKuH9OMy6QxaThqRnDdRr/l/NJa7DZ8SQGGJD6nXYdGroQ6
|
||||
Ot2IGqQ/aHvks+NAnoI/MNM6u1b8sUOPDoe1TB52rvTFs880ZLfO
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBALRg4P/KOGUGt2oR
|
||||
lzpTBhjHy9h4R3y0f7Cdrd0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7FReXckSOHu5i32IAQU2BkW7g68z7n2ciNUN5339FdBCu
|
||||
GzfOtSvsupf7L6mUj5c0w+TfzsZzAgMBAAECgYEAp8zkIzDVC66W2/anT5vCtTTQ
|
||||
vn0OS8WCcCQPhPQwI27VUTTk1TExzQ3kSxRX1gFQZVr/uETkE723BLiRr6Zc5WBy
|
||||
Xuv/nJShJRT1Y1+Y7b3ii5arroXlMzMX2YAqQLZPuuiV5Wsx0zSld6WzEOqxZ+rZ
|
||||
Q+iVRFjGkcxx4zkG0JECQQDifA500eGvwS8yrpB0XMzRcUe5G5NFBMIza79uMBz4
|
||||
fwHshiUYraL6d//fpJIZVj7opobCVMt4SX1/OXLVO72ZAkEAy+KiyRI1Ss6A8QFA
|
||||
P+zruxTdTtSRsUG0TqR5w5Tjra7/Fa0LWoi9fcbq8pr7mH9GyhGLcVwtB8QsOxhk
|
||||
0axz6wJBAIHlzRTLW7nF/x/+ZvOWVhK5+fz9B9ZKCGgdoEm+Zp9PmPbjaVtiG1u0
|
||||
f5jxdqn5gVNGT3wdziVLYSMa+/W4seECQF0y/oK3hhDqENsaXUpbfO6J/Rg551eF
|
||||
12xTly2mc+VDJ2u7LIN4GlbShTfdTMFK/QsFth5dql/wdt+UqRGHqX0CQQCWTLO6
|
||||
Eqpufsm/6/gtNvMs95oEXbz4fnsAL8/HQo6r17E3TmopXpgKcWhSCZ3kmsEfdOmu
|
||||
ooa9V/Gp1FZY5t50
|
||||
-----END PRIVATE KEY-----
|
|
@ -0,0 +1,77 @@
|
|||
Certificate:
|
||||
Data:
|
||||
Version: 1 (0x0)
|
||||
Serial Number: 1048578 (0x100002)
|
||||
Signature Algorithm: md5WithRSAEncryption
|
||||
Issuer: C=US, ST=Massachusetts, O=Xamarin, OU=Engineering, CN=Hamiller-Tube CA/emailAddress=martin.baulig@xamarin.com
|
||||
Validity
|
||||
Not Before: Nov 22 22:16:22 2014 GMT
|
||||
Not After : Nov 19 22:16:22 2024 GMT
|
||||
Subject: C=US, ST=Massachusetts, O=Xamarin, OU=Engineering, CN=Monkey
|
||||
Subject Public Key Info:
|
||||
Public Key Algorithm: rsaEncryption
|
||||
Public-Key: (1024 bit)
|
||||
Modulus:
|
||||
00:b4:60:e0:ff:ca:38:65:06:b7:6a:11:97:3a:53:
|
||||
06:18:c7:cb:d8:78:47:7c:b4:7f:b0:9d:ad:dd:12:
|
||||
50:ff:3a:2e:21:5b:91:4e:77:79:52:92:68:61:f4:
|
||||
ef:6f:ba:39:0a:bb:fa:04:7e:d8:39:c0:87:fd:8b:
|
||||
ca:56:79:69:78:b9:59:65:0f:9c:a6:88:f1:9b:7b:
|
||||
15:17:97:72:44:8e:1e:ee:62:df:62:00:41:4d:81:
|
||||
91:6e:e0:eb:cc:fb:9f:67:22:35:43:79:df:7f:45:
|
||||
74:10:ae:1b:37:ce:b5:2b:ec:ba:97:fb:2f:a9:94:
|
||||
8f:97:34:c3:e4:df:ce:c6:73
|
||||
Exponent: 65537 (0x10001)
|
||||
Signature Algorithm: md5WithRSAEncryption
|
||||
96:e7:04:f1:a8:9f:2e:93:8f:f4:84:be:74:32:ab:8f:ec:fd:
|
||||
eb:25:8b:89:d3:a8:f0:ba:76:11:2c:01:44:b9:f0:61:21:59:
|
||||
8c:fb:13:47:31:41:ee:61:df:96:08:47:a8:52:b6:87:ae:c8:
|
||||
3a:f3:da:9d:7f:f5:c1:2a:7e:b2:3e:f4:30:39:7a:21:ea:07:
|
||||
0a:af:4d:c5:7f:7e:49:70:b8:ec:96:b3:13:64:28:cf:32:06:
|
||||
51:39:8f:7b:16:5c:33:65:4c:e0:af:04:72:2d:b7:f8:0c:99:
|
||||
8a:f8:61:91:0a:7f:19:a6:bf:95:51:a9:8c:e4:52:8f:43:2f:
|
||||
47:e9:06:b2:c0:7d:4b:c5:60:83:30:7b:ea:b4:87:a9:a1:34:
|
||||
d1:90:58:c0:57:8e:c1:d5:6a:b5:e4:b2:0b:73:06:9a:5b:26:
|
||||
4b:68:7d:da:e1:93:66:ee:cc:10:6c:94:85:05:88:fc:00:a1:
|
||||
63:48:e0:13:b5:f9:f0:71:43:21:3b:80:cc:ec:2f:96:d6:a3:
|
||||
58:24:e7:73:8b:ca:a2:c9:b2:23:a6:94:1b:9e:1d:b4:28:a2:
|
||||
43:ac:83:2b:c0:bd:e0:8c:3a:33:14:67:4d:d5:aa:9d:2f:f6:
|
||||
1b:c4:16:a7:35:21:6e:68:8b:7a:b1:66:30:fb:04:60:e8:82:
|
||||
9c:7c:f8:55:40:e5:f5:fa:34:c4:17:d7:d0:ab:8f:74:93:df:
|
||||
82:36:49:b2:d4:fc:a3:93:04:e7:6c:92:47:fe:0c:65:55:7f:
|
||||
b9:5d:2e:d8:69:57:2d:7a:a3:a1:84:43:5e:2e:3c:b6:7e:5e:
|
||||
04:fd:41:2f:25:56:be:7c:61:f3:af:39:a8:b6:01:ae:d5:3d:
|
||||
dd:56:ca:a9:2c:e7:87:90:48:94:a1:a7:6f:3a:26:56:6d:f0:
|
||||
e7:29:fe:49:7d:f7:d5:d3:85:26:15:dc:02:60:e9:4e:c9:64:
|
||||
9f:70:66:c1:fb:d8:66:7a:a1:ac:98:74:ad:f8:2c:4d:a2:50:
|
||||
74:3c:53:20:3c:1b:34:71:e3:d7:64:56:21:b8:11:12:a9:b1:
|
||||
4d:c1:b2:e2:45:5d:fe:92:94:bd:2a:7f:1e:35:c9:f1:5a:d1:
|
||||
7f:36:58:0c:93:a1:d0:76:d2:c7:55:36:b3:ef:01:5c:ba:37:
|
||||
27:ef:34:b9:b3:c8:62:ae:1f:d3:8c:cb:a4:31:69:38:6a:46:
|
||||
70:dd:46:bf:e5:fc:d2:5a:ec:36:7c:49:01:86:24:3e:a7:5d:
|
||||
87:46:ae:84:3a:3a:dd:88:1a:a4:3f:68:7b:e4:b3:e3:40:9e:
|
||||
82:3f:30:d3:3a:bb:56:fc:b1:43:8f:0e:87:b5:4c:1e:76:ae:
|
||||
f4:c5:b3:cf:34:64:b7:ce
|
||||
-----BEGIN CERTIFICATE-----
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oi3qxZjD7BGDogpx8+FVA5fX6NMQX19Crj3ST34I2SbLU/KOTBOds
|
||||
kkf+DGVVf7ldLthpVy16o6GEQ14uPLZ+XgT9QS8lVr58YfOvOai2Aa7VPd1Wyqks
|
||||
54eQSJShp286JlZt8Ocp/kl999XThSYV3AJg6U7JZJ9wZsH72GZ6oayYdK34LE2i
|
||||
UHQ8UyA8GzRx49dkViG4ERKpsU3BsuJFXf6SlL0qfx41yfFa0X82WAyTodB20sdV
|
||||
NrPvAVy6NyfvNLmzyGKuH9OMy6QxaThqRnDdRr/l/NJa7DZ8SQGGJD6nXYdGroQ6
|
||||
Ot2IGqQ/aHvks+NAnoI/MNM6u1b8sUOPDoe1TB52rvTFs880ZLfO
|
||||
-----END CERTIFICATE-----
|
Двоичный файл не отображается.
|
@ -0,0 +1,12 @@
|
|||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIIByTCCATICAQAwgYgxCzAJBgNVBAYTAlVTMRYwFAYDVQQIEw1NYXNzYWNodXNl
|
||||
dHRzMRAwDgYDVQQKEwdYYW1hcmluMRQwEgYDVQQLEwtFbmdpbmVlcmluZzEPMA0G
|
||||
A1UEAxMGTW9ua2V5MSgwJgYJKoZIhvcNAQkBFhltYXJ0aW4uYmF1bGlnQHhhbWFy
|
||||
aW4uY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC0YOD/yjhlBrdqEZc6
|
||||
UwYYx8vYeEd8tH+wna3dElD/Oi4hW5FOd3lSkmhh9O9vujkKu/oEftg5wIf9i8pW
|
||||
eWl4uVllD5ymiPGbexUXl3JEjh7uYt9iAEFNgZFu4OvM+59nIjVDed9/RXQQrhs3
|
||||
zrUr7LqX+y+plI+XNMPk387GcwIDAQABoAAwDQYJKoZIhvcNAQEEBQADgYEAToaX
|
||||
98IA+oJPq9ECeoISaJfcZZJAFfi66vvyxgRUW7DH7R/2vwPGS/NBsEEXyISRo2Pz
|
||||
2EqVa+ne281V9TqK5pqHReX9zeggrNJSaCl6bwOBVZoR59Y3ix8fTlDPow2PoWke
|
||||
2cSBUIfsR/tyHVBx9y1YlL4U3Rv1WlD4wXowoPM=
|
||||
-----END CERTIFICATE REQUEST-----
|
|
@ -0,0 +1,48 @@
|
|||
dir = .
|
||||
|
||||
[ ca ]
|
||||
default_ca = CA_default
|
||||
|
||||
[ CA_default ]
|
||||
serial = $dir/serial
|
||||
database = $dir/certindex.txt
|
||||
new_certs_dir = $dir/certs
|
||||
certificate = $dir/cacert.pem
|
||||
private_key = $dir/private/cakey.pem
|
||||
default_days = 365
|
||||
default_md = md5
|
||||
preserve = no
|
||||
email_in_dn = no
|
||||
nameopt = default_ca
|
||||
certopt = default_ca
|
||||
policy = policy_match
|
||||
|
||||
[ policy_match ]
|
||||
countryName = match
|
||||
stateOrProvinceName = match
|
||||
organizationName = match
|
||||
organizationalUnitName = optional
|
||||
commonName = supplied
|
||||
emailAddress = optional
|
||||
|
||||
[ req ]
|
||||
default_bits = 1024 # Size of keys
|
||||
default_keyfile = key.pem # name of generated keys
|
||||
default_md = md5 # message digest algorithm
|
||||
string_mask = nombstr # permitted characters
|
||||
distinguished_name = req_distinguished_name
|
||||
# req_extensions = v3_req
|
||||
|
||||
[ req_distinguished_name ]
|
||||
countryName = US
|
||||
stateOrProvinceName = Massachusetts
|
||||
|
||||
0.organizationName = Xamarin
|
||||
organizationalUnitName = Engineering
|
||||
|
||||
commonName = Hamiller-Tube
|
||||
commonName_max = 64
|
||||
|
||||
emailAddress = martin.baulig@xamarin.com
|
||||
emailAddress_max = 40
|
||||
|
|
@ -0,0 +1 @@
|
|||
100003
|
|
@ -0,0 +1,164 @@
|
|||
Certificate:
|
||||
Data:
|
||||
Version: 1 (0x0)
|
||||
Serial Number: 1048577 (0x100001)
|
||||
Signature Algorithm: md5WithRSAEncryption
|
||||
Issuer: C=US, ST=Massachusetts, O=Xamarin, OU=Engineering, CN=Hamiller-Tube CA/emailAddress=martin.baulig@xamarin.com
|
||||
Validity
|
||||
Not Before: Nov 21 19:45:10 2014 GMT
|
||||
Not After : Nov 18 19:45:10 2024 GMT
|
||||
Subject: C=US, ST=Massachusetts, O=Xamarin, OU=Engineering, CN=Hamiller-Tube.local
|
||||
Subject Public Key Info:
|
||||
Public Key Algorithm: rsaEncryption
|
||||
Public-Key: (4096 bit)
|
||||
Modulus:
|
||||
00:bf:7b:2b:8b:ef:98:21:28:1e:2f:8b:3c:ca:f8:
|
||||
89:36:89:ef:3c:ee:cb:41:d0:e7:46:08:86:65:31:
|
||||
77:b9:18:61:36:00:c7:d2:92:cd:c6:c3:23:05:67:
|
||||
fc:f1:8d:40:a6:5b:45:c8:5f:d7:6f:2b:8f:4b:36:
|
||||
d7:4a:df:f6:f8:17:33:1d:ce:59:82:ec:dd:06:e9:
|
||||
82:42:e4:1f:f3:e3:15:60:bb:24:b3:09:e0:84:78:
|
||||
e1:31:35:87:bb:93:f0:a4:28:ef:e4:37:cf:ca:69:
|
||||
f5:74:9f:6d:25:fe:45:e2:23:c0:92:43:eb:b0:31:
|
||||
22:1a:92:4f:ba:72:70:69:e6:34:65:d8:9d:ed:76:
|
||||
08:3f:2e:8b:f8:ba:3b:bb:4d:26:81:b7:ec:79:1f:
|
||||
12:a7:dc:bb:fd:3c:71:d5:d5:e7:7e:48:02:a3:bb:
|
||||
66:66:d9:93:98:cd:6a:27:a4:b7:0c:f1:d9:02:44:
|
||||
26:9e:99:ac:51:6a:90:c4:b2:0a:bf:89:a2:d7:2f:
|
||||
49:b9:85:3c:47:99:22:a9:ff:ee:bb:c2:80:e6:17:
|
||||
09:19:ca:97:b2:6b:25:31:f2:54:52:e2:04:00:f9:
|
||||
84:8b:c7:3b:af:41:15:1a:23:8e:c0:81:8b:25:24:
|
||||
8c:63:4c:4f:9c:d6:fd:12:28:38:f8:91:77:9d:bb:
|
||||
55:8d:89:43:c0:51:92:87:4f:a3:79:62:e5:08:06:
|
||||
74:31:b4:26:6a:81:e6:db:05:d0:69:61:a0:f7:38:
|
||||
2c:9a:0d:a6:d9:c2:3c:ed:d7:69:c9:13:54:1d:6c:
|
||||
91:6d:81:b3:24:e2:0f:0b:12:81:ff:f8:e3:9f:63:
|
||||
b7:3a:5a:83:18:b9:ec:05:9f:a1:31:23:82:0a:ef:
|
||||
c2:a4:d0:7f:36:4b:58:9c:43:e9:a5:b7:ea:f2:2a:
|
||||
de:29:03:34:64:86:0e:81:60:b4:93:42:16:3c:fb:
|
||||
8e:d6:5e:b4:84:87:68:2b:2f:58:13:40:d6:81:ff:
|
||||
84:7d:60:f1:b5:eb:aa:fc:73:48:93:8e:be:74:a2:
|
||||
da:ff:94:18:d7:41:06:25:56:37:a5:f6:5b:24:c4:
|
||||
c3:e0:f9:b6:b8:8a:28:77:ee:e7:a3:80:97:85:12:
|
||||
9e:f5:1b:99:83:2e:ca:a9:bc:68:fa:30:0c:d7:0e:
|
||||
f8:f1:2f:68:cb:38:a1:72:73:40:b5:e6:4e:f8:eb:
|
||||
02:3f:dd:3c:d7:e9:8d:48:51:d5:0b:81:a6:1e:9e:
|
||||
ac:3a:be:52:aa:f7:5b:75:be:fe:92:90:22:0a:02:
|
||||
ae:45:ea:05:07:d2:84:af:a5:46:bb:35:3d:1c:81:
|
||||
de:a3:1c:3d:ea:1e:ee:ae:49:df:86:dd:cc:53:56:
|
||||
21:22:67
|
||||
Exponent: 65537 (0x10001)
|
||||
Signature Algorithm: md5WithRSAEncryption
|
||||
6d:dd:34:c6:9a:2a:e5:d0:d2:c2:11:91:16:e2:da:90:46:45:
|
||||
78:f8:7e:83:4f:58:87:66:86:11:49:3e:87:1f:d8:57:9e:84:
|
||||
7f:1c:b3:37:ca:8d:93:ef:75:29:6c:db:51:ad:bd:77:e9:77:
|
||||
a7:5a:70:f9:a3:fd:8a:2f:3a:a6:e0:99:64:eb:10:81:74:bf:
|
||||
f2:a4:38:fe:72:93:61:e6:7b:b3:14:af:e7:a2:56:09:51:af:
|
||||
0e:5c:7b:51:70:67:dd:6e:6e:cb:a4:bf:fe:5c:0c:41:6e:14:
|
||||
a1:ff:a4:56:79:a2:37:82:88:bf:66:53:59:d0:6a:9a:94:74:
|
||||
d9:0b:5b:9b:83:7e:49:46:f4:03:6c:3f:50:db:a1:84:8d:d8:
|
||||
79:d4:bf:33:aa:43:bf:e7:c0:4b:48:47:a5:20:fb:64:f5:77:
|
||||
34:1e:cd:85:8e:48:6b:5f:68:e5:91:8c:07:d4:db:ee:86:70:
|
||||
d3:59:2a:86:79:48:f4:2a:f5:41:92:c9:cd:05:65:16:61:45:
|
||||
01:9f:bb:45:aa:0b:84:4c:0f:df:05:b0:7a:88:a4:ee:3a:a9:
|
||||
a4:e2:68:ed:58:39:3f:80:e9:8a:b1:d1:98:ed:74:6b:46:5f:
|
||||
fa:a6:d0:94:f9:a3:f5:c7:dd:4c:77:30:e8:e8:be:da:7d:aa:
|
||||
f0:2e:89:a4:54:ce:0a:d0:a4:be:6e:45:34:04:4c:0d:21:e4:
|
||||
06:a1:b1:7a:24:2b:9c:6d:8d:74:57:77:43:c1:2b:73:d3:14:
|
||||
20:53:a4:ff:d5:15:1b:27:93:a9:a9:10:e6:3e:01:94:1c:f4:
|
||||
3b:0c:ae:c5:0c:4c:5d:4f:84:26:fa:e2:b8:e9:d2:b0:05:71:
|
||||
99:53:4c:ae:2f:f0:df:35:53:e3:d4:04:10:ee:6d:66:7a:15:
|
||||
8c:8e:81:2a:0d:74:b6:fc:93:82:13:0d:ff:71:21:44:4d:e2:
|
||||
86:4b:26:37:7e:04:15:55:f0:33:92:bd:7d:29:ae:db:b9:07:
|
||||
96:aa:a1:ec:2b:e0:cb:9a:0c:dd:bf:b2:ac:66:99:ec:d0:29:
|
||||
77:80:f8:63:32:3c:2f:0b:1f:04:19:e6:c9:df:d0:b9:23:be:
|
||||
e8:dd:98:3a:5b:21:55:0c:8a:a6:e5:3b:46:3c:bb:d3:92:4e:
|
||||
4c:86:b2:31:5e:a0:ae:fc:2f:3a:32:39:f7:26:69:5b:16:45:
|
||||
90:33:2f:12:f5:4a:6a:22:35:95:1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OjI59yZpWxZFkDMvEvVK
|
||||
aiI1lR8lAIqHBTkTrGDXGVfa5qz6GMOyg+KhtjeChl2nfRvD0iX90uvZnXR2t/zd
|
||||
dveNlaLFRhw=
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQC/eyuL75ghKB4v
|
||||
izzK+Ik2ie887stB0OdGCIZlMXe5GGE2AMfSks3GwyMFZ/zxjUCmW0XIX9dvK49L
|
||||
NtdK3/b4FzMdzlmC7N0G6YJC5B/z4xVguySzCeCEeOExNYe7k/CkKO/kN8/KafV0
|
||||
n20l/kXiI8CSQ+uwMSIakk+6cnBp5jRl2J3tdgg/Lov4uju7TSaBt+x5HxKn3Lv9
|
||||
PHHV1ed+SAKju2Zm2ZOYzWonpLcM8dkCRCaemaxRapDEsgq/iaLXL0m5hTxHmSKp
|
||||
/+67woDmFwkZypeyayUx8lRS4gQA+YSLxzuvQRUaI47AgYslJIxjTE+c1v0SKDj4
|
||||
kXedu1WNiUPAUZKHT6N5YuUIBnQxtCZqgebbBdBpYaD3OCyaDabZwjzt12nJE1Qd
|
||||
bJFtgbMk4g8LEoH/+OOfY7c6WoMYuewFn6ExI4IK78Kk0H82S1icQ+mlt+ryKt4p
|
||||
AzRkhg6BYLSTQhY8+47WXrSEh2grL1gTQNaB/4R9YPG166r8c0iTjr50otr/lBjX
|
||||
QQYlVjel9lskxMPg+ba4iih37uejgJeFEp71G5mDLsqpvGj6MAzXDvjxL2jLOKFy
|
||||
c0C15k746wI/3TzX6Y1IUdULgaYenqw6vlKq91t1vv6SkCIKAq5F6gUH0oSvpUa7
|
||||
NT0cgd6jHD3qHu6uSd+G3cxTViEiZwIDAQABAoICADHq7T5M1s8GA2CHnvCW/EZg
|
||||
jSLIaeqdiD1Eqaylyb1SMr1+VJl7tfN0GaQmKNXb6he0Qavr+GC97VxBTrzxSBQD
|
||||
EEtb6Q/tqe1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xkl/V7Gj/FGFJh3xvavVR1Z
|
||||
n9MCggEBAMjgqwOzbuYsJlraWvGfAg8/VAx0sjuASEtMSdbVtSxKhHQ78fjOz+xv
|
||||
QV75tQLjrQHRBgiPjXBwVy3TfMZR06z74FgLiC5an78g9/ly++Sd3o5xSgN4VVlc
|
||||
ts/TteBB7qiLjpIlqrQxKzKcQu4+y8Cm/P6ZMY7/ZoDGzZOMrPCd8J5qzv7GFy1J
|
||||
bo9xcgkbIAPR9pBvKgxZLvrTObb2N7nALcRrTXp+JfqwkYxDh2CUBAgDhDEomRU7
|
||||
qbLWU+0UojtQJ7v/u7nkX9YRGvQuVPv9R8J6HR7tAbCwF6qjiCOPyF78XgHon4f6
|
||||
tN5QWqJ2zRbQWOJR1d6/Ofo+24pbeP8=
|
||||
-----END PRIVATE KEY-----
|
|
@ -0,0 +1,15 @@
|
|||
[req]
|
||||
prompt = no
|
||||
string_mask = nombstr # make sure this matches the value in openssl.conf
|
||||
distinguished_name = server_name
|
||||
|
||||
[server_name]
|
||||
commonName = Hamiller-Tube.local
|
||||
countryName = US
|
||||
stateOrProvinceName = Massachusetts
|
||||
organizationName = Xamarin
|
||||
organizationalUnitName = Engineering
|
||||
emailAddress = martin.baulig@xamarin.com
|
||||
|
||||
[server_exts]
|
||||
extendedKeyUsage = 1.3.6.1.5.5.7.3.1
|
|
@ -0,0 +1,52 @@
|
|||
-----BEGIN PRIVATE KEY-----
|
||||
MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQC/eyuL75ghKB4v
|
||||
izzK+Ik2ie887stB0OdGCIZlMXe5GGE2AMfSks3GwyMFZ/zxjUCmW0XIX9dvK49L
|
||||
NtdK3/b4FzMdzlmC7N0G6YJC5B/z4xVguySzCeCEeOExNYe7k/CkKO/kN8/KafV0
|
||||
n20l/kXiI8CSQ+uwMSIakk+6cnBp5jRl2J3tdgg/Lov4uju7TSaBt+x5HxKn3Lv9
|
||||
PHHV1ed+SAKju2Zm2ZOY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@@
|
|||
Certificate:
|
||||
Data:
|
||||
Version: 1 (0x0)
|
||||
Serial Number: 1048577 (0x100001)
|
||||
Signature Algorithm: md5WithRSAEncryption
|
||||
Issuer: C=US, ST=Massachusetts, O=Xamarin, OU=Engineering, CN=Hamiller-Tube CA/emailAddress=martin.baulig@xamarin.com
|
||||
Validity
|
||||
Not Before: Nov 21 19:45:10 2014 GMT
|
||||
Not After : Nov 18 19:45:10 2024 GMT
|
||||
Subject: C=US, ST=Massachusetts, O=Xamarin, OU=Engineering, CN=Hamiller-Tube.local
|
||||
Subject Public Key Info:
|
||||
Public Key Algorithm: rsaEncryption
|
||||
Public-Key: (4096 bit)
|
||||
Modulus:
|
||||
00:bf:7b:2b:8b:ef:98:21:28:1e:2f:8b:3c:ca:f8:
|
||||
89:36:89:ef:3c:ee:cb:41:d0:e7:46:08:86:65:31:
|
||||
77:b9:18:61:36:00:c7:d2:92:cd:c6:c3:23:05:67:
|
||||
fc:f1:8d:40:a6:5b:45:c8:5f:d7:6f:2b:8f:4b:36:
|
||||
d7:4a:df:f6:f8:17:33:1d:ce:59:82:ec:dd:06:e9:
|
||||
82:42:e4:1f:f3:e3:15:60:bb:24:b3:09:e0:84:78:
|
||||
e1:31:35:87:bb:93:f0:a4:28:ef:e4:37:cf:ca:69:
|
||||
f5:74:9f:6d:25:fe:45:e2:23:c0:92:43:eb:b0:31:
|
||||
22:1a:92:4f:ba:72:70:69:e6:34:65:d8:9d:ed:76:
|
||||
08:3f:2e:8b:f8:ba:3b:bb:4d:26:81:b7:ec:79:1f:
|
||||
12:a7:dc:bb:fd:3c:71:d5:d5:e7:7e:48:02:a3:bb:
|
||||
66:66:d9:93:98:cd:6a:27:a4:b7:0c:f1:d9:02:44:
|
||||
26:9e:99:ac:51:6a:90:c4:b2:0a:bf:89:a2:d7:2f:
|
||||
49:b9:85:3c:47:99:22:a9:ff:ee:bb:c2:80:e6:17:
|
||||
09:19:ca:97:b2:6b:25:31:f2:54:52:e2:04:00:f9:
|
||||
84:8b:c7:3b:af:41:15:1a:23:8e:c0:81:8b:25:24:
|
||||
8c:63:4c:4f:9c:d6:fd:12:28:38:f8:91:77:9d:bb:
|
||||
55:8d:89:43:c0:51:92:87:4f:a3:79:62:e5:08:06:
|
||||
74:31:b4:26:6a:81:e6:db:05:d0:69:61:a0:f7:38:
|
||||
2c:9a:0d:a6:d9:c2:3c:ed:d7:69:c9:13:54:1d:6c:
|
||||
91:6d:81:b3:24:e2:0f:0b:12:81:ff:f8:e3:9f:63:
|
||||
b7:3a:5a:83:18:b9:ec:05:9f:a1:31:23:82:0a:ef:
|
||||
c2:a4:d0:7f:36:4b:58:9c:43:e9:a5:b7:ea:f2:2a:
|
||||
de:29:03:34:64:86:0e:81:60:b4:93:42:16:3c:fb:
|
||||
8e:d6:5e:b4:84:87:68:2b:2f:58:13:40:d6:81:ff:
|
||||
84:7d:60:f1:b5:eb:aa:fc:73:48:93:8e:be:74:a2:
|
||||
da:ff:94:18:d7:41:06:25:56:37:a5:f6:5b:24:c4:
|
||||
c3:e0:f9:b6:b8:8a:28:77:ee:e7:a3:80:97:85:12:
|
||||
9e:f5:1b:99:83:2e:ca:a9:bc:68:fa:30:0c:d7:0e:
|
||||
f8:f1:2f:68:cb:38:a1:72:73:40:b5:e6:4e:f8:eb:
|
||||
02:3f:dd:3c:d7:e9:8d:48:51:d5:0b:81:a6:1e:9e:
|
||||
ac:3a:be:52:aa:f7:5b:75:be:fe:92:90:22:0a:02:
|
||||
ae:45:ea:05:07:d2:84:af:a5:46:bb:35:3d:1c:81:
|
||||
de:a3:1c:3d:ea:1e:ee:ae:49:df:86:dd:cc:53:56:
|
||||
21:22:67
|
||||
Exponent: 65537 (0x10001)
|
||||
Signature Algorithm: md5WithRSAEncryption
|
||||
6d:dd:34:c6:9a:2a:e5:d0:d2:c2:11:91:16:e2:da:90:46:45:
|
||||
78:f8:7e:83:4f:58:87:66:86:11:49:3e:87:1f:d8:57:9e:84:
|
||||
7f:1c:b3:37:ca:8d:93:ef:75:29:6c:db:51:ad:bd:77:e9:77:
|
||||
a7:5a:70:f9:a3:fd:8a:2f:3a:a6:e0:99:64:eb:10:81:74:bf:
|
||||
f2:a4:38:fe:72:93:61:e6:7b:b3:14:af:e7:a2:56:09:51:af:
|
||||
0e:5c:7b:51:70:67:dd:6e:6e:cb:a4:bf:fe:5c:0c:41:6e:14:
|
||||
a1:ff:a4:56:79:a2:37:82:88:bf:66:53:59:d0:6a:9a:94:74:
|
||||
d9:0b:5b:9b:83:7e:49:46:f4:03:6c:3f:50:db:a1:84:8d:d8:
|
||||
79:d4:bf:33:aa:43:bf:e7:c0:4b:48:47:a5:20:fb:64:f5:77:
|
||||
34:1e:cd:85:8e:48:6b:5f:68:e5:91:8c:07:d4:db:ee:86:70:
|
||||
d3:59:2a:86:79:48:f4:2a:f5:41:92:c9:cd:05:65:16:61:45:
|
||||
01:9f:bb:45:aa:0b:84:4c:0f:df:05:b0:7a:88:a4:ee:3a:a9:
|
||||
a4:e2:68:ed:58:39:3f:80:e9:8a:b1:d1:98:ed:74:6b:46:5f:
|
||||
fa:a6:d0:94:f9:a3:f5:c7:dd:4c:77:30:e8:e8:be:da:7d:aa:
|
||||
f0:2e:89:a4:54:ce:0a:d0:a4:be:6e:45:34:04:4c:0d:21:e4:
|
||||
06:a1:b1:7a:24:2b:9c:6d:8d:74:57:77:43:c1:2b:73:d3:14:
|
||||
20:53:a4:ff:d5:15:1b:27:93:a9:a9:10:e6:3e:01:94:1c:f4:
|
||||
3b:0c:ae:c5:0c:4c:5d:4f:84:26:fa:e2:b8:e9:d2:b0:05:71:
|
||||
99:53:4c:ae:2f:f0:df:35:53:e3:d4:04:10:ee:6d:66:7a:15:
|
||||
8c:8e:81:2a:0d:74:b6:fc:93:82:13:0d:ff:71:21:44:4d:e2:
|
||||
86:4b:26:37:7e:04:15:55:f0:33:92:bd:7d:29:ae:db:b9:07:
|
||||
96:aa:a1:ec:2b:e0:cb:9a:0c:dd:bf:b2:ac:66:99:ec:d0:29:
|
||||
77:80:f8:63:32:3c:2f:0b:1f:04:19:e6:c9:df:d0:b9:23:be:
|
||||
e8:dd:98:3a:5b:21:55:0c:8a:a6:e5:3b:46:3c:bb:d3:92:4e:
|
||||
4c:86:b2:31:5e:a0:ae:fc:2f:3a:32:39:f7:26:69:5b:16:45:
|
||||
90:33:2f:12:f5:4a:6a:22:35:95:1f:25:00:8a:87:05:39:13:
|
||||
ac:60:d7:19:57:da:e6:ac:fa:18:c3:b2:83:e2:a1:b6:37:82:
|
||||
86:5d:a7:7d:1b:c3:d2:25:fd:d2:eb:d9:9d:74:76:b7:fc:dd:
|
||||
76:f7:8d:95:a2:c5:46:1c
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIFdDCCA1wCAxAAATANBgkqhkiG9w0BAQQFADCBkjELMAkGA1UEBhMCVVMxFjAU
|
||||
BgNVBAgTDU1hc3NhY2h1c2V0dHMxEDAOBgNVBAoTB1hhbWFyaW4xFDASBgNVBAsT
|
||||
C0VuZ2luZWVyaW5nMRkwFwYDVQQDExBIYW1pbGxlci1UdWJlIENBMSgwJgYJKoZI
|
||||
hvcNAQkBFhltYXJ0aW4uYmF1bGlnQHhhbWFyaW4uY29tMB4XDTE0MTEyMTE5NDUx
|
||||
MFoXDTI0MTExODE5NDUxMFowazELMAkGA1UEBhMCVVMxFjAUBgNVBAgTDU1hc3Nh
|
||||
Y2h1c2V0dHMxEDAOBgNVBAoTB1hhbWFyaW4xFDASBgNVBAsTC0VuZ2luZWVyaW5n
|
||||
MRwwGgYDVQQDExNIYW1pbGxlci1UdWJlLmxvY2FsMIICIjANBgkqhkiG9w0BAQEF
|
||||
AAOCAg8AMIICCgKCAgEAv3sri++YISgeL4s8yviJNonvPO7LQdDnRgiGZTF3uRhh
|
||||
NgDH0pLNxsMjBWf88Y1ApltFyF/XbyuPSzbXSt/2+BczHc5ZguzdBumCQuQf8+MV
|
||||
YLskswnghHjhMTWHu5PwpCjv5DfPymn1dJ9tJf5F4iPAkkPrsDEiGpJ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0OwyuxQxM
|
||||
XU+EJvriuOnSsAVxmVNMri/w3zVT49QEEO5tZnoVjI6BKg10tvyTghMN/3EhRE3i
|
||||
hksmN34EFVXwM5K9fSmu27kHlqqh7Cvgy5oM3b+yrGaZ7NApd4D4YzI8LwsfBBnm
|
||||
yd/QuSO+6N2YOlshVQyKpuU7Rjy705JOTIayMV6grvwvOjI59yZpWxZFkDMvEvVK
|
||||
aiI1lR8lAIqHBTkTrGDXGVfa5qz6GMOyg+KhtjeChl2nfRvD0iX90uvZnXR2t/zd
|
||||
dveNlaLFRhw=
|
||||
-----END CERTIFICATE-----
|
Двоичный файл не отображается.
|
@ -0,0 +1,28 @@
|
|||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIIE2zCCAsMCAQAwgZUxHDAaBgNVBAMTE0hhbWlsbGVyLVR1YmUubG9jYWwxCzAJ
|
||||
BgNVBAYTAlVTMRYwFAYDVQQIEw1NYXNzYWNodXNldHRzMRAwDgYDVQQKEwdYYW1h
|
||||
cmluMRQwEgYDVQQLEwtFbmdpbmVlcmluZzEoMCYGCSqGSIb3DQEJARYZbWFydGlu
|
||||
LmJhdWxpZ0B4YW1hcmluLmNvbTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoC
|
||||
ggIBAL97K4vvmCEoHi+LPMr4iTaJ7zzuy0HQ50YIhmUxd7kYYTYAx9KSzcbDIwVn
|
||||
/PGNQKZbRchf128rj0s210rf9vgXMx3OWYLs3QbpgkLkH/PjFWC7JLMJ4IR44TE1
|
||||
h7uT8KQo7+Q3z8pp9XSfbSX+ReIjwJJD67AxIhqST7pycGnmNGXYne12CD8ui/i6
|
||||
O7tNJoG37HkfEqfcu/08cdXV535IAqO7ZmbZk5jNaiektwzx2QJEJp6ZrFFqkMSy
|
||||
Cr+JotcvSbmFPEeZIqn/7rvCgOYXCRnKl7JrJTHyVFLiBAD5hIvHO69BFRojjsCB
|
||||
iyUkjGNMT5zW/RIoOPiRd527VY2JQ8BRkodPo3li5QgG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||||
8e+20ZTQGfk12IseRhnOUh6mUVBhDwsb5hjC2wXxmMIwNzaAd5j6FLgD7buChRms
|
||||
GoECggEAKUSsFSwhNQ3y/D8lbLNP4Tif+iqTWWa6wL5G0//1xNUg4Vce0NBEgccU
|
||||
OZnfc1oB8suJ5NNLL2kqeuNFzSPOcGTi0p/zJZXwii3mwr9bpfHY5jZolUSEQK0Z
|
||||
oWLnMFato9iC45eKAI/uD0a8T40wmI4W+n46lHjdpucTu92zveuzmX2GIWGvcgvN
|
||||
vNX0B6ZW3s5Lz3N68g+d1G5jA++q/M9GTn8C/hoOrT80lncwluWJkt0DgvPS+RXA
|
||||
nhqEVnKMooOFLXhHPC9d908Pb783xZMVxPoKoks/YVRgIqtSqR6JjrjHK8XFpXPi
|
||||
LQJhkjD58nHK3Ziork+2sovKotoIdg==
|
||||
-----END PRIVATE KEY-----
|
|
@ -0,0 +1,52 @@
|
|||
-----BEGIN PRIVATE KEY-----
|
||||
MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQCtrQ0ciSmj5eyt
|
||||
guwOidEekISCFIwpHH+lunUZehWy9sy9IOhSgvpXS7qNyiXJIDqoZxjW+SG2tMN2
|
||||
JYIEFesJzRyr5rZkPPro/oKQyuH8WIQB0/G/pYi/4NSaQa9ELGz72p6A36PfFvld
|
||||
ZDkylIIT2rowPJ0RA817tcawjIpO+V9i/+gdUcyGAQRejumw2yNdyGgiz5X3WPqQ
|
||||
baP3exQjLHXCYENb3p/HxDg85VnZIK5VjpLPuM70VhC3mwSp4ytE922HhrDcWl+U
|
||||
TejAUtqmq5UMQLF6CzRVkRWdSJMVbLEt4o2rw+r8KZ3NEHziR71Twvj2pyT5paUu
|
||||
tc28LTyUhXV64kJTZFx/CIKGxzGGQjlo6l1uECp9h2GdfH+eB+WnsWoBZFPttrv4
|
||||
PrkMw81XHMo1EuqOmeCdwPuSnRqWrC3HrHd2XS6sXEPjgkG/F4WyyFSdRqsYKb2o
|
||||
Jjj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RDM97Zrx659siZSPC6
|
||||
s7bj3y+8xq/zGcdBK/LxNUg06FoR3S6fip48mEgkn18q+ODWgKY3UlzcVedSkWMj
|
||||
DKmAmoNQTaXiL1RhsmCvsywRWkF64L3HW3bwegCKr0Gj6WpdiQzUHa6OMbfxTO5f
|
||||
BJGAO/4p2rukFKOdh12xunzm6lsAv/SZ35tymNaery9W/7gPW7mJJMBfeeUI4oft
|
||||
+FlFeMVKBeDbgGYifDFsGJAQ8nzFv9Ly/LRr/ZRrSY3EE60C5OmrPDpUaHSJoYIl
|
||||
8e+20ZTQGfk12IseRhnOUh6mUVBhDwsb5hjC2wXxmMIwNzaAd5j6FLgD7buChRms
|
||||
GoECggEAKUSsFSwhNQ3y/D8lbLNP4Tif+iqTWWa6wL5G0//1xNUg4Vce0NBEgccU
|
||||
OZnfc1oB8suJ5NNLL2kqeuNFzSPOcGTi0p/zJZXwii3mwr9bpfHY5jZolUSEQK0Z
|
||||
oWLnMFato9iC45eKAI/uD0a8T40wmI4W+n46lHjdpucTu92zveuzmX2GIWGvcgvN
|
||||
vNX0B6ZW3s5Lz3N68g+d1G5jA++q/M9GTn8C/hoOrT80lncwluWJkt0DgvPS+RXA
|
||||
nhqEVnKMooOFLXhHPC9d908Pb783xZMVxPoKoks/YVRgIqtSqR6JjrjHK8XFpXPi
|
||||
LQJhkjD58nHK3Ziork+2sovKotoIdg==
|
||||
-----END PRIVATE KEY-----
|
|
@ -0,0 +1,33 @@
|
|||
-----BEGIN CERTIFICATE-----
|
||||
MIIFxjCCA66gAwIBAgIJALHWiMHCE4XHMA0GCSqGSIb3DQEBBQUAMIGVMRwwGgYD
|
||||
VQQDExNIYW1pbGxlci1UdWJlLmxvY2FsMQswCQYDVQQGEwJVUzEWMBQGA1UECBMN
|
||||
TWFzc2FjaHVzZXR0czEQMA4GA1UEChMHWGFtYXJpbjEUMBIGA1UECxMLRW5naW5l
|
||||
ZXJpbmcxKDAmBgkqhkiG9w0BCQEWGW1hcnRpbi5iYXVsa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|
||||
dQiECRWxejkCAwEAAaMXMBUwEwYDVR0lBAwwCgYIKwYBBQUHAwEwDQYJKoZIhvcN
|
||||
AQEFBQADggIBAF4tgUuFA+aumxOzMbHRvdUqX7KbeM9Vlw2aQHtyOjPlIIfv3cZs
|
||||
GUA52A93Rh+P2tdcywnsulM2aJA4YR0rBiwyRTKfAQu/Gc8XEMLbf/mq3s4I4b6K
|
||||
Y8YrYYoHOqbzBX6aE3qiIbykedUDMmIjdpWHXcg8Tt1IcFw8u6CyndG/kqDdAe+Z
|
||||
Q3UTdK86WVxWRP1keRX51DpIpto0yuiyLEgMdMbslyiUGt5kVr0g3eO80CFi47Ld
|
||||
MqV8SaClm6ZrXoiScRAV6IvRvSrlNi1mnXzzZorEeVsDCwXG8+LdMx78BV8Oe9bK
|
||||
9p5SIgEduLPU5dRCXMAgRFQNwRquaY6RLMtOpMVzP8XAFYAPvCGFzDlZ1pwPvK+t
|
||||
tGDrQjAd7JS/PuM0hhhwVnwL8g7fsnSr5JQktzMA0jOXCeuWfQylHDGo8Rh3Zua9
|
||||
X5d6p2OG4tX8YuTRj+050fAQpO7ZF6IXqqudsUsGBF97dd9YrkPDu7+Zu6WCcLYu
|
||||
AxQMillEwS/Fwi7PY7DyBUNameidyZut53NPNmqQoPBpvSfdHZ/SoRsVDvWqY6gc
|
||||
Tbpok2j5rpR5X0BYZHY8lPu/BIsQ3JQBfCnWjX+VoGT6mUSYvBX2LKXf2da5j8PW
|
||||
hMRXBUxYbiur6g6VU7GleYsY97a9mgdykxKW0uWzaHQisT3gWz/gZaj6
|
||||
-----END CERTIFICATE-----
|
Двоичный файл не отображается.
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProjectGuid>{CB32438C-F7AD-411C-86E0-E1F3DA1B98ED}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>ConsoleTest</RootNamespace>
|
||||
<AssemblyName>ConsoleTest</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\bin\Debug</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Externalconsole>true</Externalconsole>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Mono.Security" />
|
||||
<Reference Include="Mono.Security.Providers" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleTest", "ConsoleTest.csproj", "{CB32438C-F7AD-411C-86E0-E1F3DA1B98ED}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{CB32438C-F7AD-411C-86E0-E1F3DA1B98ED}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{CB32438C-F7AD-411C-86E0-E1F3DA1B98ED}.Debug|x86.Build.0 = Debug|x86
|
||||
{CB32438C-F7AD-411C-86E0-E1F3DA1B98ED}.Release|x86.ActiveCfg = Release|x86
|
||||
{CB32438C-F7AD-411C-86E0-E1F3DA1B98ED}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,98 @@
|
|||
//
|
||||
// Program.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <martin.baulig@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2015 Xamarin, Inc.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Security;
|
||||
using System.Net.Sockets;
|
||||
using System.Security.Authentication;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using Mono.Security.Interface;
|
||||
using Mono.Security.Providers;
|
||||
|
||||
namespace ConsoleTest
|
||||
{
|
||||
class MainClass
|
||||
{
|
||||
public static void Main (string[] args)
|
||||
{
|
||||
// TestSSL ("https://www.xamarin.com/");
|
||||
var dotnetprovider = new DotNetTlsProvider ();
|
||||
MonoTlsProviderFactory.InstallProvider (dotnetprovider);
|
||||
var endpoint = new IPEndPoint (IPAddress.Loopback, 4433);
|
||||
Run ("localhost", endpoint);
|
||||
}
|
||||
|
||||
static void TestSSL (string address)
|
||||
{
|
||||
var request = (HttpWebRequest)WebRequest.Create(address);
|
||||
var response = (HttpWebResponse)request.GetResponse();
|
||||
Console.WriteLine("RESPONSE: {0} {1}", response.StatusCode, response.StatusDescription);
|
||||
}
|
||||
|
||||
static bool CertificateValidationCallback (object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
|
||||
{
|
||||
Console.WriteLine ("CERT VALIDATION ({0}): {1}", sslPolicyErrors, certificate.Subject);
|
||||
return true;
|
||||
}
|
||||
|
||||
static X509Certificate CertificateSelectionCallback (
|
||||
object sender, string targetHost, X509CertificateCollection localCertificates, X509Certificate remoteCertificate,
|
||||
string[] acceptableIssuers)
|
||||
{
|
||||
Console.WriteLine ("CERT SELECTION: {0}", targetHost);
|
||||
return null;
|
||||
}
|
||||
|
||||
static void Run (string targetHost, IPEndPoint endpoint)
|
||||
{
|
||||
var socket = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
||||
socket.Connect (endpoint);
|
||||
|
||||
var stream = new NetworkStream (socket, true);
|
||||
Console.WriteLine (stream);
|
||||
|
||||
var provider = MonoTlsProviderFactory.GetProvider ();
|
||||
var tls = provider.CreateSslStream (stream, false, CertificateValidationCallback, CertificateSelectionCallback);
|
||||
|
||||
tls.AuthenticateAsClient (targetHost, null, SslProtocols.Tls, false);
|
||||
Console.WriteLine (tls);
|
||||
|
||||
var reader = new StreamReader (tls.AuthenticatedStream);
|
||||
var hello = reader.ReadLine ();
|
||||
Console.WriteLine (hello);
|
||||
|
||||
while (true) {
|
||||
var line = reader.ReadLine ();
|
||||
Console.WriteLine (line);
|
||||
}
|
||||
|
||||
var contents = reader.ReadToEnd ();
|
||||
Console.WriteLine (contents);
|
||||
Console.WriteLine ("DONE!");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
//
|
||||
// AssemblyInfo.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <martin.baulig@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2015 Xamarin, Inc.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
// Information about this assembly is defined by the following attributes.
|
||||
// Change them to the values specific to your project.
|
||||
|
||||
[assembly: AssemblyTitle ("ConsoleTest")]
|
||||
[assembly: AssemblyDescription ("")]
|
||||
[assembly: AssemblyConfiguration ("")]
|
||||
[assembly: AssemblyCompany ("Xamarin")]
|
||||
[assembly: AssemblyProduct ("")]
|
||||
[assembly: AssemblyCopyright ("Xamarin, Inc.")]
|
||||
[assembly: AssemblyTrademark ("")]
|
||||
[assembly: AssemblyCulture ("")]
|
||||
|
||||
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
|
||||
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
|
||||
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
|
||||
|
||||
[assembly: AssemblyVersion ("1.0.*")]
|
||||
|
||||
// The following attributes are used to specify the signing key for the assembly,
|
||||
// if desired. See the Mono documentation for more information about signing.
|
||||
|
||||
//[assembly: AssemblyDelaySign(false)]
|
||||
//[assembly: AssemblyKeyFile("")]
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DroidTest", "DroidTest\DroidTest.csproj", "{81C62B00-39CC-4CF5-8978-2A44B1EF87E4}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{81C62B00-39CC-4CF5-8978-2A44B1EF87E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{81C62B00-39CC-4CF5-8978-2A44B1EF87E4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{81C62B00-39CC-4CF5-8978-2A44B1EF87E4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{81C62B00-39CC-4CF5-8978-2A44B1EF87E4}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,19 @@
|
|||
Any raw assets you want to be deployed with your application can be placed in
|
||||
this directory (and child directories) and given a Build Action of "AndroidAsset".
|
||||
|
||||
These files will be deployed with your package and will be accessible using Android's
|
||||
AssetManager, like this:
|
||||
|
||||
public class ReadAsset : Activity
|
||||
{
|
||||
protected override void OnCreate (Bundle bundle)
|
||||
{
|
||||
base.OnCreate (bundle);
|
||||
|
||||
InputStream input = Assets.Open ("my_asset.txt");
|
||||
}
|
||||
}
|
||||
|
||||
Additionally, some Android functions will automatically load asset files:
|
||||
|
||||
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
|
|
@ -0,0 +1,68 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<ProjectGuid>{81C62B00-39CC-4CF5-8978-2A44B1EF87E4}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>DroidTest</RootNamespace>
|
||||
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
||||
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
||||
<AndroidResgenClass>Resource</AndroidResgenClass>
|
||||
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
|
||||
<AndroidApplication>True</AndroidApplication>
|
||||
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
|
||||
<AssemblyName>DroidTest</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.4</TargetFrameworkVersion>
|
||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AndroidLinkMode>None</AndroidLinkMode>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
|
||||
<AndroidSupportedAbis>x86</AndroidSupportedAbis>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Mono.Android" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainActivity.cs" />
|
||||
<Compile Include="Resources\Resource.designer.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\AboutResources.txt" />
|
||||
<None Include="Assets\AboutAssets.txt" />
|
||||
<None Include="Properties\AndroidManifest.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\layout\Main.axml" />
|
||||
<AndroidResource Include="Resources\values\Strings.xml" />
|
||||
<AndroidResource Include="Resources\drawable-hdpi\Icon.png" />
|
||||
<AndroidResource Include="Resources\drawable-mdpi\Icon.png" />
|
||||
<AndroidResource Include="Resources\drawable-xhdpi\Icon.png" />
|
||||
<AndroidResource Include="Resources\drawable-xxhdpi\Icon.png" />
|
||||
<AndroidResource Include="Resources\drawable-xxxhdpi\Icon.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
using System.Net;
|
||||
|
||||
using Android.App;
|
||||
using Android.Content;
|
||||
using Android.Runtime;
|
||||
using Android.Views;
|
||||
using Android.Widget;
|
||||
using Android.OS;
|
||||
|
||||
namespace DroidTest
|
||||
{
|
||||
[Activity (Label = "DroidTest", MainLauncher = true, Icon = "@drawable/icon")]
|
||||
public class MainActivity : Activity
|
||||
{
|
||||
const string Address = "https://www.google.com/";
|
||||
|
||||
int count = 1;
|
||||
|
||||
protected override void OnCreate (Bundle bundle)
|
||||
{
|
||||
base.OnCreate (bundle);
|
||||
|
||||
// Set our view from the "main" layout resource
|
||||
SetContentView (Resource.Layout.Main);
|
||||
|
||||
// Get our button from the layout resource,
|
||||
// and attach an event to it
|
||||
Button button = FindViewById<Button> (Resource.Id.myButton);
|
||||
|
||||
button.Click += delegate {
|
||||
Test();
|
||||
};
|
||||
}
|
||||
|
||||
void Test ()
|
||||
{
|
||||
var request = (HttpWebRequest)WebRequest.Create(Address);
|
||||
var response = (HttpWebResponse)request.GetResponse();
|
||||
Console.WriteLine("RESPONSE: {0} {1}", response.StatusCode, response.StatusDescription);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="DroidTest.DroidTest">
|
||||
<uses-sdk />
|
||||
<application android:label="DroidTest">
|
||||
</application>
|
||||
</manifest>
|
|
@ -0,0 +1,28 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Android.App;
|
||||
|
||||
// Information about this assembly is defined by the following attributes.
|
||||
// Change them to the values specific to your project.
|
||||
|
||||
[assembly: AssemblyTitle ("DroidTest")]
|
||||
[assembly: AssemblyDescription ("")]
|
||||
[assembly: AssemblyConfiguration ("")]
|
||||
[assembly: AssemblyCompany ("Xamarin")]
|
||||
[assembly: AssemblyProduct ("")]
|
||||
[assembly: AssemblyCopyright ("Xamarin, Inc.")]
|
||||
[assembly: AssemblyTrademark ("")]
|
||||
[assembly: AssemblyCulture ("")]
|
||||
|
||||
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
|
||||
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
|
||||
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
|
||||
|
||||
[assembly: AssemblyVersion ("1.0.0")]
|
||||
|
||||
// The following attributes are used to specify the signing key for the assembly,
|
||||
// if desired. See the Mono documentation for more information about signing.
|
||||
|
||||
//[assembly: AssemblyDelaySign(false)]
|
||||
//[assembly: AssemblyKeyFile("")]
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
Images, layout descriptions, binary blobs and string dictionaries can be included
|
||||
in your application as resource files. Various Android APIs are designed to
|
||||
operate on the resource IDs instead of dealing with images, strings or binary blobs
|
||||
directly.
|
||||
|
||||
For example, a sample Android app that contains a user interface layout (main.axml),
|
||||
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
|
||||
would keep its resources in the "Resources" directory of the application:
|
||||
|
||||
Resources/
|
||||
drawable/
|
||||
icon.png
|
||||
|
||||
layout/
|
||||
main.axml
|
||||
|
||||
values/
|
||||
strings.xml
|
||||
|
||||
In order to get the build system to recognize Android resources, set the build action to
|
||||
"AndroidResource". The native Android APIs do not operate directly with filenames, but
|
||||
instead operate on resource IDs. When you compile an Android application that uses resources,
|
||||
the build system will package the resources for distribution and generate a class called "R"
|
||||
(this is an Android convention) that contains the tokens for each one of the resources
|
||||
included. For example, for the above Resources layout, this is what the R class would expose:
|
||||
|
||||
public class R {
|
||||
public class drawable {
|
||||
public const int icon = 0x123;
|
||||
}
|
||||
|
||||
public class layout {
|
||||
public const int main = 0x456;
|
||||
}
|
||||
|
||||
public class strings {
|
||||
public const int first_string = 0xabc;
|
||||
public const int second_string = 0xbcd;
|
||||
}
|
||||
}
|
||||
|
||||
You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
|
||||
to reference the layout/main.axml file, or R.strings.first_string to reference the first
|
||||
string in the dictionary file values/strings.xml.
|
112
MartinsPlayground/DroidTest/DroidTest/Resources/Resource.designer.cs
сгенерированный
Normal file
112
MartinsPlayground/DroidTest/DroidTest/Resources/Resource.designer.cs
сгенерированный
Normal file
|
@ -0,0 +1,112 @@
|
|||
#pragma warning disable 1591
|
||||
// ------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Mono Runtime Version: 4.0.30319.17020
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
[assembly: Android.Runtime.ResourceDesignerAttribute("DroidTest.Resource", IsApplication=true)]
|
||||
|
||||
namespace DroidTest
|
||||
{
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
|
||||
public partial class Resource
|
||||
{
|
||||
|
||||
static Resource()
|
||||
{
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||
}
|
||||
|
||||
public static void UpdateIdValues()
|
||||
{
|
||||
}
|
||||
|
||||
public partial class Attribute
|
||||
{
|
||||
|
||||
static Attribute()
|
||||
{
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||
}
|
||||
|
||||
private Attribute()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Drawable
|
||||
{
|
||||
|
||||
// aapt resource value: 0x7f020000
|
||||
public const int Icon = 2130837504;
|
||||
|
||||
static Drawable()
|
||||
{
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||
}
|
||||
|
||||
private Drawable()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Id
|
||||
{
|
||||
|
||||
// aapt resource value: 0x7f050000
|
||||
public const int myButton = 2131034112;
|
||||
|
||||
static Id()
|
||||
{
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||
}
|
||||
|
||||
private Id()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Layout
|
||||
{
|
||||
|
||||
// aapt resource value: 0x7f030000
|
||||
public const int Main = 2130903040;
|
||||
|
||||
static Layout()
|
||||
{
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||
}
|
||||
|
||||
private Layout()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public partial class String
|
||||
{
|
||||
|
||||
// aapt resource value: 0x7f040001
|
||||
public const int app_name = 2130968577;
|
||||
|
||||
// aapt resource value: 0x7f040000
|
||||
public const int hello = 2130968576;
|
||||
|
||||
static String()
|
||||
{
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||
}
|
||||
|
||||
private String()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 2.1 KiB |
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 1.4 KiB |
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 3.2 KiB |
Двоичные данные
MartinsPlayground/DroidTest/DroidTest/Resources/drawable-xxhdpi/Icon.png
Normal file
Двоичные данные
MartinsPlayground/DroidTest/DroidTest/Resources/drawable-xxhdpi/Icon.png
Normal file
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 5.3 KiB |
Двоичные данные
MartinsPlayground/DroidTest/DroidTest/Resources/drawable-xxxhdpi/Icon.png
Normal file
Двоичные данные
MartinsPlayground/DroidTest/DroidTest/Resources/drawable-xxxhdpi/Icon.png
Normal file
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 7.6 KiB |
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
>
|
||||
<Button
|
||||
android:id="@+id/myButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/hello"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="hello">Hello World, Click Me!</string>
|
||||
<string name="app_name">DroidTest</string>
|
||||
</resources>
|
|
@ -0,0 +1,121 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Console
|
||||
{
|
||||
using Framework;
|
||||
|
||||
public static class ConnectionFactoryProvider
|
||||
{
|
||||
public static ClientFactory GetClientFactory (string name)
|
||||
{
|
||||
if (name == "openssl")
|
||||
return Factory.OpenSslClient;
|
||||
else if (name == "dotnet")
|
||||
return Factory.DotNetClient;
|
||||
else if (name == "mono")
|
||||
return Factory.MonoClient;
|
||||
else
|
||||
throw new InvalidOperationException ();
|
||||
}
|
||||
|
||||
public static ServerFactory GetServerFactory (string name)
|
||||
{
|
||||
if (name == "openssl")
|
||||
return Factory.OpenSslServer;
|
||||
else if (name == "dotnet")
|
||||
return Factory.DotNetServer;
|
||||
else if (name == "mono")
|
||||
return Factory.MonoServer;
|
||||
else
|
||||
throw new InvalidOperationException ();
|
||||
}
|
||||
|
||||
static void AddClientFactories (List<ClientFactory> list, string names)
|
||||
{
|
||||
foreach (var name in names.Split (','))
|
||||
list.Add (GetClientFactory (name));
|
||||
}
|
||||
|
||||
static void AddServerFactories (List<ServerFactory> list, string names)
|
||||
{
|
||||
foreach (var name in names.Split (','))
|
||||
list.Add (GetServerFactory (name));
|
||||
}
|
||||
|
||||
public static IConnectionFactoryProvider GetClientAndServer (string clientArg, string serverArg)
|
||||
{
|
||||
var clientFactories = new List<ClientFactory> ();
|
||||
var serverFactories = new List<ServerFactory> ();
|
||||
|
||||
if (clientArg == null)
|
||||
clientArg = "all";
|
||||
if (serverArg == null)
|
||||
serverArg = "all";
|
||||
|
||||
if (clientArg.Equals ("all")) {
|
||||
clientFactories.Add (Factory.MonoClient);
|
||||
clientFactories.Add (Factory.OpenSslClient);
|
||||
} else {
|
||||
AddClientFactories (clientFactories, clientArg);
|
||||
}
|
||||
|
||||
if (serverArg.Equals ("all")) {
|
||||
serverFactories.Add (Factory.MonoServer);
|
||||
serverFactories.Add (Factory.OpenSslServer);
|
||||
} else if (serverArg != null) {
|
||||
AddServerFactories (serverFactories, serverArg);
|
||||
}
|
||||
|
||||
var factories = new List<ClientAndServerFactory> ();
|
||||
foreach (var server in serverFactories) {
|
||||
foreach (var client in clientFactories) {
|
||||
factories.Add (new ClientAndServerFactory (server, client));
|
||||
}
|
||||
}
|
||||
|
||||
return new MyFactoryProvider (factories);
|
||||
}
|
||||
|
||||
class MyFactoryProvider : IConnectionFactoryProvider
|
||||
{
|
||||
IList<ClientAndServerFactory> factories;
|
||||
|
||||
public MyFactoryProvider (IList<ClientAndServerFactory> factories)
|
||||
{
|
||||
this.factories = factories;
|
||||
}
|
||||
|
||||
public IEnumerable<ConnectionFactory> Factories {
|
||||
get { return factories; }
|
||||
}
|
||||
|
||||
Type ITestParameterProvider.Type {
|
||||
get { return typeof(ClientAndServerFactory); }
|
||||
}
|
||||
|
||||
string ITestParameterProvider.Name {
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public IEnumerable GetParameters (Type fixtureType)
|
||||
{
|
||||
var attrs = fixtureType.GetCustomAttributes<ConnectionFactoryParametersAttribute> ().ToArray ();
|
||||
|
||||
foreach (var factory in factories) {
|
||||
if (attrs.Length == 0)
|
||||
yield return factory;
|
||||
|
||||
foreach (var attr in attrs) {
|
||||
if (factory.Matches (attr.ConnectionType))
|
||||
yield return factory;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Console
|
||||
{
|
||||
using Framework;
|
||||
|
||||
public class CryptoTestFactory : ITestParameterProvider
|
||||
{
|
||||
IList<ICryptoTestProvider> providers;
|
||||
|
||||
public Type Type {
|
||||
get { return typeof(ICryptoTestProvider); }
|
||||
}
|
||||
|
||||
public string Name {
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public IEnumerable Parameters {
|
||||
get { return providers; }
|
||||
}
|
||||
|
||||
public CryptoTestFactory (params string[] names)
|
||||
{
|
||||
providers = new List<ICryptoTestProvider> ();
|
||||
if (names != null && names.Length > 0) {
|
||||
foreach (var name in names) {
|
||||
providers.Add (GetProvider (name));
|
||||
}
|
||||
} else {
|
||||
providers.Add (new MonoCryptoTest ());
|
||||
providers.Add (new NativeCryptoTest ());
|
||||
}
|
||||
}
|
||||
|
||||
static ICryptoTestProvider GetProvider (string name)
|
||||
{
|
||||
if (name == "mono")
|
||||
return new MonoCryptoTest ();
|
||||
else if (name == "openssl")
|
||||
return new NativeCryptoTest ();
|
||||
else
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public IEnumerable GetParameters (Type fixtureType)
|
||||
{
|
||||
return providers;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Net.Security;
|
||||
using System.Diagnostics;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Authentication;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Console
|
||||
{
|
||||
using Framework;
|
||||
|
||||
public class DotNetClient : DotNetConnection, IClient
|
||||
{
|
||||
new public IClientParameters Parameters {
|
||||
get { return (IClientParameters)base.Parameters; }
|
||||
}
|
||||
|
||||
public DotNetClient (ClientFactory factory, IPEndPoint endpoint, IClientParameters parameters)
|
||||
: base (factory, endpoint, parameters)
|
||||
{
|
||||
}
|
||||
|
||||
protected override Stream Start (Socket socket)
|
||||
{
|
||||
Debug ("Connected.");
|
||||
|
||||
var clientCerts = new X509Certificate2Collection ();
|
||||
if (Parameters.ClientCertificate != null)
|
||||
clientCerts.Add (Parameters.ClientCertificate.Certificate);
|
||||
|
||||
var targetHost = "Hamiller-Tube.local";
|
||||
|
||||
var stream = new NetworkStream (socket);
|
||||
var server = new SslStream (stream, false, RemoteValidationCallback, null);
|
||||
server.AuthenticateAsClient (targetHost, clientCerts, SslProtocols.Tls12, false);
|
||||
|
||||
Debug ("Successfully authenticated.");
|
||||
|
||||
return server;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,184 @@
|
|||
//
|
||||
// DotNetConnection.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <martin.baulig@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2014 Xamarin Inc. (http://www.xamarin.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Net.Security;
|
||||
using System.Diagnostics;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Authentication;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using Mono.Security.Protocol.NewTls;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Console
|
||||
{
|
||||
using Framework;
|
||||
|
||||
public abstract class DotNetConnection : Connection, ICommonConnection
|
||||
{
|
||||
public DotNetConnection (ConnectionFactory factory, IPEndPoint endpoint, IConnectionParameters parameters)
|
||||
: base (factory, endpoint, parameters)
|
||||
{
|
||||
}
|
||||
|
||||
Socket socket;
|
||||
Socket accepted;
|
||||
TaskCompletionSource<Stream> tcs;
|
||||
|
||||
Stream sslStream;
|
||||
|
||||
protected bool RemoteValidationCallback (object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
|
||||
{
|
||||
Debug ("REMOTE VALIDATION CALLBACK: {0} {1}", certificate.Subject, errors);
|
||||
return RemoteValidationCallback (errors == SslPolicyErrors.None, certificate);
|
||||
}
|
||||
|
||||
protected X509Certificate LocalCertificateSelectionCallback (object sender, string targetHost, X509CertificateCollection localCertificates, X509Certificate remoteCertificate, string[] acceptableIssuers)
|
||||
{
|
||||
Debug ("LOCAL SELECTION CALLBACK: {0}", targetHost);
|
||||
return LocalCertificateSelectionCallback (targetHost, localCertificates, remoteCertificate, acceptableIssuers);
|
||||
}
|
||||
|
||||
public Stream Stream {
|
||||
get { return sslStream; }
|
||||
}
|
||||
|
||||
public override TlsConnectionInfo GetConnectionInfo ()
|
||||
{
|
||||
throw new InvalidOperationException ();
|
||||
}
|
||||
|
||||
protected abstract Stream Start (Socket socket);
|
||||
|
||||
public sealed override Task Start ()
|
||||
{
|
||||
if (this is IClient)
|
||||
StartClient ();
|
||||
else
|
||||
StartServer ();
|
||||
return FinishedTask;
|
||||
}
|
||||
|
||||
void StartServer ()
|
||||
{
|
||||
socket = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
||||
socket.Bind (EndPoint);
|
||||
socket.Listen (1);
|
||||
|
||||
tcs = new TaskCompletionSource<Stream> ();
|
||||
|
||||
socket.BeginAccept (ar => {
|
||||
try {
|
||||
accepted = socket.EndAccept (ar);
|
||||
sslStream = Start (accepted);
|
||||
tcs.SetResult (sslStream);
|
||||
} catch (Exception ex) {
|
||||
Debug ("Error starting server: {0}", ex);
|
||||
tcs.SetException (ex);
|
||||
}
|
||||
}, null);
|
||||
}
|
||||
|
||||
void StartClient ()
|
||||
{
|
||||
socket = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
||||
|
||||
tcs = new TaskCompletionSource<Stream> ();
|
||||
|
||||
socket.BeginConnect (EndPoint, ar => {
|
||||
try {
|
||||
socket.EndConnect (ar);
|
||||
sslStream = Start (socket);
|
||||
tcs.SetResult (sslStream);
|
||||
} catch (Exception ex) {
|
||||
Debug ("Error starting client: {0}", ex);
|
||||
tcs.SetException (ex);
|
||||
}
|
||||
}, null);
|
||||
}
|
||||
|
||||
public sealed override Task WaitForConnection ()
|
||||
{
|
||||
return tcs.Task;
|
||||
}
|
||||
|
||||
protected virtual Task<bool> TryCleanShutdown (bool waitForReply)
|
||||
{
|
||||
throw new NotSupportedException ("Clean shutdown not supported yet.");
|
||||
}
|
||||
|
||||
public sealed override async Task<bool> Shutdown (bool attemptCleanShutdown, bool waitForReply)
|
||||
{
|
||||
if (attemptCleanShutdown)
|
||||
attemptCleanShutdown = await TryCleanShutdown (waitForReply);
|
||||
|
||||
return attemptCleanShutdown;
|
||||
}
|
||||
|
||||
protected override void Stop ()
|
||||
{
|
||||
if (accepted != null) {
|
||||
try {
|
||||
accepted.Shutdown (SocketShutdown.Both);
|
||||
} catch {
|
||||
;
|
||||
}
|
||||
try {
|
||||
accepted.Dispose ();
|
||||
} catch {
|
||||
;
|
||||
}
|
||||
accepted = null;
|
||||
}
|
||||
if (socket != null) {
|
||||
try {
|
||||
socket.Shutdown (SocketShutdown.Both);
|
||||
} catch {
|
||||
;
|
||||
}
|
||||
try {
|
||||
socket.Dispose ();
|
||||
} catch {
|
||||
;
|
||||
}
|
||||
socket = null;
|
||||
}
|
||||
try {
|
||||
if (sslStream != null) {
|
||||
sslStream.Dispose ();
|
||||
sslStream = null;
|
||||
}
|
||||
} catch {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Net.Security;
|
||||
using System.Diagnostics;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Authentication;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Console
|
||||
{
|
||||
using Framework;
|
||||
|
||||
public class DotNetServer : DotNetConnection, IServer
|
||||
{
|
||||
public ServerCertificate Certificate {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
new public IServerParameters Parameters {
|
||||
get { return (IServerParameters)base.Parameters; }
|
||||
}
|
||||
|
||||
public DotNetServer (ServerFactory factory, IPEndPoint endpoint, ServerCertificate pfx, IServerParameters parameters)
|
||||
: base (factory, endpoint, parameters)
|
||||
{
|
||||
Certificate = pfx;
|
||||
}
|
||||
|
||||
protected override Stream Start (Socket socket)
|
||||
{
|
||||
Debug ("Accepted connection from {0}.", socket.RemoteEndPoint);
|
||||
|
||||
if (Parameters.AskForClientCertificate || Parameters.RequireClientCertificate)
|
||||
throw new NotSupportedException ();
|
||||
|
||||
var stream = new NetworkStream (socket);
|
||||
var server = new SslStream (stream, false);
|
||||
server.AuthenticateAsServer (Certificate.Certificate, false, SslProtocols.Tls12, false);
|
||||
|
||||
Debug ("Successfully authenticated.");
|
||||
|
||||
return server;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,317 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Console
|
||||
{
|
||||
using Framework;
|
||||
using Resources;
|
||||
|
||||
public static class Factory
|
||||
{
|
||||
static ServerFactory openSslServer;
|
||||
static ServerFactory dotNetServer;
|
||||
static ClientFactory openSslClient;
|
||||
static ClientFactory dotNetClient;
|
||||
static ServerFactory monoServer;
|
||||
static ClientFactory monoClient;
|
||||
|
||||
static Factory ()
|
||||
{
|
||||
openSslServer = new OpenSslServerFactory (new IPEndPoint (IPAddress.Loopback, 4433));
|
||||
dotNetServer = new DotNetServerFactory (new IPEndPoint (IPAddress.Any, 4433));
|
||||
openSslClient = new OpenSslClientFactory (new IPEndPoint (IPAddress.Loopback, 4433));
|
||||
dotNetClient = new DotNetClientFactory (new IPEndPoint (IPAddress.Loopback , 4433));
|
||||
monoServer = new MonoServerFactory (new IPEndPoint (IPAddress.Any, 4433));
|
||||
monoClient = new MonoClientFactory (new IPEndPoint (IPAddress.Loopback , 4433));
|
||||
}
|
||||
|
||||
public static ServerFactory OpenSslServer {
|
||||
get { return openSslServer; }
|
||||
}
|
||||
|
||||
public static ServerFactory DotNetServer {
|
||||
get { return dotNetServer; }
|
||||
}
|
||||
|
||||
public static ClientFactory OpenSslClient {
|
||||
get { return openSslClient; }
|
||||
}
|
||||
|
||||
public static ClientFactory DotNetClient {
|
||||
get { return dotNetClient; }
|
||||
}
|
||||
|
||||
public static ServerFactory MonoServer {
|
||||
get { return monoServer; }
|
||||
}
|
||||
|
||||
public static ClientFactory MonoClient {
|
||||
get { return monoClient; }
|
||||
}
|
||||
|
||||
class OpenSslServerFactory : ServerFactory
|
||||
{
|
||||
public IPEndPoint EndPoint {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public override bool IsMono {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public OpenSslServerFactory (IPEndPoint endpoint)
|
||||
{
|
||||
EndPoint = endpoint;
|
||||
}
|
||||
|
||||
public override IServer CreateServer (IServerParameters parameters)
|
||||
{
|
||||
var certificate = ResourceManager.DefaultServerCertificate;
|
||||
return new OpenSslServer (this, EndPoint, certificate, parameters);
|
||||
}
|
||||
|
||||
public override ConnectionType ConnectionType {
|
||||
get { return ConnectionType.OpenSslServer; }
|
||||
}
|
||||
|
||||
public override bool HasConnectionInfo {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override bool SupportsCleanShutdown {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override bool CanSelectCiphers {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return "[OpenSslServer]";
|
||||
}
|
||||
}
|
||||
|
||||
class OpenSslClientFactory : ClientFactory
|
||||
{
|
||||
public IPEndPoint EndPoint {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public override bool IsMono {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public OpenSslClientFactory (IPEndPoint endpoint)
|
||||
{
|
||||
EndPoint = endpoint;
|
||||
}
|
||||
|
||||
public override IClient CreateClient (IClientParameters parameters)
|
||||
{
|
||||
return new OpenSslClient (this, EndPoint, parameters);
|
||||
}
|
||||
|
||||
public override ConnectionType ConnectionType {
|
||||
get { return ConnectionType.OpenSslClient; }
|
||||
}
|
||||
|
||||
public override bool HasConnectionInfo {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override bool SupportsCleanShutdown {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override bool CanSelectCiphers {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return "[OpenSslClient]";
|
||||
}
|
||||
}
|
||||
|
||||
class DotNetClientFactory : ClientFactory
|
||||
{
|
||||
public IPEndPoint EndPoint {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public override bool IsMono {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public DotNetClientFactory (IPEndPoint endpoint)
|
||||
{
|
||||
EndPoint = endpoint;
|
||||
}
|
||||
|
||||
public override IClient CreateClient (IClientParameters parameters)
|
||||
{
|
||||
return new DotNetClient (this, EndPoint, parameters);
|
||||
}
|
||||
|
||||
public override ConnectionType ConnectionType {
|
||||
get { return ConnectionType.DotNetClient; }
|
||||
}
|
||||
|
||||
public override bool HasConnectionInfo {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public override bool SupportsCleanShutdown {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public override bool CanSelectCiphers {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return "[DotNetClient]";
|
||||
}
|
||||
}
|
||||
|
||||
class DotNetServerFactory : ServerFactory
|
||||
{
|
||||
public IPEndPoint EndPoint {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public override bool IsMono {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public DotNetServerFactory (IPEndPoint endpoint)
|
||||
{
|
||||
EndPoint = endpoint;
|
||||
}
|
||||
|
||||
public override IServer CreateServer (IServerParameters parameters)
|
||||
{
|
||||
var certificate = ResourceManager.DefaultServerCertificate;
|
||||
return new DotNetServer (this, EndPoint, certificate, parameters);
|
||||
}
|
||||
|
||||
public override ConnectionType ConnectionType {
|
||||
get { return ConnectionType.DotNetServer; }
|
||||
}
|
||||
|
||||
public override bool HasConnectionInfo {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public override bool SupportsCleanShutdown {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public override bool CanSelectCiphers {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return "[DotNetServer]";
|
||||
}
|
||||
}
|
||||
|
||||
class MonoClientFactory : ClientFactory
|
||||
{
|
||||
public IPEndPoint EndPoint {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public override bool IsMono {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public MonoClientFactory (IPEndPoint endpoint)
|
||||
{
|
||||
EndPoint = endpoint;
|
||||
}
|
||||
|
||||
public override IClient CreateClient (IClientParameters parameters)
|
||||
{
|
||||
return new MonoClient (this, EndPoint, parameters);
|
||||
}
|
||||
|
||||
public override ConnectionType ConnectionType {
|
||||
get { return ConnectionType.MonoClient; }
|
||||
}
|
||||
|
||||
public override bool HasConnectionInfo {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override bool SupportsCleanShutdown {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override bool CanSelectCiphers {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return "[MonoClient]";
|
||||
}
|
||||
}
|
||||
|
||||
class MonoServerFactory : ServerFactory
|
||||
{
|
||||
public IPEndPoint EndPoint {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public override bool IsMono {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public MonoServerFactory (IPEndPoint endpoint)
|
||||
{
|
||||
EndPoint = endpoint;
|
||||
}
|
||||
|
||||
public override IServer CreateServer (IServerParameters parameters)
|
||||
{
|
||||
var certificate = ResourceManager.DefaultServerCertificate;
|
||||
return new MonoServer (this, EndPoint, certificate, parameters);
|
||||
}
|
||||
|
||||
public override ConnectionType ConnectionType {
|
||||
get { return ConnectionType.MonoServer; }
|
||||
}
|
||||
|
||||
public override bool HasConnectionInfo {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override bool SupportsCleanShutdown {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override bool CanSelectCiphers {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return "[MonoServer]";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProjectGuid>{C3E744E1-2FE5-4D62-9BB0-FE0BC58B3A73}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>Mono.Security.Instrumentation.Console</RootNamespace>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>..\..\MartinsPlayground.snk</AssemblyOriginatorKeyFile>
|
||||
<AssemblyName>Mono.Security.Instrumentation.Console</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<Commandlineparameters>work</Commandlineparameters>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Externalconsole>true</Externalconsole>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Mono.Security" />
|
||||
<Reference Include="nunit.core">
|
||||
<HintPath>..\..\..\..\Mono.Security.NewTls\packages\NUnitTestAdapter.1.2\lib\nunit.core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.core.interfaces">
|
||||
<HintPath>..\..\..\..\Mono.Security.NewTls\packages\NUnitTestAdapter.1.2\lib\nunit.core.interfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.util">
|
||||
<HintPath>..\..\..\..\Mono.Security.NewTls\packages\NUnitTestAdapter.1.2\lib\nunit.util.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NUnit.VisualStudio.TestAdapter">
|
||||
<HintPath>..\..\..\..\Mono.Security.NewTls\packages\NUnitTestAdapter.1.2\lib\NUnit.VisualStudio.TestAdapter.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="OpenSslServer.cs" />
|
||||
<Compile Include="DotNetServer.cs" />
|
||||
<Compile Include="OpenSslClient.cs" />
|
||||
<Compile Include="Factory.cs" />
|
||||
<Compile Include="Options.cs" />
|
||||
<Compile Include="DotNetClient.cs" />
|
||||
<Compile Include="MonoClient.cs" />
|
||||
<Compile Include="MonoServer.cs" />
|
||||
<Compile Include="NativeOpenSsl.cs" />
|
||||
<Compile Include="NativeOpenSslError.cs" />
|
||||
<Compile Include="NativeOpenSslException.cs" />
|
||||
<Compile Include="OpenSslConnection.cs" />
|
||||
<Compile Include="DotNetConnection.cs" />
|
||||
<Compile Include="ConnectionFactoryProvider.cs" />
|
||||
<Compile Include="MonoConnection.cs" />
|
||||
<Compile Include="NativeCryptoTest.cs" />
|
||||
<Compile Include="MonoCryptoTest.cs" />
|
||||
<Compile Include="CryptoTestFactory.cs" />
|
||||
<Compile Include="MonoCryptoContext.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<MonoDevelop>
|
||||
<Properties>
|
||||
<Policies>
|
||||
<TextStylePolicy inheritsSet="Mono" inheritsScope="text/plain" scope="text/x-csharp" />
|
||||
<CSharpFormattingPolicy inheritsSet="Mono" inheritsScope="text/x-csharp" scope="text/x-csharp" />
|
||||
</Policies>
|
||||
</Properties>
|
||||
</MonoDevelop>
|
||||
</ProjectExtensions>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Framework\Mono.Security.Instrumentation.Framework.csproj">
|
||||
<Project>{43272ABC-8798-4B6F-A8CA-D7F082DBB440}</Project>
|
||||
<Name>Mono.Security.Instrumentation.Framework</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Tests\Mono.Security.Instrumentation.Tests.csproj">
|
||||
<Project>{93CE4A8C-9111-4211-9BE1-314134802473}</Project>
|
||||
<Name>Mono.Security.Instrumentation.Tests</Name>
|
||||
</ProjectReference>
|
||||
<Reference Include="Mono.Security.Providers.NewMonoSource">
|
||||
<Aliases>NewMonoSource</Aliases>
|
||||
</Reference>
|
||||
<ProjectReference Include="..\..\..\..\Mono.Security.Providers\NewTls\Mono.Security.Providers.NewTls.csproj">
|
||||
<Project>{4B5EDBC8-F8EA-48E4-AA87-A3FC52202F01}</Project>
|
||||
<Name>Mono.Security.Providers.NewTls</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\Mono.Security.NewTls\Mono.Security.NewTls.csproj">
|
||||
<Project>{C577448D-707B-4DDD-83DC-9CB758FC6DE5}</Project>
|
||||
<Name>Mono.Security.NewTls</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\nunit-console\nunit-console.csproj">
|
||||
<Project>{9367EC89-6A38-42BA-9607-0DC288E4BC3A}</Project>
|
||||
<Name>nunit-console</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="..\Framework\CA\" />
|
||||
<Folder Include="lib\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\lib\libNativeOpenSsl.dylib">
|
||||
<Link>libNativeOpenSsl.dylib</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\..\lib\libcrypto.1.0.0.dylib">
|
||||
<Link>libcrypto.1.0.0.dylib</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\..\lib\libssl.1.0.0.dylib">
|
||||
<Link>libssl.1.0.0.dylib</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,79 @@
|
|||
extern alias NewMonoSource;
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Net.Security;
|
||||
using System.Diagnostics;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Security.Authentication;
|
||||
|
||||
using NewSslPolicyErrors = NewMonoSource::System.Net.Security.SslPolicyErrors;
|
||||
using SslProtocols = System.Security.Authentication.SslProtocols;
|
||||
using EncryptionPolicy = NewMonoSource::System.Net.Security.EncryptionPolicy;
|
||||
|
||||
using Mono.Security.Protocol.NewTls;
|
||||
using Mono.Security.Providers.NewTls;
|
||||
|
||||
using SSCX = System.Security.Cryptography.X509Certificates;
|
||||
using MX = Mono.Security.X509;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Console
|
||||
{
|
||||
using Framework;
|
||||
|
||||
public class MonoClient : MonoConnection, IClient
|
||||
{
|
||||
new public IClientParameters Parameters {
|
||||
get { return (IClientParameters)base.Parameters; }
|
||||
}
|
||||
|
||||
public MonoClient (ClientFactory factory, IPEndPoint endpoint, IClientParameters parameters)
|
||||
: base (factory, endpoint, parameters)
|
||||
{
|
||||
}
|
||||
|
||||
protected override TlsSettings GetSettings ()
|
||||
{
|
||||
var settings = new TlsSettings ();
|
||||
var monoParams = Parameters as IMonoClientParameters;
|
||||
if (monoParams != null) {
|
||||
settings.ClientCertificateParameters = monoParams.ClientCertificateParameters;
|
||||
settings.Instrumentation = monoParams.ClientInstrumentation;
|
||||
}
|
||||
settings.RequestedCiphers = Parameters.ClientCiphers;
|
||||
return settings;
|
||||
}
|
||||
|
||||
protected override MonoNewTlsStream Start (Socket socket, TlsSettings settings)
|
||||
{
|
||||
Debug ("Connected.");
|
||||
|
||||
var clientCerts = new X509Certificate2Collection ();
|
||||
if (Parameters.ClientCertificate != null)
|
||||
clientCerts.Add (Parameters.ClientCertificate.Certificate);
|
||||
|
||||
var targetHost = "Hamiller-Tube.local";
|
||||
|
||||
var stream = new NetworkStream (socket);
|
||||
|
||||
return MonoNewTlsStreamFactory.CreateClient (
|
||||
stream, false, RemoteValidationCallback, null, EncryptionPolicy.RequireEncryption, settings,
|
||||
targetHost, clientCerts, SslProtocols.Tls12, false);
|
||||
}
|
||||
|
||||
bool RemoteValidationCallback (object sender, X509Certificate certificate, X509Chain chain, NewSslPolicyErrors errors)
|
||||
{
|
||||
return base.RemoteValidationCallback (sender, certificate, chain, (SslPolicyErrors)errors);
|
||||
}
|
||||
|
||||
bool ClientCertValidationCallback (ClientCertificateParameters certParams, MX.X509Certificate certificate, MX.X509Chain chain, SslPolicyErrors sslPolicyErrors)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
//
|
||||
// MonoConnection.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <martin.baulig@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2014 Xamarin Inc. (http://www.xamarin.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
extern alias NewMonoSource;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Net.Security;
|
||||
using System.Diagnostics;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Authentication;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
using Mono.Security.Protocol.NewTls;
|
||||
using Mono.Security.Providers.NewTls;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Console
|
||||
{
|
||||
using Framework;
|
||||
|
||||
public abstract class MonoConnection : DotNetConnection, ICommonConnection
|
||||
{
|
||||
public MonoConnection (ConnectionFactory factory, IPEndPoint endpoint, IConnectionParameters parameters)
|
||||
: base (factory, endpoint, parameters)
|
||||
{
|
||||
}
|
||||
|
||||
TlsSettings settings;
|
||||
MonoNewTlsStream monoSslStream;
|
||||
|
||||
public override TlsConnectionInfo GetConnectionInfo ()
|
||||
{
|
||||
return settings.ConnectionInfo;
|
||||
}
|
||||
|
||||
protected abstract MonoNewTlsStream Start (Socket socket, TlsSettings settings);
|
||||
|
||||
protected abstract TlsSettings GetSettings ();
|
||||
|
||||
protected sealed override Stream Start (Socket socket)
|
||||
{
|
||||
settings = GetSettings ();
|
||||
settings.EnableDebugging = Parameters.EnableDebugging;
|
||||
monoSslStream = Start (socket, settings);
|
||||
return monoSslStream;
|
||||
}
|
||||
|
||||
protected override async Task<bool> TryCleanShutdown (bool waitForReply)
|
||||
{
|
||||
await monoSslStream.Shutdown (waitForReply);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,197 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Net.Security;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using Mono.Security.Interface;
|
||||
using Mono.Security.Protocol.NewTls;
|
||||
using Mono.Security.Protocol.NewTls.Cipher;
|
||||
using Mono.Security.Protocol.NewTls.Handshake;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Console
|
||||
{
|
||||
using Framework;
|
||||
|
||||
class MonoCryptoContext : DisposeContext, ICryptoTestContext
|
||||
{
|
||||
public TlsProtocolCode Protocol {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public bool IsServer {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public CipherSuite Cipher {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public CryptoParameters Crypto {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public bool EnableDebugging {
|
||||
get; set;
|
||||
}
|
||||
|
||||
public byte ExtraPaddingBlocks {
|
||||
get; set;
|
||||
}
|
||||
|
||||
public MonoCryptoContext (TlsProtocolCode protocol, bool isServer)
|
||||
{
|
||||
Protocol = protocol;
|
||||
IsServer = isServer;
|
||||
}
|
||||
|
||||
class MyCbcBlockCipher : CbcBlockCipher
|
||||
{
|
||||
MonoCryptoContext context;
|
||||
byte[] iv;
|
||||
|
||||
public MyCbcBlockCipher (MonoCryptoContext context, byte[] iv)
|
||||
: base (context.IsServer, context.Protocol, context.Cipher)
|
||||
{
|
||||
this.context = context;
|
||||
this.iv = iv;
|
||||
}
|
||||
|
||||
protected override SymmetricAlgorithm CreateEncryptionAlgorithm (bool forEncryption)
|
||||
{
|
||||
return new MyAlgorithm (base.CreateEncryptionAlgorithm (forEncryption), iv);
|
||||
}
|
||||
|
||||
protected override byte GetPaddingSize (int size)
|
||||
{
|
||||
var padLen = (byte)(BlockSize - size % BlockSize);
|
||||
if (padLen == BlockSize)
|
||||
padLen = 0;
|
||||
|
||||
padLen += (byte)(context.ExtraPaddingBlocks * BlockSize);
|
||||
|
||||
return padLen;
|
||||
}
|
||||
}
|
||||
|
||||
class MyAlgorithm : SymmetricAlgorithmProxy
|
||||
{
|
||||
byte[] iv;
|
||||
|
||||
public MyAlgorithm (SymmetricAlgorithm algorithm, byte[] iv)
|
||||
: base (algorithm)
|
||||
{
|
||||
this.iv = iv;
|
||||
}
|
||||
|
||||
public override void GenerateIV ()
|
||||
{
|
||||
base.IV = iv;
|
||||
}
|
||||
}
|
||||
|
||||
class MyGaloisCounterCipher : GaloisCounterCipher
|
||||
{
|
||||
byte[] iv;
|
||||
|
||||
public MyGaloisCounterCipher (bool isServer, TlsProtocolCode protocol, CipherSuite cipher, byte[] iv)
|
||||
: base (isServer, protocol, cipher)
|
||||
{
|
||||
this.iv = iv;
|
||||
}
|
||||
|
||||
protected override void CreateExplicitNonce (SecureBuffer explicitNonce)
|
||||
{
|
||||
Buffer.BlockCopy (iv, 0, explicitNonce.Buffer, 0, iv.Length);
|
||||
}
|
||||
}
|
||||
|
||||
public int BlockSize {
|
||||
get { return Cipher.BlockSize; }
|
||||
}
|
||||
|
||||
public int GetEncryptedSize (int size)
|
||||
{
|
||||
return Crypto.GetEncryptedSize (size);
|
||||
}
|
||||
|
||||
public int MinExtraEncryptedBytes {
|
||||
get { return Crypto.MinExtraEncryptedBytes; }
|
||||
}
|
||||
|
||||
public int MaxExtraEncryptedBytes {
|
||||
get { return Crypto.MaxExtraEncryptedBytes; }
|
||||
}
|
||||
|
||||
public void InitializeCBC (CipherSuiteCode code, byte[] key, byte[] mac, byte[] iv)
|
||||
{
|
||||
Cipher = CipherSuiteFactory.CreateCipherSuite (Protocol, code);
|
||||
#if DEBUG_FULL
|
||||
Cipher.EnableDebugging = EnableDebugging;
|
||||
#endif
|
||||
Crypto = Add (new MyCbcBlockCipher (this, iv));
|
||||
|
||||
Crypto.ServerWriteKey = SecureBuffer.CreateCopy (key);
|
||||
Crypto.ClientWriteKey = SecureBuffer.CreateCopy (key);
|
||||
Crypto.ServerWriteMac = SecureBuffer.CreateCopy (mac);
|
||||
Crypto.ClientWriteMac = SecureBuffer.CreateCopy (mac);
|
||||
|
||||
Crypto.InitializeCipher ();
|
||||
}
|
||||
|
||||
public void InitializeGCM (CipherSuiteCode code, byte[] key, byte[] implNonce, byte[] explNonce)
|
||||
{
|
||||
Cipher = CipherSuiteFactory.CreateCipherSuite (Protocol, code);
|
||||
#if DEBUG_FULL
|
||||
Cipher.EnableDebugging = EnableDebugging;
|
||||
#endif
|
||||
Crypto = Add (new MyGaloisCounterCipher (IsServer, Protocol, Cipher, explNonce));
|
||||
|
||||
Crypto.ServerWriteKey = SecureBuffer.CreateCopy (key);
|
||||
Crypto.ClientWriteKey = SecureBuffer.CreateCopy (key);
|
||||
Crypto.ServerWriteIV = SecureBuffer.CreateCopy (implNonce);
|
||||
Crypto.ClientWriteIV = SecureBuffer.CreateCopy (implNonce);
|
||||
|
||||
Crypto.InitializeCipher ();
|
||||
}
|
||||
|
||||
public void EncryptRecord (ContentType contentType, IBufferOffsetSize input, TlsStream output)
|
||||
{
|
||||
Crypto.WriteSequenceNumber = 0;
|
||||
TlsContext.EncodeRecord (Protocol, ContentType.ApplicationData, Crypto, input, output);
|
||||
}
|
||||
|
||||
public IBufferOffsetSize Encrypt (IBufferOffsetSize input)
|
||||
{
|
||||
Crypto.WriteSequenceNumber = 0;
|
||||
return Crypto.Encrypt (ContentType.ApplicationData, input);
|
||||
}
|
||||
|
||||
public int Encrypt (IBufferOffsetSize input, IBufferOffsetSize output)
|
||||
{
|
||||
Crypto.WriteSequenceNumber = 0;
|
||||
return Crypto.Encrypt (ContentType.ApplicationData, input, output);
|
||||
}
|
||||
|
||||
public IBufferOffsetSize Decrypt (IBufferOffsetSize input)
|
||||
{
|
||||
Crypto.ReadSequenceNumber = 0;
|
||||
return Crypto.Decrypt (ContentType.ApplicationData, input);
|
||||
}
|
||||
|
||||
public int Decrypt (IBufferOffsetSize input, IBufferOffsetSize output)
|
||||
{
|
||||
Crypto.ReadSequenceNumber = 0;
|
||||
return Crypto.Decrypt (ContentType.ApplicationData, input, output);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Net.Security;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using Mono.Security.Protocol.NewTls;
|
||||
using Mono.Security.Protocol.NewTls.Cipher;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Console
|
||||
{
|
||||
using Framework;
|
||||
|
||||
public class MonoCryptoTest : ICryptoTestProvider
|
||||
{
|
||||
public byte[] TestPRF (HandshakeHashType algorithm, byte[] secret, string seed, byte[] data, int length)
|
||||
{
|
||||
var prf = new PseudoRandomFunctionTls12 (algorithm);
|
||||
|
||||
var result = prf.PRF (new SecureBuffer (secret), seed, new SecureBuffer (data), length);
|
||||
return result.StealBuffer ();
|
||||
}
|
||||
|
||||
HashAlgorithm CreateHash (HandshakeHashType algorithm)
|
||||
{
|
||||
switch (algorithm) {
|
||||
case HandshakeHashType.SHA256:
|
||||
return SHA256.Create ();
|
||||
case HandshakeHashType.SHA384:
|
||||
return SHA384.Create ();
|
||||
default:
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] TestDigest (HandshakeHashType algorithm, byte[] data)
|
||||
{
|
||||
var hash = CreateHash (algorithm);
|
||||
hash.TransformFinalBlock (data, 0, data.Length);
|
||||
return hash.Hash;
|
||||
}
|
||||
|
||||
public bool SupportsEncryption {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public ICryptoTestContext CreateContext ()
|
||||
{
|
||||
return new MonoCryptoContext (TlsProtocolCode.Tls12, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
extern alias NewMonoSource;
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Net.Security;
|
||||
using System.Diagnostics;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using SslProtocols = System.Security.Authentication.SslProtocols;
|
||||
using EncryptionPolicy = NewMonoSource::System.Net.Security.EncryptionPolicy;
|
||||
|
||||
using Mono.Security.Protocol.NewTls;
|
||||
using Mono.Security.Providers.NewTls;
|
||||
|
||||
using SSCX = System.Security.Cryptography.X509Certificates;
|
||||
using MX = Mono.Security.X509;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Console
|
||||
{
|
||||
using Framework;
|
||||
|
||||
public class MonoServer : MonoConnection, IServer
|
||||
{
|
||||
public ServerCertificate Certificate {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
new public IServerParameters Parameters {
|
||||
get { return (IServerParameters)base.Parameters; }
|
||||
}
|
||||
|
||||
public MonoServer (ServerFactory factory, IPEndPoint endpoint, ServerCertificate pfx, IServerParameters parameters)
|
||||
: base (factory, endpoint, parameters)
|
||||
{
|
||||
Certificate = pfx;
|
||||
}
|
||||
|
||||
protected override TlsSettings GetSettings ()
|
||||
{
|
||||
var settings = new TlsSettings ();
|
||||
if (Parameters.RequireClientCertificate)
|
||||
settings.RequireClientCertificate = true;
|
||||
else if (Parameters.AskForClientCertificate)
|
||||
settings.AskForClientCertificate = true;
|
||||
settings.RequestedCiphers = Parameters.ServerCiphers;
|
||||
return settings;
|
||||
}
|
||||
|
||||
protected override MonoNewTlsStream Start (Socket socket, TlsSettings settings)
|
||||
{
|
||||
var monoParams = Parameters as IMonoServerParameters;
|
||||
if (monoParams != null)
|
||||
settings.Instrumentation = monoParams.ServerInstrumentation;
|
||||
|
||||
settings.ClientCertValidationCallback = ClientCertValidationCallback;
|
||||
|
||||
var stream = new NetworkStream (socket);
|
||||
return MonoNewTlsStreamFactory.CreateServer (
|
||||
stream, false, null, null, EncryptionPolicy.RequireEncryption, settings,
|
||||
Certificate.Certificate, false, SslProtocols.Tls12, false);
|
||||
}
|
||||
|
||||
bool ClientCertValidationCallback (ClientCertificateParameters certParams, MX.X509Certificate certificate, MX.X509Chain chain, SslPolicyErrors sslPolicyErrors)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,99 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Net.Security;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using Mono.Security.Protocol.NewTls;
|
||||
using Mono.Security.Protocol.NewTls.Cipher;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Console
|
||||
{
|
||||
using Framework;
|
||||
|
||||
public class NativeCryptoTest : ICryptoTestProvider
|
||||
{
|
||||
static NativeCryptoTest ()
|
||||
{
|
||||
native_crypto_test_init ();
|
||||
}
|
||||
|
||||
[DllImport (NativeOpenSsl.DLL)]
|
||||
extern static void native_crypto_test_init ();
|
||||
|
||||
[DllImport (NativeOpenSsl.DLL)]
|
||||
extern static int native_crypto_test_PRF (
|
||||
int digest_mask,
|
||||
byte[] seed1, int seed1_len,
|
||||
byte[] seed2, int seed2_len,
|
||||
byte[] seed3, int seed3_len,
|
||||
byte[] seed4, int seed4_len,
|
||||
byte[] seed5, int seed5_len,
|
||||
byte[] sec, int slen,
|
||||
byte[] out1, byte[] out2, int olen);
|
||||
|
||||
[DllImport (NativeOpenSsl.DLL)]
|
||||
extern static int native_crypto_test_digest (
|
||||
int digest_mask, byte[] data, int data_len, byte[] output, int length);
|
||||
|
||||
[DllImport (NativeOpenSsl.DLL)]
|
||||
extern static int native_crypto_test_get_prf_algorithm_sha256 ();
|
||||
|
||||
[DllImport (NativeOpenSsl.DLL)]
|
||||
extern static int native_crypto_test_get_prf_algorithm_sha384 ();
|
||||
|
||||
int GetAlgorithm (HandshakeHashType algorithm)
|
||||
{
|
||||
switch (algorithm) {
|
||||
case HandshakeHashType.SHA256:
|
||||
return native_crypto_test_get_prf_algorithm_sha256 ();
|
||||
case HandshakeHashType.SHA384:
|
||||
return native_crypto_test_get_prf_algorithm_sha384 ();
|
||||
default:
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] TestPRF (HandshakeHashType algorithm, byte[] secret, string seed, byte[] data, int length)
|
||||
{
|
||||
var digest_mask = GetAlgorithm (algorithm);
|
||||
|
||||
var output = new byte [length];
|
||||
var temp = new byte [length];
|
||||
|
||||
var seedBytes = Encoding.ASCII.GetBytes (seed);
|
||||
int ret = native_crypto_test_PRF (digest_mask, seedBytes, seedBytes.Length, data, data.Length,
|
||||
null, 0, null, 0, null, 0, secret, secret.Length, output, temp, length);
|
||||
if (ret != 1)
|
||||
throw new InvalidOperationException ();
|
||||
return output;
|
||||
}
|
||||
|
||||
public byte[] TestDigest (HandshakeHashType algorithm, byte[] data)
|
||||
{
|
||||
var digest_mask = GetAlgorithm (algorithm);
|
||||
|
||||
var output = new byte [200];
|
||||
var ret = native_crypto_test_digest (digest_mask, data, data.Length, output, output.Length);
|
||||
if (ret <= 0)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
var buffer = new byte [ret];
|
||||
Buffer.BlockCopy (output, 0, buffer, 0, ret);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
public bool SupportsEncryption {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public ICryptoTestContext CreateContext ()
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,491 @@
|
|||
//
|
||||
// NativeOpenSsl.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <martin.baulig@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2014 Xamarin Inc. (http://www.xamarin.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Security;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using Mono.Security.Protocol.NewTls;
|
||||
using Mono.Security.Protocol.NewTls.Cipher;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Console
|
||||
{
|
||||
using Framework;
|
||||
|
||||
public class NativeOpenSsl : Stream
|
||||
{
|
||||
bool isClient;
|
||||
bool enableDebugging;
|
||||
OpenSslHandle handle;
|
||||
CertificateHandle certificate;
|
||||
PrivateKeyHandle privateKey;
|
||||
DebugCallback debug_callback;
|
||||
MessageCallback message_callback;
|
||||
VerifyCallback verify_callback;
|
||||
RemoteValidationCallback managed_cert_callback;
|
||||
ShutdownState shutdownState;
|
||||
TlsException lastAlert;
|
||||
|
||||
public delegate bool RemoteValidationCallback (bool ok, X509Certificate certificate);
|
||||
|
||||
class OpenSslHandle : SafeHandle
|
||||
{
|
||||
OpenSslHandle ()
|
||||
: base (IntPtr.Zero, true)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool IsInvalid {
|
||||
get { return handle == IntPtr.Zero; }
|
||||
}
|
||||
|
||||
protected override bool ReleaseHandle ()
|
||||
{
|
||||
native_openssl_destroy (handle);
|
||||
return true;
|
||||
}
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static void native_openssl_destroy (IntPtr handle);
|
||||
}
|
||||
|
||||
class CertificateHandle : SafeHandle
|
||||
{
|
||||
CertificateHandle ()
|
||||
: base (IntPtr.Zero, true)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool IsInvalid {
|
||||
get { return handle == IntPtr.Zero; }
|
||||
}
|
||||
|
||||
protected override bool ReleaseHandle ()
|
||||
{
|
||||
native_openssl_free_certificate (handle);
|
||||
return true;
|
||||
}
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static void native_openssl_free_certificate (IntPtr handle);
|
||||
}
|
||||
|
||||
class PrivateKeyHandle : SafeHandle
|
||||
{
|
||||
PrivateKeyHandle ()
|
||||
: base (IntPtr.Zero, true)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool IsInvalid {
|
||||
get { return handle == IntPtr.Zero; }
|
||||
}
|
||||
|
||||
protected override bool ReleaseHandle ()
|
||||
{
|
||||
native_openssl_free_private_key (handle);
|
||||
return true;
|
||||
}
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static void native_openssl_free_private_key (IntPtr handle);
|
||||
}
|
||||
|
||||
void OnDebugCallback (bool write, byte[] buffer)
|
||||
{
|
||||
DebugHelper.WriteLine (write ? "WRITE" : "READ", buffer);
|
||||
}
|
||||
|
||||
void OnDebugCallback (int cmd, IntPtr ptr, int size, int ret)
|
||||
{
|
||||
try {
|
||||
DebugHelper.WriteLine ("DEBUG CALLBACK: {0:x} {1:x} {2:x} {3:x}", cmd, ptr.ToInt32 (), size, ret);
|
||||
var buffer = new byte [size];
|
||||
Marshal.Copy (ptr, buffer, 0, size);
|
||||
OnDebugCallback (cmd == 0x82, buffer);
|
||||
} catch (Exception ex) {
|
||||
DebugHelper.WriteLine ("EXCEPTION IN DEBUG CALLBACK: {0}", ex);
|
||||
}
|
||||
}
|
||||
|
||||
void OnMessageCallback (int write_p, int version, int content_type, IntPtr buf, int size)
|
||||
{
|
||||
try {
|
||||
if (enableDebugging)
|
||||
DebugHelper.WriteLine ("MESSAGE CALLBACK: {0} {1:x} {2:x} {3:x} {4:x}",
|
||||
write_p, version, content_type, size, buf.ToInt32 ());
|
||||
|
||||
var buffer = new byte [size];
|
||||
Marshal.Copy (buf, buffer, 0, size);
|
||||
if (enableDebugging)
|
||||
DebugHelper.WriteLine ("MESSAGE", buffer);
|
||||
|
||||
if ((ContentType)content_type == ContentType.Alert) {
|
||||
var alert = new Alert ((AlertLevel)buffer [0], (AlertDescription)buffer [1]);
|
||||
if (enableDebugging)
|
||||
DebugHelper.WriteLine ("ALERT: {0}", alert);
|
||||
lastAlert = new TlsException (alert);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
DebugHelper.WriteLine ("EXCEPTION IN MESSAGE CALLBACK: {0}", ex);
|
||||
}
|
||||
}
|
||||
|
||||
delegate void DebugCallback (int cmd, IntPtr ptr, int size, int ret);
|
||||
|
||||
delegate void MessageCallback (int write_p, int version, int content_type, IntPtr buf, int size);
|
||||
|
||||
void CheckError (int ret)
|
||||
{
|
||||
if (ret != 0) {
|
||||
if (lastAlert != null)
|
||||
throw lastAlert;
|
||||
throw new NativeOpenSslException ((NativeOpenSslError)ret);
|
||||
}
|
||||
}
|
||||
|
||||
internal const string DLL = "NativeOpenSsl";
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static OpenSslHandle native_openssl_initialize (int debug, DebugCallback debug_callback, MessageCallback message_callback);
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static int native_openssl_create_context (OpenSslHandle handle, bool client);
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static int native_openssl_create_connection (OpenSslHandle handle);
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static int native_openssl_connect (OpenSslHandle handle, byte[] ip, int port);
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static int native_openssl_bind (OpenSslHandle handle, byte[] ip, int port);
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static int native_openssl_accept (OpenSslHandle handle);
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static int native_openssl_write (OpenSslHandle handle, byte[] buffer, int offset, int size);
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static int native_openssl_read (OpenSslHandle handle, byte[] buffer, int offset, int size);
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static CertificateHandle native_openssl_load_certificate_from_pem (OpenSslHandle handle, byte[] buffer, int len);
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static PrivateKeyHandle native_openssl_load_private_key_from_pem (OpenSslHandle handle, byte[] buffer, int len);
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static int native_openssl_load_certificate_from_pkcs12 (
|
||||
OpenSslHandle handle, byte[] buffer, int len,
|
||||
[MarshalAs (UnmanagedType.LPStr)] string password, int passlen,
|
||||
out CertificateHandle certificate, out PrivateKeyHandle privateKey);
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static int native_openssl_set_certificate (
|
||||
OpenSslHandle handle, CertificateHandle certificate, PrivateKeyHandle privateKey);
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static void native_openssl_set_certificate_verify (OpenSslHandle handle, int mode, VerifyCallback verify_cb, CertificateVerifyCallback cert_cb, int depth);
|
||||
|
||||
delegate int VerifyCallback (int ok, IntPtr store_ctx);
|
||||
|
||||
delegate int CertificateVerifyCallback (IntPtr store_ctx, IntPtr cert);
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static int X509_STORE_CTX_get_error (IntPtr store);
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static IntPtr X509_STORE_CTX_get_current_cert (IntPtr store);
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static IntPtr BIO_s_mem ();
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static IntPtr BIO_new (IntPtr method);
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static IntPtr BIO_free (IntPtr bio);
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static int native_openssl_BIO_get_mem_data (IntPtr bio, out IntPtr data);
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static int PEM_write_bio_X509 (IntPtr bio, IntPtr cert);
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static int native_openssl_shutdown (OpenSslHandle handle);
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static short native_openssl_get_current_cipher (OpenSslHandle handle);
|
||||
|
||||
[DllImport (DLL)]
|
||||
extern static int native_openssl_set_cipher_list (OpenSslHandle handle, byte[] ciphers, int count);
|
||||
|
||||
public override bool CanRead {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override bool CanWrite {
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public override bool CanSeek {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public override void Write (byte[] buffer, int offset, int size)
|
||||
{
|
||||
var ret = native_openssl_write (handle, buffer, offset, size);
|
||||
if (ret != size)
|
||||
throw new ConnectionException ("Write failed.");
|
||||
}
|
||||
|
||||
public override int Read (byte[] buffer, int offset, int size)
|
||||
{
|
||||
return native_openssl_read (handle, buffer, offset, size);
|
||||
}
|
||||
|
||||
public override void Flush ()
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
public override long Length {
|
||||
get { throw new InvalidOperationException (); }
|
||||
}
|
||||
|
||||
public override long Position {
|
||||
get { throw new InvalidOperationException (); }
|
||||
set { throw new InvalidOperationException (); }
|
||||
}
|
||||
|
||||
public override long Seek (long offset, SeekOrigin origin)
|
||||
{
|
||||
throw new InvalidOperationException ();
|
||||
}
|
||||
|
||||
public override void SetLength (long value)
|
||||
{
|
||||
throw new InvalidOperationException ();
|
||||
}
|
||||
|
||||
public NativeOpenSsl (bool isClient, bool debug)
|
||||
{
|
||||
this.isClient = isClient;
|
||||
this.enableDebugging = debug;
|
||||
|
||||
if (debug)
|
||||
debug_callback = new DebugCallback (OnDebugCallback);
|
||||
|
||||
message_callback = new MessageCallback (OnMessageCallback);
|
||||
|
||||
handle = native_openssl_initialize (debug ? 1 : 0, debug_callback, message_callback);
|
||||
if (handle.IsInvalid)
|
||||
throw new ConnectionException ("Handle invalid.");
|
||||
|
||||
var ret = native_openssl_create_context (handle, isClient);
|
||||
CheckError (ret);
|
||||
}
|
||||
|
||||
public void Connect (IPEndPoint endpoint)
|
||||
{
|
||||
if (!isClient)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
var ret = native_openssl_create_connection (handle);
|
||||
CheckError (ret);
|
||||
|
||||
ret = native_openssl_connect (handle, endpoint.Address.GetAddressBytes (), endpoint.Port);
|
||||
CheckError (ret);
|
||||
}
|
||||
|
||||
public void Bind (IPEndPoint endpoint)
|
||||
{
|
||||
if (isClient)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
var ret = native_openssl_create_connection (handle);
|
||||
CheckError (ret);
|
||||
|
||||
ret = native_openssl_bind (handle, endpoint.Address.GetAddressBytes (), endpoint.Port);
|
||||
CheckError (ret);
|
||||
}
|
||||
|
||||
public void Accept ()
|
||||
{
|
||||
var ret = native_openssl_accept (handle);
|
||||
CheckError (ret);
|
||||
}
|
||||
|
||||
public void SetCertificate (byte[] data)
|
||||
{
|
||||
native_openssl_load_certificate_from_pem (handle, data, data.Length);
|
||||
}
|
||||
|
||||
public void SetPrivateKey (byte[] data)
|
||||
{
|
||||
native_openssl_load_private_key_from_pem (handle, data, data.Length);
|
||||
}
|
||||
|
||||
public void SetCertificate (byte[] data, string password)
|
||||
{
|
||||
var ret = native_openssl_load_certificate_from_pkcs12 (
|
||||
handle, data, data.Length, password, password != null ? password.Length : 0,
|
||||
out certificate, out privateKey);
|
||||
CheckError (ret);
|
||||
|
||||
ret = native_openssl_set_certificate (handle, certificate, privateKey);
|
||||
CheckError (ret);
|
||||
}
|
||||
|
||||
static X509Certificate ReadNativeCertificate (IntPtr ptr)
|
||||
{
|
||||
var bio = BIO_new (BIO_s_mem ());
|
||||
try {
|
||||
var ret = PEM_write_bio_X509 (bio, ptr);
|
||||
if (ret <= 0)
|
||||
throw new NativeOpenSslException (NativeOpenSslError.INVALID_CERT);
|
||||
IntPtr data;
|
||||
var size = native_openssl_BIO_get_mem_data (bio, out data);
|
||||
var buffer = new byte [size];
|
||||
Marshal.Copy (data, buffer, 0, size);
|
||||
return new X509Certificate (buffer);
|
||||
} finally {
|
||||
BIO_free (bio);
|
||||
}
|
||||
}
|
||||
|
||||
int OnVerifyCallback (int ok, IntPtr store_ctx)
|
||||
{
|
||||
try {
|
||||
var cert = X509_STORE_CTX_get_current_cert (store_ctx);
|
||||
var managedCert = ReadNativeCertificate (cert);
|
||||
var ret = managed_cert_callback (ok != 0, managedCert);
|
||||
return ret ? 1 : 0;
|
||||
} catch (Exception ex) {
|
||||
DebugHelper.WriteLine ("EXCEPTION IN VERIFY CALLBACK: {0}", ex);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int OnCertificateVerifyCallback (IntPtr store_ctx, IntPtr cert)
|
||||
{
|
||||
try {
|
||||
DebugHelper.WriteLine ("CERT VERIFY CALLBACK: {0:x} {1:x}",
|
||||
store_ctx.ToInt32 (), cert.ToInt32 ());
|
||||
var managedCert = ReadNativeCertificate (cert);
|
||||
DebugHelper.WriteLine ("GOT CERTIFICATE: {0} {1}", managedCert, managedCert.Subject);
|
||||
} catch (Exception ex) {
|
||||
DebugHelper.WriteLine ("EXCEPTION IN CERT VERIFY CALLBACK: {0}", ex);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum VerifyMode {
|
||||
SSL_VERIFY_NONE= 0x00,
|
||||
SSL_VERIFY_PEER = 0x01,
|
||||
SSL_VERIFY_FAIL_IF_NO_PEER_CERT = 0x02,
|
||||
SSL_VERIFY_CLIENT_ONCE = 0x04
|
||||
}
|
||||
|
||||
public void SetCertificateVerify (VerifyMode mode, RemoteValidationCallback callback)
|
||||
{
|
||||
this.managed_cert_callback = callback;
|
||||
if (callback != null)
|
||||
verify_callback = new VerifyCallback (OnVerifyCallback);
|
||||
native_openssl_set_certificate_verify (handle, (int)mode, verify_callback, null, 10);
|
||||
}
|
||||
|
||||
enum ShutdownState {
|
||||
None,
|
||||
Error,
|
||||
Closed,
|
||||
SentShutdown
|
||||
}
|
||||
|
||||
public bool Shutdown (bool waitForReply)
|
||||
{
|
||||
if (shutdownState == ShutdownState.Error)
|
||||
return false;
|
||||
else if (shutdownState == ShutdownState.Closed)
|
||||
return true;
|
||||
var ret = native_openssl_shutdown (handle);
|
||||
if (ret == 1) {
|
||||
shutdownState = ShutdownState.Closed;
|
||||
return true;
|
||||
}
|
||||
if (!waitForReply) {
|
||||
shutdownState = ShutdownState.SentShutdown;
|
||||
return false;
|
||||
}
|
||||
ret = native_openssl_shutdown (handle);
|
||||
if (ret != 1)
|
||||
throw new IOException ("Shutdown failed.");
|
||||
shutdownState = ShutdownState.Closed;
|
||||
return true;
|
||||
}
|
||||
|
||||
public CipherSuiteCode CurrentCipher {
|
||||
get { return (CipherSuiteCode)native_openssl_get_current_cipher (handle); }
|
||||
}
|
||||
|
||||
public void SetCipherList (IList<CipherSuiteCode> ciphers)
|
||||
{
|
||||
var codes = new TlsBuffer (ciphers.Count * 2);
|
||||
for (int i = 0; i < ciphers.Count; i++)
|
||||
codes.Write ((short)ciphers [i]);
|
||||
|
||||
var ret = native_openssl_set_cipher_list (handle, codes.Buffer, ciphers.Count);
|
||||
CheckError (ret);
|
||||
}
|
||||
|
||||
protected override void Dispose (bool disposing)
|
||||
{
|
||||
if (disposing) {
|
||||
if (certificate != null) {
|
||||
certificate.Dispose ();
|
||||
certificate = null;
|
||||
}
|
||||
if (privateKey != null) {
|
||||
privateKey.Dispose ();
|
||||
privateKey = null;
|
||||
}
|
||||
if (handle != null) {
|
||||
handle.Dispose ();
|
||||
handle = null;
|
||||
}
|
||||
}
|
||||
base.Dispose (disposing);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
//
|
||||
// NativeOpenSslError.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <martin.baulig@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2014 Xamarin Inc. (http://www.xamarin.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Console
|
||||
{
|
||||
// Keep in sync with the native code
|
||||
public enum NativeOpenSslError
|
||||
{
|
||||
Ok,
|
||||
SOCKET,
|
||||
SSL_CONNECT,
|
||||
SSL_ACCEPT,
|
||||
PKCS12_LOAD,
|
||||
PKCS12_VERIFY,
|
||||
PKCS12_PARSE,
|
||||
INVALID_CERT,
|
||||
INVALID_PKEY,
|
||||
PKEY_DOES_NOT_MATCH,
|
||||
CREATE_CONTEXT,
|
||||
CREATE_CONNECTION,
|
||||
INVALID_CIPHER
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// NativeOpenSslException.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <martin.baulig@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2014 Xamarin Inc. (http://www.xamarin.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Console
|
||||
{
|
||||
public class NativeOpenSslException : Exception
|
||||
{
|
||||
public NativeOpenSslException (NativeOpenSslError error)
|
||||
: base (error.ToString ())
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Diagnostics;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Console
|
||||
{
|
||||
using Framework;
|
||||
|
||||
public class OpenSslClient : OpenSslConnection, IClient
|
||||
{
|
||||
new public IClientParameters Parameters {
|
||||
get { return (IClientParameters)base.Parameters; }
|
||||
}
|
||||
|
||||
public OpenSslClient (ClientFactory factory, IPEndPoint endpoint, IClientParameters parameters)
|
||||
: base (factory, endpoint, parameters)
|
||||
{
|
||||
}
|
||||
|
||||
CertificateAndKeyAsPEM clientPEM;
|
||||
|
||||
protected override void Initialize ()
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
protected override void CreateConnection ()
|
||||
{
|
||||
if (Parameters.ClientCertificate != null)
|
||||
openssl.SetCertificate (Parameters.ClientCertificate.Data, Parameters.ClientCertificate.Password);
|
||||
if (Parameters.ClientCiphers != null)
|
||||
openssl.SetCipherList (Parameters.ClientCiphers);
|
||||
openssl.Connect (EndPoint);
|
||||
}
|
||||
|
||||
protected override void Stop ()
|
||||
{
|
||||
base.Stop ();
|
||||
if (clientPEM != null) {
|
||||
clientPEM.Dispose ();
|
||||
clientPEM = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
//
|
||||
// OpenSslConnection.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <martin.baulig@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2014 Xamarin Inc. (http://www.xamarin.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Mono.Security.Protocol.NewTls;
|
||||
using Mono.Security.Protocol.NewTls.Cipher;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Console
|
||||
{
|
||||
using Framework;
|
||||
|
||||
public abstract class OpenSslConnection : Connection, ICommonConnection
|
||||
{
|
||||
public OpenSslConnection (ConnectionFactory factory, IPEndPoint endpoint, IConnectionParameters parameters)
|
||||
: base (factory, endpoint, parameters)
|
||||
{
|
||||
}
|
||||
|
||||
protected NativeOpenSsl openssl;
|
||||
TlsConnectionInfo connectionInfo;
|
||||
|
||||
public Stream Stream {
|
||||
get { return openssl; }
|
||||
}
|
||||
|
||||
public override TlsConnectionInfo GetConnectionInfo ()
|
||||
{
|
||||
if (connectionInfo != null)
|
||||
return connectionInfo;
|
||||
|
||||
connectionInfo = new TlsConnectionInfo {
|
||||
CipherCode = (CipherSuiteCode)openssl.CurrentCipher
|
||||
};
|
||||
|
||||
return connectionInfo;
|
||||
}
|
||||
|
||||
public sealed override Task Start ()
|
||||
{
|
||||
openssl = new NativeOpenSsl (this is IClient, Parameters.EnableDebugging);
|
||||
if (!Parameters.VerifyPeerCertificate)
|
||||
openssl.SetCertificateVerify (NativeOpenSsl.VerifyMode.SSL_VERIFY_NONE, null);
|
||||
else {
|
||||
NativeOpenSsl.VerifyMode mode = NativeOpenSsl.VerifyMode.SSL_VERIFY_PEER;
|
||||
var serverParams = Parameters as IServerParameters;
|
||||
if (serverParams != null) {
|
||||
if (serverParams.RequireClientCertificate)
|
||||
mode |= NativeOpenSsl.VerifyMode.SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
|
||||
else if (serverParams.AskForClientCertificate)
|
||||
mode |= NativeOpenSsl.VerifyMode.SSL_VERIFY_CLIENT_ONCE;
|
||||
}
|
||||
openssl.SetCertificateVerify (mode, RemoteValidationCallback);
|
||||
}
|
||||
Initialize ();
|
||||
return FinishedTask;
|
||||
}
|
||||
|
||||
protected abstract void Initialize ();
|
||||
|
||||
protected abstract void CreateConnection ();
|
||||
|
||||
public sealed override Task WaitForConnection ()
|
||||
{
|
||||
return Task.Run (() => CreateConnection ());
|
||||
}
|
||||
|
||||
public sealed override Task<bool> Shutdown (bool attemptCleanShutdown, bool waitForReply)
|
||||
{
|
||||
return Task.Run (() => {
|
||||
return openssl.Shutdown (waitForReply);
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Stop ()
|
||||
{
|
||||
if (openssl != null) {
|
||||
openssl.Dispose ();
|
||||
openssl = null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Diagnostics;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Console
|
||||
{
|
||||
using Framework;
|
||||
|
||||
public class OpenSslServer : OpenSslConnection, IServer
|
||||
{
|
||||
public ServerCertificate Certificate {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
new public IServerParameters Parameters {
|
||||
get { return (IServerParameters)base.Parameters; }
|
||||
}
|
||||
|
||||
public OpenSslServer (ServerFactory factory, IPEndPoint endpoint, ServerCertificate certificate, IServerParameters parameters)
|
||||
: base (factory, endpoint, parameters)
|
||||
{
|
||||
Certificate = certificate;
|
||||
}
|
||||
|
||||
protected override void Initialize ()
|
||||
{
|
||||
if (!IPAddress.IsLoopback (EndPoint.Address) && EndPoint.Address != IPAddress.Any)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
openssl.SetCertificate (Certificate.Data, Certificate.Password);
|
||||
openssl.Bind (EndPoint);
|
||||
}
|
||||
|
||||
protected override void CreateConnection ()
|
||||
{
|
||||
if (Parameters.ServerCiphers != null)
|
||||
openssl.SetCipherList (Parameters.ServerCiphers);
|
||||
openssl.Accept ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,347 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Reflection;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using TLS = Mono.Security.Protocol.NewTls;
|
||||
using MSI = Mono.Security.Interface;
|
||||
using Mono.Security.Providers.NewTls;
|
||||
using NUnit.Core;
|
||||
using NUnit.ConsoleRunner;
|
||||
using NDesk.Options;
|
||||
using C = System.Console;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Console
|
||||
{
|
||||
using Framework;
|
||||
using Resources;
|
||||
using Tests;
|
||||
|
||||
public class MainClass
|
||||
{
|
||||
public TestConfiguration Configuration {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
static void Main (string[] args)
|
||||
{
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
||||
|
||||
var main = new MainClass ();
|
||||
main.Run (args);
|
||||
}
|
||||
|
||||
MainClass ()
|
||||
{
|
||||
Configuration = TestConfiguration.DangerousGetInstance ();
|
||||
|
||||
var provider = new NewTlsProvider ();
|
||||
MSI.MonoTlsProviderFactory.InstallProvider (provider);
|
||||
}
|
||||
|
||||
protected virtual void Run (string[] args)
|
||||
{
|
||||
if (args.Length == 0) {
|
||||
Work ();
|
||||
return;
|
||||
}
|
||||
|
||||
var mode = args [0];
|
||||
var newArgs = new ArraySegment<string> (args, 1, args.Length - 1);
|
||||
|
||||
switch (mode) {
|
||||
case "client":
|
||||
Client (newArgs.ToArray ());
|
||||
break;
|
||||
case "server":
|
||||
Server (args);
|
||||
break;
|
||||
case "connection":
|
||||
Connection (newArgs.ToArray ());
|
||||
break;
|
||||
case "test":
|
||||
RunTests (newArgs.ToArray ());
|
||||
break;
|
||||
case "work":
|
||||
Work ();
|
||||
break;
|
||||
case "generate":
|
||||
CryptoTest.Generate (new NativeCryptoTest ());
|
||||
break;
|
||||
case "generate-cbc":
|
||||
GenerateCbc (args [1]);
|
||||
break;
|
||||
case "generate-gcm":
|
||||
GenerateGcm (args [1]);
|
||||
break;
|
||||
default:
|
||||
throw new InvalidOperationException ();
|
||||
}
|
||||
}
|
||||
|
||||
void Work ()
|
||||
{
|
||||
// Connection ("-server=openssl", "-client=openssl", "-verbose");
|
||||
// RunTests ("-include=One", "-server=mono", "-client=mono", "-verbose");
|
||||
// Client ("--client=mono", "-verbose");
|
||||
// RunTests ("-server=mono", "-client=mono", "-include=Martin");
|
||||
RunTests ("-include=Martin");
|
||||
}
|
||||
|
||||
void GenerateCbc (string filename)
|
||||
{
|
||||
using (var writer = new StreamWriter (filename)) {
|
||||
var testCbc = new TestCbcBlockCipher (Configuration, new MonoCryptoTest ());
|
||||
testCbc.Generate (writer);
|
||||
}
|
||||
}
|
||||
|
||||
void GenerateGcm (string filename)
|
||||
{
|
||||
using (var writer = new StreamWriter (filename)) {
|
||||
var testGcm = new TestGaloisCounterCipher (Configuration, new MonoCryptoTest ());
|
||||
testGcm.Generate (writer);
|
||||
}
|
||||
}
|
||||
|
||||
static void Client (params string[] args)
|
||||
{
|
||||
ClientFactory factory = Factory.DotNetClient;;
|
||||
int repeat = 0;
|
||||
|
||||
var parameters = new ClientParameters ();
|
||||
parameters.VerifyPeerCertificate = false;
|
||||
|
||||
var p = new OptionSet {
|
||||
{ "client=", v => factory = ConnectionFactoryProvider.GetClientFactory (v) },
|
||||
{ "verbose", v => parameters.EnableDebugging = true },
|
||||
{ "verify", v => parameters.VerifyPeerCertificate = true }
|
||||
};
|
||||
var extra = p.Parse (args);
|
||||
if (extra.Count != 0)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
if (parameters.VerifyPeerCertificate)
|
||||
parameters.TrustedCA = ResourceManager.LocalCACertificate;
|
||||
|
||||
if (repeat < 0)
|
||||
repeat = int.MaxValue;
|
||||
else if (repeat == 0)
|
||||
repeat = 1;
|
||||
|
||||
for (int i = 0; i < repeat; i++) {
|
||||
RunClient (factory, parameters).Wait ();
|
||||
}
|
||||
}
|
||||
|
||||
static void Server (string[] args)
|
||||
{
|
||||
var newArgs = new ArraySegment<string> (args, 1, args.Length - 1);
|
||||
ServerFactory factory = Factory.MonoServer;
|
||||
int repeat = 0;
|
||||
|
||||
var parameters = new ServerParameters ();
|
||||
|
||||
var p = new OptionSet {
|
||||
{ "server=", v => factory = ConnectionFactoryProvider.GetServerFactory (v) },
|
||||
{ "verbose", v => parameters.EnableDebugging = true },
|
||||
{ "repeat", (int v) => repeat = v }
|
||||
};
|
||||
var extra = p.Parse (newArgs);
|
||||
if (extra.Count != 0)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
if (repeat < 0)
|
||||
repeat = int.MaxValue;
|
||||
else if (repeat == 0)
|
||||
repeat = 1;
|
||||
|
||||
for (int i = 0; i < repeat; i++) {
|
||||
RunServer (factory, parameters).Wait ();
|
||||
}
|
||||
}
|
||||
|
||||
void Connection (params string[] args)
|
||||
{
|
||||
int repeat = 0;
|
||||
|
||||
var clientFactory = Factory.OpenSslClient;
|
||||
var serverFactory = Factory.OpenSslServer;
|
||||
|
||||
var parameters = new ClientAndServerParameters ();
|
||||
parameters.VerifyPeerCertificate = false;
|
||||
parameters.TrustedCA = ResourceManager.LocalCACertificate;
|
||||
|
||||
var p = new OptionSet {
|
||||
{ "verbose", v => parameters.EnableDebugging = true },
|
||||
{ "repeat=", (int v) => repeat = v },
|
||||
{ "client=", v => clientFactory = ConnectionFactoryProvider.GetClientFactory (v) },
|
||||
{ "server=", v => serverFactory = ConnectionFactoryProvider.GetServerFactory (v) },
|
||||
{ "verify", v => parameters.VerifyPeerCertificate = true },
|
||||
{ "ask-for-cert", v => parameters.AskForClientCertificate = true },
|
||||
{ "require-cert", v => parameters.RequireClientCertificate = true }
|
||||
};
|
||||
var extra = p.Parse (args);
|
||||
if (extra.Count != 0)
|
||||
throw new InvalidOperationException ();
|
||||
|
||||
if (repeat < 0)
|
||||
repeat = int.MaxValue;
|
||||
else if (repeat == 0)
|
||||
repeat = 1;
|
||||
|
||||
var factory = new ClientAndServerFactory (serverFactory, clientFactory);
|
||||
|
||||
for (int i = 0; i < repeat; i++) {
|
||||
RunWithLocalServer (factory, parameters).Wait ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static ClientParameters GetClientParameters ()
|
||||
{
|
||||
var clientParameters = new ClientParameters ();
|
||||
|
||||
clientParameters.VerifyPeerCertificate = false;
|
||||
clientParameters.TrustedCA = ResourceManager.LocalCACertificate;
|
||||
return clientParameters;
|
||||
}
|
||||
|
||||
static ClientAndServerParameters GetClientAndServerParameters ()
|
||||
{
|
||||
return new ClientAndServerParameters {
|
||||
VerifyPeerCertificate = false, TrustedCA = ResourceManager.LocalCACertificate
|
||||
};
|
||||
}
|
||||
|
||||
void LocalLoop (ClientAndServerFactory factory)
|
||||
{
|
||||
while (true) {
|
||||
RunWithLocalServer (factory).Wait ();
|
||||
}
|
||||
}
|
||||
|
||||
Task RunWithLocalServer (ClientAndServerFactory factory)
|
||||
{
|
||||
var parameters = GetClientAndServerParameters ();
|
||||
return RunWithLocalServer (factory, parameters);
|
||||
}
|
||||
|
||||
protected void PrintError (Exception ex)
|
||||
{
|
||||
var aggregate = ex as AggregateException;
|
||||
if (aggregate == null) {
|
||||
PrintSingleError (ex);
|
||||
Environment.Exit (255);
|
||||
}
|
||||
|
||||
C.WriteLine ("ERROR: {0}", aggregate.Message);
|
||||
foreach (var inner in aggregate.InnerExceptions) {
|
||||
if (inner is TaskCanceledException)
|
||||
continue;
|
||||
PrintSingleError (inner);
|
||||
}
|
||||
Environment.Exit (255);
|
||||
}
|
||||
|
||||
protected virtual void PrintSingleError (Exception ex)
|
||||
{
|
||||
var tlsEx = ex as TLS.TlsException;
|
||||
if (tlsEx != null) {
|
||||
C.WriteLine ("TLS EXCEPTION: {0}", tlsEx.Alert.Description);
|
||||
return;
|
||||
}
|
||||
|
||||
C.WriteLine ("ERROR: {0}", ex);
|
||||
}
|
||||
|
||||
async Task RunWithLocalServer (ClientAndServerFactory factory, ClientAndServerParameters parameters)
|
||||
{
|
||||
try {
|
||||
var connection = await factory.Start (parameters);
|
||||
var handler = ConnectionHandlerFactory.WaitForOkAndDone.Create (connection);
|
||||
await handler.Run ();
|
||||
connection.Dispose ();
|
||||
} catch (Exception ex) {
|
||||
PrintError (ex);
|
||||
}
|
||||
}
|
||||
|
||||
static void ServerLoop (ServerFactory factory, ServerParameters parameters)
|
||||
{
|
||||
while (true) {
|
||||
RunServer (factory, parameters).Wait ();
|
||||
}
|
||||
}
|
||||
|
||||
static async Task RunServer (ServerFactory factory, ServerParameters parameters)
|
||||
{
|
||||
using (var server = await factory.Start (parameters)) {
|
||||
var handler = ConnectionHandlerFactory.Echo.Create (server);
|
||||
await handler.Run ();
|
||||
}
|
||||
}
|
||||
|
||||
static void ClientLoop (ClientFactory factory, ClientParameters parameters)
|
||||
{
|
||||
for (int i = 0; i < 10; i++) {
|
||||
RunClient (factory, parameters).Wait ();
|
||||
Thread.Sleep (500);
|
||||
}
|
||||
}
|
||||
|
||||
static async Task RunClient (ClientFactory factory, ClientParameters parameters)
|
||||
{
|
||||
using (var client = await factory.Start (parameters)) {
|
||||
var handler = ConnectionHandlerFactory.Echo.Create (client);
|
||||
await handler.Run ();
|
||||
}
|
||||
}
|
||||
|
||||
static IPEndPoint ParseEndPoint (string text)
|
||||
{
|
||||
var pos = text.IndexOf (":");
|
||||
if (pos < 0)
|
||||
return new IPEndPoint (IPAddress.Parse (text), 4433);
|
||||
var address = IPAddress.Parse (text.Substring (0, pos));
|
||||
var port = int.Parse (text.Substring (pos + 1));
|
||||
return new IPEndPoint (address, port);
|
||||
}
|
||||
|
||||
void RunTests (params string[] args)
|
||||
{
|
||||
string clientArg = null;
|
||||
string serverArg = null;
|
||||
|
||||
var p = new OptionSet {
|
||||
{ "verbose", v => Configuration.EnableDebugging = true },
|
||||
{ "client=", v => clientArg = v },
|
||||
{ "server=", v => serverArg = v }
|
||||
};
|
||||
var extra = p.Parse (args);
|
||||
|
||||
Configuration.RegisterProvider (ConnectionFactoryProvider.GetClientAndServer (clientArg, serverArg));
|
||||
Configuration.RegisterProvider (new CryptoTestFactory ("mono"));
|
||||
|
||||
RunTestSuite (extra);
|
||||
}
|
||||
|
||||
void RunTestSuite (IList<string> extra)
|
||||
{
|
||||
var nunitArgs = new List<string> ();
|
||||
nunitArgs.Add ("-domain=none");
|
||||
nunitArgs.Add ("-nologo");
|
||||
nunitArgs.Add ("-noresult");
|
||||
nunitArgs.Add (typeof(AddIn).Assembly.Location);
|
||||
nunitArgs.AddRange (extra);
|
||||
|
||||
NUnit.ConsoleRunner.Runner.Main (nunitArgs.ToArray ());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
// Information about this assembly is defined by the following attributes.
|
||||
// Change them to the values specific to your project.
|
||||
|
||||
[assembly: AssemblyTitle("Instrumentation.Console")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("")]
|
||||
[assembly: AssemblyCopyright("martin")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
|
||||
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
|
||||
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
// The following attributes are used to specify the signing key for the assembly,
|
||||
// if desired. See the Mono documentation for more information about signing.
|
||||
|
||||
//[assembly: AssemblyDelaySign(false)]
|
||||
//[assembly: AssemblyKeyFile("")]
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="NUnitTestAdapter" version="1.2" targetFramework="net45" />
|
||||
</packages>
|
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public class CertificateAndKeyAsPEM : PrivateFile
|
||||
{
|
||||
public CertificateAndKeyAsPEM (string filename, string password)
|
||||
: base (filename, password)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public class CertificateAndKeyAsPFX : PrivateFile
|
||||
{
|
||||
public X509Certificate2 Certificate {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public CertificateAndKeyAsPFX (byte[] data, string password)
|
||||
: base (data, password)
|
||||
{
|
||||
Certificate = new X509Certificate2 (data, password);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public class CertificateAsPEM : PrivateFile
|
||||
{
|
||||
public CertificateAsPEM (byte[] data)
|
||||
: base (data, null)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
using System;
|
||||
using System.Net;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Mono.Security.Protocol.NewTls;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public class ClientAndServer : Connection
|
||||
{
|
||||
IServer server;
|
||||
IClient client;
|
||||
|
||||
public IServer Server {
|
||||
get { return server; }
|
||||
}
|
||||
|
||||
public IClient Client {
|
||||
get { return client; }
|
||||
}
|
||||
|
||||
public ClientAndServer (ClientAndServerFactory factory, IServer server, IClient client, IClientAndServerParameters parameters)
|
||||
: base (factory, server.EndPoint, parameters)
|
||||
{
|
||||
this.server = server;
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
public override TlsConnectionInfo GetConnectionInfo ()
|
||||
{
|
||||
throw new InvalidOperationException ();
|
||||
}
|
||||
|
||||
public override async Task Start ()
|
||||
{
|
||||
await server.Start ();
|
||||
await client.Start ();
|
||||
}
|
||||
|
||||
public override async Task WaitForConnection ()
|
||||
{
|
||||
var serverTask = server.WaitForConnection ();
|
||||
var clientTask = client.WaitForConnection ();
|
||||
|
||||
var t1 = clientTask.ContinueWith (t => {
|
||||
if (t.IsFaulted || t.IsCanceled)
|
||||
server.Dispose ();
|
||||
});
|
||||
var t2 = serverTask.ContinueWith (t => {
|
||||
if (t.IsFaulted || t.IsCanceled)
|
||||
client.Dispose ();
|
||||
});
|
||||
|
||||
await Task.WhenAll (serverTask, clientTask, t1, t2);
|
||||
}
|
||||
|
||||
protected override void Stop ()
|
||||
{
|
||||
client.Dispose ();
|
||||
server.Dispose ();
|
||||
}
|
||||
|
||||
public override async Task<bool> Shutdown (bool attemptCleanShutdown, bool waitForReply)
|
||||
{
|
||||
var clientShutdown = client.Shutdown (attemptCleanShutdown, waitForReply);
|
||||
var serverShutdown = server.Shutdown (attemptCleanShutdown, waitForReply);
|
||||
await Task.WhenAll (clientShutdown, serverShutdown);
|
||||
return clientShutdown.Result && serverShutdown.Result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public abstract class ClientAndServerHandler : ConnectionHandler
|
||||
{
|
||||
new public ClientAndServer Connection {
|
||||
get { return (ClientAndServer)base.Connection; }
|
||||
}
|
||||
|
||||
public ClientAndServerHandler (ClientAndServer connection)
|
||||
: base (connection)
|
||||
{
|
||||
}
|
||||
|
||||
public override Task Run ()
|
||||
{
|
||||
var serverWrapper = new StreamWrapper (Connection.Server.Stream);
|
||||
var clientWrapper = new StreamWrapper (Connection.Client.Stream);
|
||||
return MainLoop (serverWrapper, clientWrapper);
|
||||
}
|
||||
|
||||
protected abstract Task MainLoop (ILineBasedStream serverStream, ILineBasedStream clientStream);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
using Mono.Security.Protocol.NewTls;
|
||||
using Mono.Security.Protocol.NewTls.Cipher;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public class ClientAndServerParameters : ConnectionParameters, IClientAndServerParameters
|
||||
{
|
||||
bool askForCert;
|
||||
bool requireCert;
|
||||
|
||||
public CipherSuiteCollection ClientCiphers {
|
||||
get; set;
|
||||
}
|
||||
|
||||
public CipherSuiteCollection ServerCiphers {
|
||||
get; set;
|
||||
}
|
||||
|
||||
public ServerCertificate ServerCertificate {
|
||||
get; set;
|
||||
}
|
||||
|
||||
public bool AskForClientCertificate {
|
||||
get { return askForCert || requireCert; }
|
||||
set { askForCert = value; }
|
||||
}
|
||||
|
||||
public bool RequireClientCertificate {
|
||||
get { return requireCert; }
|
||||
set {
|
||||
requireCert = value;
|
||||
if (value)
|
||||
askForCert = true;
|
||||
}
|
||||
}
|
||||
|
||||
public CertificateAndKeyAsPFX ClientCertificate {
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public abstract class ClientCertificate : CertificateAndKeyAsPFX
|
||||
{
|
||||
public ClientCertificate (byte[] data, string password)
|
||||
: base (data, password)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
using Mono.Security.Protocol.NewTls;
|
||||
using Mono.Security.Protocol.NewTls.Cipher;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public class ClientParameters : ConnectionParameters, IClientParameters
|
||||
{
|
||||
public CipherSuiteCollection ClientCiphers {
|
||||
get; set;
|
||||
}
|
||||
|
||||
public CertificateAndKeyAsPFX ClientCertificate {
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public abstract class CommonConnectionHandler : ConnectionHandler
|
||||
{
|
||||
new public ICommonConnection Connection {
|
||||
get { return (ICommonConnection)base.Connection; }
|
||||
}
|
||||
|
||||
public CommonConnectionHandler (ICommonConnection connection)
|
||||
: base (connection)
|
||||
{
|
||||
}
|
||||
|
||||
public override Task Run ()
|
||||
{
|
||||
var wrapper = new StreamWrapper (Connection.Stream);
|
||||
return MainLoop (wrapper);
|
||||
}
|
||||
|
||||
protected abstract Task MainLoop (ILineBasedStream stream);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using Mono.Security.Protocol.NewTls;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public abstract class Connection : IConnection, IDisposable
|
||||
{
|
||||
public ConnectionFactory Factory {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public IPEndPoint EndPoint {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public IConnectionParameters Parameters {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
protected Connection (ConnectionFactory factory, IPEndPoint endpoint, IConnectionParameters parameters)
|
||||
{
|
||||
Factory = factory;
|
||||
EndPoint = endpoint;
|
||||
Parameters = parameters;
|
||||
}
|
||||
|
||||
public abstract Task Start ();
|
||||
|
||||
public abstract Task WaitForConnection ();
|
||||
|
||||
public abstract Task<bool> Shutdown (bool attemptCleanShutdown, bool waitForReply);
|
||||
|
||||
protected abstract void Stop ();
|
||||
|
||||
public abstract TlsConnectionInfo GetConnectionInfo ();
|
||||
|
||||
protected Task FinishedTask {
|
||||
get { return Task.FromResult<object> (null); }
|
||||
}
|
||||
|
||||
protected bool RemoteValidationCallback (bool ok, X509Certificate certificate)
|
||||
{
|
||||
Debug ("REMOTE VALIDATION CALLBACK: {0} {1}", ok, certificate.Subject);
|
||||
|
||||
if (ok)
|
||||
return true;
|
||||
if (!Parameters.VerifyPeerCertificate)
|
||||
return true;
|
||||
if (Parameters.TrustedCA == null)
|
||||
return false;
|
||||
|
||||
var caCert = new X509Certificate (Parameters.TrustedCA.Data);
|
||||
Debug ("Got Trusted CA Certificate: {0}", caCert.Subject);
|
||||
Debug ("Remote Certificate: {0}", certificate.Subject);
|
||||
|
||||
Debug ("Remote Certificate Issuer: {0}", certificate.Issuer);
|
||||
|
||||
return caCert.Subject.Equals (certificate.Issuer);
|
||||
}
|
||||
|
||||
protected X509Certificate LocalCertificateSelectionCallback (string targetHost, X509CertificateCollection localCertificates, X509Certificate remoteCertificate, string[] acceptableIssuers)
|
||||
{
|
||||
Debug ("LOCAL SELECTION CALLBACK: {0}", targetHost);
|
||||
return null;
|
||||
}
|
||||
|
||||
protected void Debug (string message, params object[] args)
|
||||
{
|
||||
if (Parameters.EnableDebugging)
|
||||
Console.WriteLine ("[{0}]: {1}", GetType ().Name, string.Format (message, args));
|
||||
}
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
Dispose (true);
|
||||
GC.SuppressFinalize (this);
|
||||
}
|
||||
|
||||
bool disposed;
|
||||
|
||||
protected virtual void Dispose (bool disposing)
|
||||
{
|
||||
lock (this) {
|
||||
if (disposed)
|
||||
return;
|
||||
disposed = true;
|
||||
}
|
||||
Stop ();
|
||||
}
|
||||
|
||||
~Connection ()
|
||||
{
|
||||
Dispose (false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public class ConnectionException : Exception
|
||||
{
|
||||
public ConnectionException (string message, params object[] args)
|
||||
: base (string.Format (message, args))
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,141 @@
|
|||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public abstract class ConnectionFactory
|
||||
{
|
||||
public abstract IConnection Create (IConnectionParameters parameters);
|
||||
|
||||
public abstract ConnectionType ConnectionType {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract bool HasConnectionInfo {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract bool SupportsCleanShutdown {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract bool CanSelectCiphers {
|
||||
get;
|
||||
}
|
||||
|
||||
public Task<IConnection> Start (IConnectionParameters parameters)
|
||||
{
|
||||
var tcs = new TaskCompletionSource<IConnection> ();
|
||||
ThreadPool.QueueUserWorkItem (_ => {
|
||||
IConnection connection = null;
|
||||
try {
|
||||
connection = Create (parameters);
|
||||
connection.Start ().Wait ();
|
||||
connection.WaitForConnection ().Wait ();
|
||||
tcs.SetResult (connection);
|
||||
} catch (Exception ex) {
|
||||
if (connection != null)
|
||||
connection.Dispose ();
|
||||
tcs.SetException (ex);
|
||||
}
|
||||
});
|
||||
return tcs.Task;
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return string.Format ("[{0}]", GetType ().Name);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class ServerFactory : ConnectionFactory
|
||||
{
|
||||
public abstract bool IsMono {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract IServer CreateServer (IServerParameters parameters);
|
||||
|
||||
public override IConnection Create (IConnectionParameters parameters)
|
||||
{
|
||||
return CreateServer ((IServerParameters)parameters);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class ClientFactory : ConnectionFactory
|
||||
{
|
||||
public abstract bool IsMono {
|
||||
get;
|
||||
}
|
||||
|
||||
public abstract IClient CreateClient (IClientParameters parameters);
|
||||
|
||||
public override IConnection Create (IConnectionParameters parameters)
|
||||
{
|
||||
return CreateClient ((IClientParameters)parameters);
|
||||
}
|
||||
}
|
||||
|
||||
public class ClientAndServerFactory : ConnectionFactory
|
||||
{
|
||||
public ServerFactory ServerFactory {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public ClientFactory ClientFactory {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public ClientAndServerFactory (ServerFactory serverFactory, ClientFactory clientFactory)
|
||||
{
|
||||
ServerFactory = serverFactory;
|
||||
ClientFactory = clientFactory;
|
||||
}
|
||||
|
||||
public override IConnection Create (IConnectionParameters parameters)
|
||||
{
|
||||
return CreateClientAndServer ((IClientAndServerParameters)parameters);
|
||||
}
|
||||
|
||||
public ClientAndServer CreateClientAndServer (IClientAndServerParameters parameters)
|
||||
{
|
||||
if (parameters == null)
|
||||
parameters = new ClientAndServerParameters ();
|
||||
return new ClientAndServer (this, ServerFactory.CreateServer (parameters), ClientFactory.CreateClient (parameters), parameters);
|
||||
}
|
||||
|
||||
public override ConnectionType ConnectionType {
|
||||
get { return ServerFactory.ConnectionType | ClientFactory.ConnectionType; }
|
||||
}
|
||||
|
||||
public bool Matches (ConnectionType connectionType)
|
||||
{
|
||||
if ((ServerFactory.ConnectionType & connectionType) == 0)
|
||||
return false;
|
||||
if ((ClientFactory.ConnectionType & connectionType) == 0)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool HasConnectionInfo {
|
||||
get { return ServerFactory.HasConnectionInfo && ClientFactory.HasConnectionInfo; }
|
||||
}
|
||||
|
||||
public override bool SupportsCleanShutdown {
|
||||
get { return ServerFactory.SupportsCleanShutdown && ClientFactory.SupportsCleanShutdown; }
|
||||
}
|
||||
|
||||
public override bool CanSelectCiphers {
|
||||
get { return ServerFactory.CanSelectCiphers && ClientFactory.CanSelectCiphers; }
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return string.Format ("{0}*{1}", ServerFactory, ClientFactory);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
//
|
||||
// ConnectionFactoryParametersAttribute.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <martin.baulig@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2015 Xamarin, Inc.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
[AttributeUsage (AttributeTargets.Class, AllowMultiple = true)]
|
||||
public class ConnectionFactoryParametersAttribute : Attribute
|
||||
{
|
||||
public ConnectionType ConnectionType {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public ConnectionFactoryParametersAttribute (ConnectionType connectionType)
|
||||
{
|
||||
ConnectionType = connectionType;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public abstract class ConnectionHandler
|
||||
{
|
||||
public IConnection Connection {
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public ConnectionHandler (IConnection connection)
|
||||
{
|
||||
Connection = connection;
|
||||
}
|
||||
|
||||
public abstract Task Run ();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public abstract class ConnectionHandlerFactory
|
||||
{
|
||||
public abstract ConnectionHandler Create (IConnection connection);
|
||||
|
||||
public static readonly ConnectionHandlerFactory OkAndDone = new SimpleFactory (c => new OkAndDoneHandler (c));
|
||||
|
||||
public static readonly ConnectionHandlerFactory Echo = new SimpleFactory (c => new EchoHandler (c));
|
||||
|
||||
public static readonly ConnectionHandlerFactory WaitForOkAndDone = new SimpleFactory (c => new WaitForOkAndDoneHandler (c));
|
||||
|
||||
public static readonly ConnectionHandlerFactory HandshakeAndDone = new SimpleFactory (c => new HandshakeAndDoneHandler (c));
|
||||
|
||||
delegate ConnectionHandler FactoryDelegate (IConnection connection);
|
||||
|
||||
class SimpleFactory : ConnectionHandlerFactory
|
||||
{
|
||||
FactoryDelegate func;
|
||||
|
||||
public SimpleFactory (FactoryDelegate func)
|
||||
{
|
||||
this.func = func;
|
||||
}
|
||||
|
||||
public override ConnectionHandler Create (IConnection connection)
|
||||
{
|
||||
return func (connection);
|
||||
}
|
||||
}
|
||||
|
||||
class OkAndDoneHandler : CommonConnectionHandler
|
||||
{
|
||||
public OkAndDoneHandler (IConnection connection)
|
||||
: base ((ICommonConnection)connection)
|
||||
{
|
||||
}
|
||||
|
||||
protected override async Task MainLoop (ILineBasedStream stream)
|
||||
{
|
||||
await stream.WriteLineAsync ("OK");
|
||||
await Connection.Shutdown (Connection.Factory.SupportsCleanShutdown, true);
|
||||
Connection.Dispose ();
|
||||
}
|
||||
}
|
||||
|
||||
class EchoHandler : CommonConnectionHandler
|
||||
{
|
||||
public EchoHandler (IConnection connection)
|
||||
: base ((ICommonConnection)connection)
|
||||
{
|
||||
}
|
||||
|
||||
protected override async Task MainLoop (ILineBasedStream stream)
|
||||
{
|
||||
string line;
|
||||
while ((line = await stream.ReadLineAsync ()) != null)
|
||||
await stream.WriteLineAsync (line);
|
||||
}
|
||||
}
|
||||
|
||||
class WaitForOkAndDoneHandler : ClientAndServerHandler
|
||||
{
|
||||
public WaitForOkAndDoneHandler (IConnection connection)
|
||||
: base ((ClientAndServer)connection)
|
||||
{
|
||||
}
|
||||
|
||||
protected override async Task MainLoop (ILineBasedStream serverStream, ILineBasedStream clientStream)
|
||||
{
|
||||
await serverStream.WriteLineAsync ("OK");
|
||||
var line = await clientStream.ReadLineAsync ();
|
||||
if (!line.Equals ("OK"))
|
||||
throw new ConnectionException ("Got unexpected output '{0}'", line);
|
||||
await Connection.Shutdown (Connection.Factory.SupportsCleanShutdown, true);
|
||||
Connection.Dispose ();
|
||||
}
|
||||
}
|
||||
|
||||
class HandshakeAndDoneHandler : ClientAndServerHandler
|
||||
{
|
||||
public HandshakeAndDoneHandler (IConnection connection)
|
||||
: base ((ClientAndServer)connection)
|
||||
{
|
||||
}
|
||||
|
||||
protected override async Task MainLoop (ILineBasedStream serverStream, ILineBasedStream clientStream)
|
||||
{
|
||||
await serverStream.WriteLineAsync ("SERVER OK");
|
||||
var line = await clientStream.ReadLineAsync ();
|
||||
if (!line.Equals ("SERVER OK"))
|
||||
throw new ConnectionException ("Got unexpected output from server: '{0}'", line);
|
||||
await clientStream.WriteLineAsync ("CLIENT OK");
|
||||
line = await serverStream.ReadLineAsync ();
|
||||
if (!line.Equals ("CLIENT OK"))
|
||||
throw new ConnectionException ("Got unexpected output from client: '{0}'", line);
|
||||
await Connection.Shutdown (Connection.Factory.SupportsCleanShutdown, true);
|
||||
Connection.Dispose ();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public class ConnectionParameters : IConnectionParameters
|
||||
{
|
||||
bool verifyPeerCertificate = true;
|
||||
|
||||
public bool VerifyPeerCertificate {
|
||||
get { return verifyPeerCertificate; }
|
||||
set { verifyPeerCertificate = value; }
|
||||
}
|
||||
|
||||
public bool EnableDebugging {
|
||||
get; set;
|
||||
}
|
||||
|
||||
public CertificateAsPEM TrustedCA {
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
[Flags]
|
||||
public enum ConnectionType
|
||||
{
|
||||
None = 0,
|
||||
|
||||
MonoClient = 1 << 1,
|
||||
DotNetClient = 1 << 2,
|
||||
OpenSslClient = 1 << 3,
|
||||
|
||||
MonoServer = 1 << 8,
|
||||
DotNetServer = 1 << 9,
|
||||
OpenSslServer = 1 << 10,
|
||||
|
||||
ClientMask = MonoClient | DotNetClient | OpenSslClient,
|
||||
ServerMask = MonoServer | DotNetServer | OpenSslServer
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
//
|
||||
// IClient.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <martin.baulig@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2014 Xamarin Inc. (http://www.xamarin.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public interface IClient : ICommonConnection
|
||||
{
|
||||
new IClientParameters Parameters {
|
||||
get;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
using System;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public interface IClientAndServerParameters : IClientParameters, IServerParameters
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
using Mono.Security.Protocol.NewTls;
|
||||
using Mono.Security.Protocol.NewTls.Cipher;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public interface IClientParameters : IConnectionParameters
|
||||
{
|
||||
CipherSuiteCollection ClientCiphers {
|
||||
get; set;
|
||||
}
|
||||
|
||||
CertificateAndKeyAsPFX ClientCertificate {
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
//
|
||||
// ICommonConnection.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <martin.baulig@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2014 Xamarin Inc. (http://www.xamarin.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
using System.IO;
|
||||
using Mono.Security.Protocol.NewTls;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public interface ICommonConnection : IConnection
|
||||
{
|
||||
Stream Stream {
|
||||
get;
|
||||
}
|
||||
|
||||
TlsConnectionInfo GetConnectionInfo ();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
//
|
||||
// IConnection.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <martin.baulig@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2014 Xamarin Inc. (http://www.xamarin.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public interface IConnection : IDisposable
|
||||
{
|
||||
ConnectionFactory Factory {
|
||||
get;
|
||||
}
|
||||
|
||||
IPEndPoint EndPoint {
|
||||
get;
|
||||
}
|
||||
|
||||
IConnectionParameters Parameters {
|
||||
get;
|
||||
}
|
||||
|
||||
Task Start ();
|
||||
|
||||
Task WaitForConnection ();
|
||||
|
||||
Task<bool> Shutdown (bool attemptCleanShutdown, bool waitForReply);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public interface IConnectionFactoryProvider : ITestParameterProvider
|
||||
{
|
||||
IEnumerable<ConnectionFactory> Factories {
|
||||
get;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public interface IConnectionParameters
|
||||
{
|
||||
bool VerifyPeerCertificate {
|
||||
get; set;
|
||||
}
|
||||
|
||||
bool EnableDebugging {
|
||||
get; set;
|
||||
}
|
||||
|
||||
CertificateAsPEM TrustedCA {
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
using System;
|
||||
using Mono.Security.Interface;
|
||||
using Mono.Security.Protocol.NewTls;
|
||||
using Mono.Security.Protocol.NewTls.Cipher;
|
||||
using Mono.Security.Protocol.NewTls.Handshake;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public interface ICryptoTestContext : IDisposable
|
||||
{
|
||||
bool EnableDebugging {
|
||||
get; set;
|
||||
}
|
||||
|
||||
byte ExtraPaddingBlocks {
|
||||
get; set;
|
||||
}
|
||||
|
||||
void InitializeCBC (CipherSuiteCode cipher, byte[] key, byte[] mac, byte[] iv);
|
||||
|
||||
void InitializeGCM (CipherSuiteCode cipher, byte[] key, byte[] implNonce, byte[] explNonce);
|
||||
|
||||
void EncryptRecord (ContentType contentType, IBufferOffsetSize input, TlsStream output);
|
||||
|
||||
IBufferOffsetSize Encrypt (IBufferOffsetSize input);
|
||||
|
||||
int Encrypt (IBufferOffsetSize input, IBufferOffsetSize output);
|
||||
|
||||
IBufferOffsetSize Decrypt (IBufferOffsetSize input);
|
||||
|
||||
int Decrypt (IBufferOffsetSize input, IBufferOffsetSize output);
|
||||
|
||||
int BlockSize {
|
||||
get;
|
||||
}
|
||||
|
||||
int GetEncryptedSize (int size);
|
||||
|
||||
int MinExtraEncryptedBytes {
|
||||
get;
|
||||
}
|
||||
|
||||
int MaxExtraEncryptedBytes {
|
||||
get;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using Mono.Security.Protocol.NewTls;
|
||||
using Mono.Security.Protocol.NewTls.Cipher;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public interface ICryptoTestProvider
|
||||
{
|
||||
byte[] TestPRF (HandshakeHashType algorithm, byte[] secret, string seed, byte[] data, int length);
|
||||
|
||||
byte[] TestDigest (HandshakeHashType algorithm, byte[] data);
|
||||
|
||||
bool SupportsEncryption {
|
||||
get;
|
||||
}
|
||||
|
||||
ICryptoTestContext CreateContext ();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public interface ILineBasedStream
|
||||
{
|
||||
Task<string> ReadLineAsync ();
|
||||
|
||||
Task WriteLineAsync (string line);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
using System;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public interface IMonoClientAndServerParameters : IMonoClientParameters, IMonoServerParameters
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
using Mono.Security.Protocol.NewTls;
|
||||
using Mono.Security.Protocol.NewTls.Instrumentation;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
using Framework;
|
||||
|
||||
public interface IMonoClientParameters : IClientParameters
|
||||
{
|
||||
ClientCertificateParameters ClientCertificateParameters {
|
||||
get; set;
|
||||
}
|
||||
|
||||
InstrumentCollection ClientInstrumentation {
|
||||
get;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
using Mono.Security.Protocol.NewTls;
|
||||
using Mono.Security.Protocol.NewTls.Instrumentation;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
using Framework;
|
||||
|
||||
public interface IMonoServerParameters : IServerParameters
|
||||
{
|
||||
InstrumentCollection ServerInstrumentation {
|
||||
get;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
//
|
||||
// IServer.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <martin.baulig@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2014 Xamarin Inc. (http://www.xamarin.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
using System;
|
||||
|
||||
namespace Mono.Security.Instrumentation.Framework
|
||||
{
|
||||
public interface IServer : ICommonConnection
|
||||
{
|
||||
ServerCertificate Certificate {
|
||||
get;
|
||||
}
|
||||
|
||||
new IServerParameters Parameters {
|
||||
get;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче