OAuth/SignatureMethod.pm

filter: Statementstmt 100% 13 / 13 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 0.0% 0 / 1 totaltotal 94.1% 16 / 17 CC 2 SCAR 4.1
CC
2
Cov
100%
secure_compare
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.5
« OAuth/AccessToken.pm ↑ Summary OAuth/ConsumerRequest.pm »
1 package Net::OAuth::SignatureMethod;
2  
3 10 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 10 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 # SPDX-SnippetBegin
7 # SPDX-SnippetCopyrightText: 2021 by Leon Timmermans.
8 # SPDX-License-Identifier: The Artistic License 2.0 (GPL Compatible)
9  
10 24 ▶sub secure_compare {
Subroutine secure_compare: called CC=2 SCAR=6.9
Pod undocumented
11 24 my ( $self, $up, $down ) = @_;
12 24 my $r = length $up != length $down;
13 24 my $left = $up . $down;
14 24 my $right = $down . $up;
15 24 $r |= ord( substr $left, $_, 1 ) ^ ord( substr $right, $_, 1 ) for 0 .. length($left) - 1;
16 24 return $r == 0;
17 }
18  
19 # SPDX-SnippetEnd
20  
21 =head1 NAME
22  
23 Net::OAuth::SignatureMethod - a base class for signature methods
24  
25 =head1 SEE ALSO
26  
27 L<Net::OAuth>
28  
29 =head1 AUTHOR
30  
31 This uses the C<secure_compare> function from L<Crypt::Passphrase::Validator> by Leon Timmermans.
32  
33 =cut
34  
35 10 1;
« OAuth/AccessToken.pm ↑ Summary OAuth/ConsumerRequest.pm »