line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::SSLeay::MainContext; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# maintains a single instance of the Crypt::SSLeay::CTX class |
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
593
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
44
|
|
6
|
2
|
|
|
2
|
|
5
|
use Carp (); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
29
|
|
7
|
2
|
|
|
2
|
|
5
|
use Exporter qw ( import ); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
61
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
8
|
use vars qw( @EXPORT @EXPORT_OK ); |
|
2
|
|
|
|
|
1
|
|
|
2
|
|
|
|
|
173
|
|
10
|
|
|
|
|
|
|
@EXPORT = (); |
11
|
|
|
|
|
|
|
@EXPORT_OK = qw( main_ctx ); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
require Crypt::SSLeay::CTX; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# The following list is taken, with appreciation, from |
16
|
|
|
|
|
|
|
# Ristic, I (2013) "OpenSSL Cookbook", Feisty Duck Ltd |
17
|
|
|
|
|
|
|
# http://amzn.to/1z8rDdj |
18
|
|
|
|
|
|
|
# |
19
|
2
|
|
|
|
|
217
|
use constant CRYPT_SSLEAY_DEFAULT_CIPHER_LIST => join( |
20
|
|
|
|
|
|
|
q{:}, qw( |
21
|
|
|
|
|
|
|
kEECDH+ECDSA |
22
|
|
|
|
|
|
|
kEECDH |
23
|
|
|
|
|
|
|
kEDH |
24
|
|
|
|
|
|
|
HIGH |
25
|
|
|
|
|
|
|
+SHA |
26
|
|
|
|
|
|
|
+RC4 |
27
|
|
|
|
|
|
|
RC4 |
28
|
|
|
|
|
|
|
!aNULL |
29
|
|
|
|
|
|
|
!eNULL |
30
|
|
|
|
|
|
|
!LOW |
31
|
|
|
|
|
|
|
!3DES |
32
|
|
|
|
|
|
|
!MD5 |
33
|
|
|
|
|
|
|
!EXP |
34
|
|
|
|
|
|
|
!DSS |
35
|
|
|
|
|
|
|
!PSK |
36
|
|
|
|
|
|
|
!SRP |
37
|
|
|
|
|
|
|
!kECDH |
38
|
|
|
|
|
|
|
!CAMELLIA |
39
|
|
|
|
|
|
|
) |
40
|
2
|
|
|
2
|
|
8
|
); |
|
2
|
|
|
|
|
2
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub main_ctx { |
43
|
|
|
|
|
|
|
my $ctx = Crypt::SSLeay::CTX->new( |
44
|
2
|
50
|
|
2
|
0
|
4850
|
$ENV{CRYPT_SSLEAY_ALLOW_SSLv3} ? 1 : 0 |
45
|
|
|
|
|
|
|
); |
46
|
|
|
|
|
|
|
|
47
|
2
|
50
|
|
|
|
118548995
|
if ($ENV{CRYPT_SSLEAY_CIPHER}) { |
48
|
0
|
|
|
|
|
0
|
$ctx->set_cipher_list($ENV{CRYPT_SSLEAY_CIPHER}); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
else { |
51
|
2
|
|
|
|
|
227
|
$ctx->set_cipher_list( |
52
|
|
|
|
|
|
|
CRYPT_SSLEAY_DEFAULT_CIPHER_LIST |
53
|
|
|
|
|
|
|
); |
54
|
|
|
|
|
|
|
} |
55
|
2
|
|
|
|
|
17
|
$ctx; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |