line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::Session::ID::crypt_openssl; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
32114
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
50
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
CGI::Session::ID::crypt_openssl - CGI::Session ID driver for generating IDs based on Crypt::OpenSSL::Random |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Version 1.02 |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
$CGI::Session::ID::crypt_openssl::VERSION = '1.02'; |
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
1790
|
use CGI::Session::ErrorHandler; |
|
1
|
|
|
|
|
285
|
|
|
1
|
|
|
|
|
215
|
|
19
|
|
|
|
|
|
|
@CGI::Session::ID::crypt_openssl::ISA = qw/CGI::Session::ErrorHandler/; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 SYNOPSIS |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
use CGI::Session; |
24
|
|
|
|
|
|
|
$session = CGI::Session->new('id:crypt_openssl', undef); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=cut |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub generate_id { |
29
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
30
|
0
|
|
0
|
|
|
|
my $random = Crypt::OpenSSL::Random::random_bytes(16) || $$. time(). rand(time); |
31
|
0
|
|
|
|
|
|
my $md5 = new Digest::MD5(); |
32
|
0
|
|
|
|
|
|
$md5->add( $random ); |
33
|
0
|
|
|
|
|
|
return $md5->hexdigest(); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 DESCRIPTION |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Use this module to generate hexadecimal IDs generated with |
39
|
|
|
|
|
|
|
L for L objects. This library does not |
40
|
|
|
|
|
|
|
require any arguments. Use this module to generate security IDs with a high |
41
|
|
|
|
|
|
|
level of randomnes. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 METHODS |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=over 4 |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=item generate_id() |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
This subroutine is calling by the L Module to generate an ID for the session. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=back |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 AUTHOR |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Helmut Weber, C<< >> |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 CREDITS |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
My Sweetheart Sabrina and my lovely childs Jolina and Marcella |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Mark Stosberg for the great support |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Copyright (c) 2013 bitbetrieb. All rights reserved. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
68
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
69
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 SEE ALSO |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
L, |
76
|
|
|
|
|
|
|
L, |
77
|
|
|
|
|
|
|
L |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=cut |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
1; # End of CGI::Session::ID::crypt_openssl |