« DRI/Protocol/EPP/Extensions/TCI/Domain.pm
↑ Summary
DRI/Protocol/EPP/Extensions/Nomulus/Allocate.pm »
| 1 | ## Domain Registry Interface, Mark & Signed Mark for EPP (RFC7848) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | ## | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | ## Copyright (c) 2013-2016,2018 Patrick Mevzek <netdri@dotandco.com>. All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | ## | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | ## This file is part of Net::DRI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | ## | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | ## Net::DRI is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | ## it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | ## the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | ## (at your option) any later version. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | ## | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | ## See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | package Net::DRI::Protocol::EPP::Extensions::ICANN::MarkSignedMark; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 1 | ▶ | use Net::DRI::Util; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 1 | ▶ | use Net::DRI::Exception; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 1 | ▶ | use Net::DRI::Protocol::EPP::Util; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 1 | ▶ | use XML::LibXML (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 1 | ▶ | use Encode; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 1 | my $NS_XMLDSIG = 'http://www.w3.org/2000/09/xmldsig#'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | sub setup | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | ▶ | my ($class,$po,$version)=@_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
setup: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 0 | $po->ns({ 'mark' => 'urn:ietf:params:xml:ns:mark-1.0', | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 'signedMark' => 'urn:ietf:params:xml:ns:signedMark-1.0' }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | ▶ | sub implements { return 'https://tools.ietf.org/html/rfc7848'; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
implements: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 1 | my %xml2perl = ( trademark => 'trademark', | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | treatyOrStatute => 'treaty_statute', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | court => 'court', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | markName => 'mark_name', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | goodsAndServices=> 'goods_services', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | apId => 'application_id', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | apDate => 'application_date', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | regNum => 'registration_number', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | regDate => 'registration_date', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | exDate => 'expiration_date', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | refNum => 'reference_number', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | proDate => 'protection_date', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | execDate => 'execution_date', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | courtName => 'court_name', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | sub build_marks | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 0 | ▶ | my ($po,$rd)=@_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
build_marks: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('A ref array must be passed for marks, or a standalone ref hash for only one mark') unless defined $rd && (ref $rd eq 'ARRAY' || ref $rd eq 'HASH'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
defined $rd and ref $rd eq "ARRAY" || ref $rd eq "HASH"
ref $rd eq "ARRAY" or ref $rd eq "HASH"
MC/DC0%0/3
defined $rd and ref $rd eq "ARRAY" || ref $rd eq "HASH"
defined $rd
ref $rd eq "ARRAY"
ref $rd eq "HASH"
Truth table0%0/4
A and B or C
A= defined $rdB= ref $rd eq "ARRAY"C= ref $rd eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 0 | my @r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 0 | ▶ | foreach my $m (ref $rd eq 'ARRAY' ? @$rd : $rd) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 0 | push @r,['mark:mark', { 'xmlns:mark' => $po->ns()->{'mark'}}, build_mark($m)]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 0 | return @r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | sub build_mark | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 0 | ▶ | my ($rd)=@_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
build_mark: not called CC=10 SCAR=47.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 0 | my @r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters() unless defined $rd && ref $rd eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $rd and ref $rd eq "HASH"
MC/DC0%0/2
defined $rd and ref $rd eq "HASH"
defined $rd
ref $rd eq "HASH"
Truth table0%0/3
A and B
A= defined $rdB= ref $rd eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 0 | my $type=$rd->{type}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 0 | ▶ | $type='' unless defined $type; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 0 | ▶ | if ($type eq 'trademark' || exists $rd->{jurisdiction}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
Condition0%0/3
$type eq "trademark" or exists $rd->{"jurisdiction"}
MC/DC0%0/2
$type eq "trademark" or exists $rd->{"jurisdiction"}
$type eq "trademark"
exists $rd->{"jurisdiction"}
Truth table0%0/3
A or B
A= $type eq "trademark"B= exists $rd->{"jurisdiction"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | return _build_trademark($rd); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | ▶ | } elsif ($type eq 'treaty_statute' || exists $rd->{protection}) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$type eq "treaty_statute" or exists $rd->{"protection"}
MC/DC0%0/2
$type eq "treaty_statute" or exists $rd->{"protection"}
$type eq "treaty_statute"
exists $rd->{"protection"}
Truth table0%0/3
A or B
A= $type eq "treaty_statute"B= exists $rd->{"protection"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | return _build_treaty($rd); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | ▶ | } elsif ($type eq 'court' || exists $rd->{court_name}) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$type eq "court" or exists $rd->{"court_name"}
MC/DC0%0/2
$type eq "court" or exists $rd->{"court_name"}
$type eq "court"
exists $rd->{"court_name"}
Truth table0%0/3
A or B
A= $type eq "court"B= exists $rd->{"court_name"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | return _build_court($rd); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | } else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 0 | Net::DRI::Exception::usererr_invalid_parameters(qq{Unrecognized type "$type" of mark, and no "jurisdiction", "protection" or "court_name" element}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | sub _build_addr | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 0 | ▶ | my ($contact)=@_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_addr: not called CC=15 SCAR=54.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 0 | my (@r,$v); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 0 | $v=scalar $contact->street(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('Contact address must have from 1 to 3 street elements') unless defined $v && ref $v eq 'ARRAY' && @$v >=1 && @$v <= 3; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
defined $v and ref $v eq "ARRAY" and @$v >= 1 and @$v <= 3
defined $v and ref $v eq "ARRAY" and @$v >= 1
defined $v and ref $v eq "ARRAY"
MC/DC0%0/4
defined $v and ref $v eq "ARRAY" and @$v >= 1 and @$v <= 3
defined $v
ref $v eq "ARRAY"
@$v >= 1
@$v <= 3
Truth table0%0/5
A and B and C and D
A= defined $vB= ref $v eq "ARRAY"C= @$v >= 1D= @$v <= 3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 0 | push @r,map { ['mark:street',$_] } @$v; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | $v=scalar $contact->city(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('Contact address must have a city') unless defined $v; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('Contact address city must be an XML token string') unless Net::DRI::Util::xml_is_token($v); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | push @r,['mark:city',$v]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 0 | $v=scalar $contact->sp(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 0 | ▶ | if (defined $v && length $v) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $v and length $v
MC/DC0%0/2
defined $v and length $v
defined $v
length $v
Truth table0%0/3
A and B
A= defined $vB= length $v
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('Contact address sp must be an XML token string') unless Net::DRI::Util::xml_is_token($v); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | push @r,['mark:sp',$v]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | $v=scalar $contact->pc(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 0 | ▶ | if (defined $v && length $v) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $v and length $v
MC/DC0%0/2
defined $v and length $v
defined $v
length $v
Truth table0%0/3
A and B
A= defined $vB= length $v
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('Contact address pc must be an XML token string with 16 characters or less') unless Net::DRI::Util::xml_is_token($v,0,16); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 0 | push @r,['mark:pc',$v]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 0 | $v=scalar $contact->cc(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('Contact address must have a cc') unless defined $v; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('Contact address cc must be an XML token string of 2 characters') unless Net::DRI::Util::xml_is_token($v,2,2); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | push @r,['mark:cc',$v]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 0 | return @r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | sub _build_contact | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 0 | ▶ | my ($type,$contact)=@_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_contact: not called CC=24 SCAR=64.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('Element must be contact object, not: '.$contact) unless Net::DRI::Util::isa_contact($contact); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 0 | my (@r,$v); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 0 | $v=scalar $contact->name(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 0 | ▶ | if (defined $v && length $v) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $v and length $v
MC/DC0%0/2
defined $v and length $v
defined $v
length $v
Truth table0%0/3
A and B
A= defined $vB= length $v
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('Name of contact must be an XML token string, not: '.$v) unless Net::DRI::Util::xml_is_token($v); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 0 | push @r,['mark:name',$v]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | } else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('Name is mandatory for a contact') if ($type eq 'contact'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | $v=scalar $contact->org(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 0 | ▶ | if (defined $v && length $v) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $v and length $v
MC/DC0%0/2
defined $v and length $v
defined $v
length $v
Truth table0%0/3
A and B
A= defined $vB= length $v
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('Org of contact must be an XML token string, not: '.$v) unless Net::DRI::Util::xml_is_token($v); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 0 | push @r,['mark:org',$v]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('holder must have a name or org') if $type eq 'holder' && ! @r; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$type eq "holder" and not @r
MC/DC0%0/2
$type eq "holder" and not @r
$type eq "holder"
not @r
Truth table0%0/3
A and not(B)
A= $type eq "holder"B= not @r
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 0 | push @r,['mark:addr',_build_addr($contact)]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 0 | $v=$contact->voice(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 0 | ▶ | if (defined $v && length $v) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $v and length $v
MC/DC0%0/2
defined $v and length $v
defined $v
length $v
Truth table0%0/3
A and B
A= defined $vB= length $v
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('Voice of contact must be an XML token string verifying pattern "(\+[0-9]{1,3}\.[0-9]{1,14})?"') unless Net::DRI::Util::xml_is_token($v,0,17) && $v=~m/^\+[0-9]{1,3}\.[0-9]{1,14}$/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
Net::DRI::Util::xml_is_token($v, 0, 17) and $v =~ /^\+[0-9]{1,3}\.[0-9]{1,14}$/
MC/DC0%0/2
Net::DRI::Util::xml_is_token($v, 0, 17) and $v =~ /^\+[0-9]{1,3}\.[0-9]{1,14}$/
Net::DRI::Util::xml_is_token($v, 0, 17)
$v =~ /^\+[0-9]{1,3}\.[0-9]{1,14}$/
Truth table0%0/3
A and B
A= Net::DRI::Util::xml_is_token($v, 0, 17)B= $v =~ /^\+[0-9]{1,3}\.[0-9]{1,14}$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 0 | push @r,Net::DRI::Protocol::EPP::Util::build_tel('mark:voice',$v); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | } else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('Voice is mandatory for a contact') if ($type eq 'contact'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 0 | $v=$contact->fax(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 0 | ▶ | if (defined $v && length $v) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $v and length $v
MC/DC0%0/2
defined $v and length $v
defined $v
length $v
Truth table0%0/3
A and B
A= defined $vB= length $v
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('Fax of contact must be an XML token string verifying pattern "(\+[0-9]{1,3}\.[0-9]{1,14})?"') unless Net::DRI::Util::xml_is_token($v,0,17) && $v=~m/^\+[0-9]{1,3}\.[0-9]{1,14}$/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
Net::DRI::Util::xml_is_token($v, 0, 17) and $v =~ /^\+[0-9]{1,3}\.[0-9]{1,14}$/
MC/DC0%0/2
Net::DRI::Util::xml_is_token($v, 0, 17) and $v =~ /^\+[0-9]{1,3}\.[0-9]{1,14}$/
Net::DRI::Util::xml_is_token($v, 0, 17)
$v =~ /^\+[0-9]{1,3}\.[0-9]{1,14}$/
Truth table0%0/3
A and B
A= Net::DRI::Util::xml_is_token($v, 0, 17)B= $v =~ /^\+[0-9]{1,3}\.[0-9]{1,14}$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 0 | push @r,Net::DRI::Protocol::EPP::Util::build_tel('mark:fax',$v); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | $v=$contact->email(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | ▶ | if (defined $v && length $v) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $v and length $v
MC/DC0%0/2
defined $v and length $v
defined $v
length $v
Truth table0%0/3
A and B
A= defined $vB= length $v
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('Email of contact must be an XML token string with at least 1 character, not: '.$v) unless Net::DRI::Util::xml_is_token($v,1); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | push @r,['mark:email',$v]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | } else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('Email is mandatory for a contact') if ($type eq 'contact'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 0 | return @r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | sub _add_token | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 0 | ▶ | my ($rd,$key,$optional)=@_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_add_token: not called CC=6 SCAR=37.4
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | ▶ | my $pkey=exists $xml2perl{$key} ? $xml2perl{$key} : $key; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 0 | ▶ | if (Net::DRI::Util::has_key($rd,$pkey)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters(qq{Value for "$pkey" key must be an XML token string}) unless Net::DRI::Util::xml_is_token($rd->{$pkey}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 0 | return ['mark:'.$key,$rd->{$pkey}]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | } else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters(qq{"$pkey" key must exist}) unless (defined $optional && $optional); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $optional and $optional
MC/DC0%0/2
defined $optional and $optional
defined $optional
$optional
Truth table0%0/3
A and B
A= defined $optionalB= $optional
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | sub _add_datetime | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | 0 | ▶ | my ($rd,$key,$optional)=@_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_add_datetime: not called CC=6 SCAR=37.4
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | 0 | ▶ | my $pkey=exists $xml2perl{$key} ? $xml2perl{$key} : $key; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | 0 | ▶ | if (Net::DRI::Util::has_key($rd,$pkey)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters(qq{Value for "$pkey" key must be a DateTime object}) unless Net::DRI::Util::is_class($rd->{$pkey},'DateTime'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 0 | return ['mark:'.$key,Net::DRI::Util::dto2zstring($rd->{$pkey})]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | } else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters(qq{"$pkey" key must exist}) unless (defined $optional && $optional); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $optional and $optional
MC/DC0%0/2
defined $optional and $optional
defined $optional
$optional
Truth table0%0/3
A and B
A= defined $optionalB= $optional
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | sub _build_common1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | 0 | ▶ | my ($rd)=@_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_common1: not called CC=11 SCAR=48.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 0 | my @r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | 0 | push @r,_add_token($rd,'id'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('Value for "id" key must match pattern "\d+-\d+"') unless $rd->{id}=~m/^\d+-\d+$/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | 0 | push @r,_add_token($rd,'markName'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('"contact" key must exist') unless Net::DRI::Util::has_key($rd,'contact'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('Value for "contact" key must be a ContactSet object') unless Net::DRI::Util::isa_contactset($rd->{contact}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('Value for "contact" key must have at least one contact of type holder_owner, holder_assignee or holder_licensee') unless grep { /^(?:holder_owner|holder_assignee|holder_licensee)$/ } $rd->{contact}->types(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 0 | foreach my $type (qw/owner assignee licensee/) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | 0 | my @o=$rd->{contact}->get('holder_'.$type); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | 0 | ▶ | next unless @o; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 0 | foreach my $c (@o) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 0 | push @r,['mark:holder',{ entitlement => $type },_build_contact('holder',$c)]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 0 | foreach my $type (qw/owner agent thirdparty/) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | 0 | my @o=$rd->{contact}->get('contact_'.$type); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | 0 | ▶ | next unless @o; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | 0 | foreach my $c (@o) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | 0 | push @r,['mark:contact',{ type => $type },_build_contact('contact',$c)]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | 0 | return @r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | sub _build_common2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 0 | ▶ | my ($rd)=@_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_common2: not called CC=6 SCAR=37.4
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | 0 | my @r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | 0 | ▶ | if (Net::DRI::Util::has_key($rd,'label')) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | 0 | ▶ | foreach my $label (ref $rd->{label} eq 'ARRAY' ? @{$rd->{label}} : ($rd->{label})) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters(qq{Label "$label" must be an XML token string from 1 to 63 characters}) unless Net::DRI::Util::xml_is_token($label,1,63); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters(qq{Label "$label" must pass regex "[a-zA-Z0-9]([a-zA-Z0-9\-]*[a-zA-Z0-9])?"}) unless $label=~m/^[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | 0 | push @r,['mark:label',$label]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | 0 | push @r,_add_token($rd,'goodsAndServices'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | 0 | return @r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | sub _build_common3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | 0 | ▶ | my ($rd)=@_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_common3: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | 0 | my @r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | 0 | push @r,_add_token($rd,'refNum'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | 0 | push @r,_add_datetime($rd,'proDate'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | 0 | return @r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | sub _build_trademark | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | 0 | ▶ | my ($rd)=@_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_trademark: not called CC=6 SCAR=37.4
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | 0 | my @r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | 0 | push @r,_build_common1($rd); ## id/markName/holder/contact | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | 0 | push @r,_add_token($rd,'jurisdiction'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters(qq{Value for "jurisdiction" key must be an XML token string of 2 characters}) unless Net::DRI::Util::xml_is_token($rd->{jurisdiction},2,2); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | 0 | ▶ | if (Net::DRI::Util::has_key($rd,'class')) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | 0 | ▶ | foreach my $class (ref $rd->{class} eq 'ARRAY' ? @{$rd->{class}} : ($rd->{class})) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('Class must be an integer, not: '.$class) unless $class=~m/^\d+$/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | 0 | push @r,['mark:class',$class]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | 0 | push @r,_build_common2($rd); ## label/goodsAndServices | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | 0 | push @r,_add_token($rd,'apId',1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 0 | push @r,_add_datetime($rd,'apDate',1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | 0 | push @r,_add_token($rd,'regNum'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | 0 | push @r,_add_datetime($rd,'regDate'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | 0 | push @r,_add_datetime($rd,'exDate',1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | 0 | return ['mark:trademark',@r]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | sub _build_treaty | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | 0 | ▶ | my ($rd)=@_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_treaty: not called CC=10 SCAR=47.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | 0 | my @r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | 0 | push @r,_build_common1($rd); ## id/markName/holder/contact | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('Key "protection" must exist') unless Net::DRI::Util::has_key($rd,'protection'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | 0 | ▶ | foreach my $rprot (ref $rd->{protection} eq 'ARRAY' ? @{$rd->{protection}} : ($rd->{protection})) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | 0 | my @pro; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('Each protection item must be a ref hash, not: '.$rprot) unless ref $rprot eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | 0 | push @r,_add_token($rprot,'cc'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters(qq{Value for "cc" key must be an XML token string of 2 characters}) unless Net::DRI::Util::xml_is_token($rprot->{cc},2,2); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | 0 | push @r,_add_token($rprot,'region',1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | 0 | ▶ | if (Net::DRI::Util::has_key($rprot,'ruling')) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | 0 | ▶ | foreach my $ruling (ref $rprot->{ruling} eq 'ARRAY' ? @{$rprot->{ruling}} : ($rprot->{ruling})) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | 0 | push @r,_add_token({ ruling => $ruling },'ruling'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters(qq{Each "ruling" item must be an XML token string of 2 characters}) unless Net::DRI::Util::xml_is_token($ruling,2,2); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | 0 | push @r,['mark:protection',@pro]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | 0 | push @r,_build_common2($rd); ## label/goodsAndServices | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | 0 | push @r,_build_common3($rd); ## refNum/proDate | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | 0 | push @r,_add_token($rd,'title'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | 0 | push @r,_add_datetime($rd,'execDate'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | 0 | return ['mark:treatyOrStatute',@r]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | sub _build_court | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | 0 | ▶ | my ($rd)=@_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_court: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | 0 | my @r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | 0 | push @r,_build_common1($rd); ## id/markName/holder/contact | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | 0 | push @r,_build_common2($rd); ## label/goodsAndServices | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | 0 | push @r,_build_common3($rd); ## refNum/proDate | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | 0 | push @r,_add_token($rd,'cc'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters(qq{Value for "cc" key must be an XML token string of 2 characters}) unless Net::DRI::Util::xml_is_token($rd->{cc},2,2); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | 0 | ▶ | if (Net::DRI::Util::has_key($rd,'region')) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | 0 | ▶ | foreach my $region (ref $rd->{region} eq 'ARRAY' ? @{$rd->{region}} : ($rd->{region})) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | 0 | push @r,_add_token({ region => $region },'region'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | 0 | push @r,_add_token($rd,'courtName'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | 0 | return ['mark:court',@r]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | sub parse_tel | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | 0 | ▶ | my ($node)=@_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_tel: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | 0 | my $r=$node->textContent(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | 0 | ▶ | $r.='x'.$node->getAttribute('x') if $node->hasAttribute('x'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | 0 | return $r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | sub parse_contact | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | 0 | ▶ | my ($po,$start)=@_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_contact: not called CC=9 SCAR=45.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | 0 | my $contact=$po->create_local_object('contact'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($start)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | 0 | my ($name,$node)=@$el; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 399 | 0 | ▶ | if ($name=~m/^(?:name|org|email)$/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 400 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | 0 | $contact->$name($node->textContent()); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | } elsif ($name=~m/^(?:voice|fax)$/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | 0 | $contact->$name(parse_tel($node)); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 405 | } elsif ($name eq 'addr') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 406 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 407 | 0 | my @street; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 408 | 0 | foreach my $subel (Net::DRI::Util::xml_list_children($node)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 409 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 410 | 0 | my ($addrname,$addrnode)=@$subel; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 411 | 0 | ▶ | if ($addrname eq 'street') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 412 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 413 | 0 | push @street,$addrnode->textContent(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 414 | } elsif ($addrname=~m/^(?:city|sp|pc|cc)$/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 415 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 416 | 0 | $contact->$addrname($addrnode->textContent()); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 417 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 418 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 419 | 0 | $contact->street(\@street); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 420 | } elsif ($name=~m/^(?:voice|fax)$/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 421 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 422 | 0 | $contact->$name(Net::DRI::Protocol::EPP::Util::parse_tel($node)); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 423 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 424 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 425 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 426 | 0 | return $contact; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 427 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 428 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 429 | sub parse_mark | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 430 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 431 | 0 | ▶ | my ($po,$start)=@_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_mark: not called CC=21 SCAR=61.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 432 | 0 | my @marks; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 433 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 434 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($start)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 435 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 436 | 0 | my ($name,$node)=@$el; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 437 | 0 | ▶ | if ($name=~m/^(?:trademark|treatyOrStatute|court)$/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 438 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 439 | 0 | my %m=(type => $xml2perl{$name}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 440 | 0 | my (@class,@label,@protection,@region); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 441 | 0 | my $cs=$po->create_local_object('contactset'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 442 | 0 | foreach my $subel (Net::DRI::Util::xml_list_children($node)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 443 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 444 | 0 | my ($mname,$mnode)=@$subel; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 445 | 0 | ▶ | if ($mname=~m/^(id|markName|jurisdiction|goodsAndServices|apId|regNum|refNum|title|cc|courtName)$/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 8 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 446 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 447 | 0 | ▶ | $m{exists $xml2perl{$mname} ? $xml2perl{$mname} : $mname}=$mnode->textContent(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 448 | } elsif ($mname eq 'holder') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 449 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 450 | 0 | my $type='holder_'.$mnode->getAttribute('entitlement'); ## owner, assignee, licensee | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 451 | 0 | $cs->add(parse_contact($po,$mnode),$type); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 452 | } elsif ($mname eq 'contact') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 453 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 454 | 0 | my $type='contact_'.$mnode->getAttribute('type'); ## owner, agent, thirdparty | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 455 | 0 | $cs->add(parse_contact($po,$mnode),$type); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 456 | } elsif ($mname eq 'class') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 457 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 458 | 0 | push @class,$mnode->textContent(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 459 | } elsif ($mname eq 'label') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 461 | 0 | push @label,$mnode->textContent(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 462 | } elsif ($mname=~m/^(?:apDate|regDate|exDate|proDate|execDate)$/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 463 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 464 | 0 | $m{$xml2perl{$mname}}=$po->parse_iso8601($mnode->textContent()); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 465 | } elsif ($mname eq 'protection') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 466 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 467 | 0 | my %p; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 468 | 0 | foreach my $pel (Net::DRI::Util::xml_list_children($mnode)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 469 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 470 | 0 | my ($pname,$pnode)=@$pel; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 471 | 0 | ▶ | if ($pname=~m/^(cc|region)$/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 472 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 473 | 0 | $p{$pname}=$pnode->textContent(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 474 | } elsif ($pname eq 'ruling') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 475 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 476 | 0 | push @{$p{ruling}},$pnode->textContent(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 477 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 478 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 479 | 0 | push @protection,\%p; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 480 | } elsif ($mname eq 'region') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 481 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 482 | 0 | push @region,$mnode->textContent(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 483 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 484 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 485 | 0 | $m{contact}=$cs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 486 | 0 | ▶ | $m{class}=\@class if @class; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 487 | 0 | ▶ | $m{label}=\@label if @label; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 488 | 0 | ▶ | $m{protection}=\@protection if @protection; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 489 | 0 | ▶ | $m{region}=\@region if @region; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 490 | 0 | ▶ | if (exists $m{goods_services}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 491 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 492 | 0 | $m{goods_services}=~s/\n +/ /g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 493 | 0 | $m{goods_services}=~s/ +$//s; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 494 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 495 | 0 | push @marks,\%m; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 496 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 497 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 498 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 499 | 0 | return \@marks; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 500 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 501 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 502 | sub lined_content | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 503 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 504 | 0 | ▶ | my ($node,$signs,@keys)=@_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
lined_content: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 505 | 0 | my $r=Net::DRI::Util::xml_traverse($node,$signs,@keys); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 506 | 0 | ▶ | return unless defined $r; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 507 | 0 | $r=$r->textContent(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 508 | 0 | $r=~s/\s+//g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 509 | 0 | return $r; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 510 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 511 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 512 | sub parse_signed_mark | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 513 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 514 | 0 | ▶ | my ($po,$start,$xmlsec)=@_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_signed_mark: not called CC=13 SCAR=52.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 515 | 0 | my %smark; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 516 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 517 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($start)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 518 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 519 | 0 | my ($name,$node)=@$el; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 520 | 0 | ▶ | if ($name eq 'id') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 6 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 521 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 522 | 0 | $smark{id}=$node->textContent(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 523 | } elsif ($name eq 'issuerInfo') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 524 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 525 | 0 | my %issuer=(id => $node->getAttribute('issuerID')); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 526 | 0 | foreach my $iel (Net::DRI::Util::xml_list_children($node)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 527 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 528 | 0 | my ($iname,$inode)=@$iel; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 529 | 0 | ▶ | if ($iname=~m/^(?:org|email|url)$/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 530 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 531 | 0 | $issuer{$iname}=$inode->textContent(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 532 | } elsif ($iname eq 'voice') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 533 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 534 | 0 | $issuer{$iname}=parse_tel($inode); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 535 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 536 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 537 | 0 | $smark{issuer}=\%issuer; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 538 | } elsif ($name eq 'notBefore') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 539 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 540 | 0 | $smark{'creation_date'}=$po->parse_iso8601($node->textContent()); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 541 | } elsif ($name eq 'notAfter') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 542 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 543 | 0 | $smark{'expiration_date'}=$po->parse_iso8601($node->textContent()); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 544 | } elsif ($name eq 'mark') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 545 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 546 | 0 | $smark{mark}=parse_mark($po,$node); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 547 | } elsif ($name eq 'Signature') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 548 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 549 | 0 | my %s=(id => $start->getAttribute('id')); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 550 | 0 | $s{'value'}=lined_content($node,$NS_XMLDSIG,qw/SignatureValue/); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 551 | ## TODO: handle other algorithms | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 552 | 0 | $s{'key'}={ algorithm => 'rsa', | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 553 | x509_certificate => lined_content($node,$NS_XMLDSIG,qw/KeyInfo X509Data X509Certificate/), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 554 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 555 | 0 | ▶ | $s{'validated'}=(defined $xmlsec && $xmlsec) ? _validate_xmldsig($start) : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $xmlsec and $xmlsec
MC/DC0%0/2
defined $xmlsec and $xmlsec
defined $xmlsec
$xmlsec
Truth table0%0/3
A and B
A= defined $xmlsecB= $xmlsec
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 556 | 0 | $smark{'signature'}=\%s; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 557 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 558 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 559 | 0 | return \%smark; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 560 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 561 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 562 | sub _validate_xmldsig | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 563 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 564 | 0 | ▶ | my ($xml,$rs)=@_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_validate_xmldsig: not called CC=9 SCAR=45.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 565 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 566 | 0 | require XML::LibXML::XPathContext; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 567 | 0 | require Digest::SHA; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 568 | 0 | require Crypt::OpenSSL::X509; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 569 | 0 | require Crypt::OpenSSL::RSA; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 570 | 0 | require MIME::Base64; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 571 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 572 | 0 | my $xpc=XML::LibXML::XPathContext->new(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 573 | 0 | $xpc->registerNs('ds', $NS_XMLDSIG); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 574 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 575 | 0 | foreach my $node ($xpc->findnodes('//ds:Reference',$xml)) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 576 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 577 | 0 | my $for=$node->getAttribute('URI'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 578 | 0 | $for=~s/^#//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 579 | 0 | my $cnode=$xpc->findnodes("//*[\@id='${for}' or \@Id='${for}']",$xml); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 580 | 0 | ▶ | return 0 unless $cnode->size() == 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 581 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 582 | 0 | $cnode=$cnode->get_node(1); ## node on which we perform the digest operation | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 583 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 584 | 0 | my %algos=map { $_->getAttribute('Algorithm') => 1 } $xpc->findnodes('ds:Transforms/ds:Transform',$node); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 585 | 0 | ▶ | return 0 unless exists $algos{'http://www.w3.org/2001/10/xml-exc-c14n#'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 586 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 587 | 0 | ▶ | my $xmlstring=$cnode->toStringEC14N(0,exists $algos{$NS_XMLDSIG.'enveloped-signature'} ? q{(. | .//node() | .//@* | .//namespace::*)[not(self::comment() or ancestor-or-self::ds:Signature)]} : undef,$xpc); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 588 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 589 | 0 | ▶ | return 0 unless defined $xmlstring && $xpc->findnodes('ds:DigestValue',$node)->get_node(1)->textContent() eq _sha256b64padded($xmlstring); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $xmlstring and $xpc->findnodes("ds:DigestValue", $node)->get_node(1)->textContent eq _sha256b64padded($xmlstring)
MC/DC0%0/2
defined $xmlstring and $xpc->findnodes("ds:DigestValue", $node)->get_node(1)->textContent eq _sha256b64padded($xmlstring)
defined $xmlstring
$xpc->findnodes("ds:DigestValue", $node)->get_node(1)->textContent eq _sha256b64padded($xmlstring)
Truth table0%0/3
A and B
A= defined $xmlstringB= $xpc->findnodes("ds:DigestValue", $node)->get_node(1)->textContent eq _sha256b64padded($xmlstring)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 590 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 591 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 592 | 0 | my $cert=$xpc->findnodes('//ds:X509Certificate',$xml)->get_node(1)->textContent(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 593 | 0 | $cert=~s/ /\n/g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 594 | 0 | my $certobj=Crypt::OpenSSL::X509->new_from_string("-----BEGIN CERTIFICATE-----\n".$cert."\n-----END CERTIFICATE-----", Crypt::OpenSSL::X509::FORMAT_PEM()); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 595 | 0 | my $key=Crypt::OpenSSL::RSA->new_public_key($certobj->pubkey()); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 596 | 0 | $key->use_sha256_hash(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 597 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 598 | 0 | my $xmlsi=$xpc->find('//ds:SignedInfo',$xml)->get_node(1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 599 | 0 | $xmlsi->setNamespace($NS_XMLDSIG,'ds',0); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 600 | 0 | my $sigval=$xpc->findnodes('//ds:SignatureValue',$xmlsi)->get_node(1)->textContent(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 601 | 0 | $sigval=~s!\s+!!g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 602 | 0 | my $verify=$key->verify($xmlsi->toStringEC14N(0), MIME::Base64::decode_base64($sigval)); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 603 | 0 | ▶ | return (defined $verify && $verify) ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $verify and $verify
MC/DC0%0/2
defined $verify and $verify
defined $verify
$verify
Truth table0%0/3
A and B
A= defined $verifyB= $verify
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 604 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 605 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 606 | sub _sha256b64padded | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 607 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 608 | 0 | ▶ | my ($in)=@_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_sha256b64padded: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 609 | 0 | my $out = Digest::SHA::sha256_base64($in); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 610 | 0 | ▶ | while (length($out) % 4) { $out .= '='; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 611 | 0 | return $out; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 612 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 613 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 614 | sub parse_encoded_signed_mark | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 615 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 616 | 0 | ▶ | my ($po,$start,$xmlsec)=@_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_encoded_signed_mark: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 617 | 0 | my $content; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 618 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 619 | 0 | ▶ | if (ref $start) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 620 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 621 | 0 | ▶ | my $encoding=$start->hasAttribute('encoding') ? $start->getAttribute('encoding') : 'base64'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 622 | 0 | ▶ | Net::DRI::Exception::err_invalid_parameter('For encoded signed mark, only base64 encoding is supported') unless $encoding eq 'base64'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 623 | 0 | $content=$start->textContent(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 624 | } else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 625 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 626 | 0 | my @a=grep { /-----BEGIN ENCODED SMD-----/ .. /-----END ENCODED SMD-----/ } split(/\n/,$start); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 627 | 0 | $content=join("\n",@a[1..($#a-1)]); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 628 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 629 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 630 | 0 | require MIME::Base64; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 631 | 0 | my $xml=MIME::Base64::decode_base64($content); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 632 | 0 | $xml=Encode::decode('UTF-8',$xml,Encode::FB_CROAK | Encode::LEAVE_SRC); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 633 | 0 | my $root=XML::LibXML->load_xml(no_cdata => 1, no_blanks => 1, no_network => 1, string => $xml)->documentElement(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 634 | 0 | ▶ | Net::DRI::Exception::err_invalid_parameter('Decoding should give a signedMark root element') unless $root->localname() eq 'signedMark'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 635 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 636 | 0 | return parse_signed_mark($po,$root,$xmlsec); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 637 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 638 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 639 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 640 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 641 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 642 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 643 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 644 | =pod | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 645 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 646 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 647 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 648 | Net::DRI::Protocol::EPP::Extensions::ICANN::MarkSignedMark - ICANN TMCH Mark/Signed Mark EPP Extension (RFC 7848) for Net::DRI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 649 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 650 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 651 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 652 | Please see the README file for details. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 653 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 654 | =head1 SUPPORT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 655 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 656 | For now, support questions should be sent to: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 657 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 658 | E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 659 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 660 | Please also see the SUPPORT file in the distribution. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 661 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 662 | =head1 SEE ALSO | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 663 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 664 | E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 665 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 666 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 667 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 668 | Patrick Mevzek, E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 669 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 670 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 671 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 672 | Copyright (c) 2013-2016,2018 Patrick Mevzek <netdri@dotandco.com>. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 673 | All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 674 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 675 | This program is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 676 | it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 677 | the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 678 | (at your option) any later version. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 679 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 680 | See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 681 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 682 | =cut | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||