Update certutils

This commit is contained in:
Diederik de Groot
2019-03-23 17:19:34 +01:00
parent e0402a9ca3
commit 1c6b4ae7eb
9 changed files with 578 additions and 583 deletions

View File

@@ -23,11 +23,11 @@
<member priority="0">
<callManager>
<name>moviebox</name>
<ipv6Addr>2001:471:2f25:3ce::466</ipv6Addr>
<ipv6Addr>2001:471:2f25:3ce::3</ipv6Addr>
<ports>
<ethernetPhonePort>2000</ethernetPhonePort>
</ports>
<processNodeName>192.168.0.3</processNodeName>
<processNodeName>192.168.187.3</processNodeName>
</callManager>
</member>
<member priority="1">
@@ -35,7 +35,7 @@
<ports>
<ethernetPhonePort>2000</ethernetPhonePort>
</ports>
<processNodeName>192.168.0.2</processNodeName>
<processNodeName>192.168.187.3</processNodeName>
</callManager>
</member>
</members>
@@ -68,6 +68,7 @@
<loadInformation00436 model="Cisco IP Phone 7965">SCCP45.9-3-1SR1-1S</loadInformation00436>
<loadInformation00437 model="Cisco IP Phone 7975">SCCP75.9-4-2SR3-1S</loadInformation00437>
<loadInformation00495 model="Cisco IP Phone 6921">SCCP69xx.9-4-1-3SR3</loadInformation00495>
<!--<loadInformation00495 model="Cisco IP Phone 6921">SCCP69xx.9-3-1-3</loadInformation00495>-->
<loadInformation00496 model="Cisco IP Phone 6941">SCCP69xx.9-3-1-3</loadInformation00496>
<loadInformation00497 model="Cisco IP Phone 6961">SCCP69xx.9-3-1-3</loadInformation00497>
<loadInformation00547 model="Cisco IP Phone 6901">SCCP6901.9-2-1-a</loadInformation00547>
@@ -113,9 +114,9 @@
</commonProfile>
<vendorConfig>
<logServer>192.168.0.3</logServer>
<syslogServer>192.168.0.3</syslogServer>
<debugServer>192.168.0.3</debugServer>
<logServer>192.168.178.3</logServer>
<syslogServer>192.168.178.3</syslogServer>
<debugServer>192.168.178.3</debugServer>
<debugLevel>3</debugLevel>
<disableSpeaker>false</disableSpeaker>
<disableSpeakerAndHeadset>false</disableSpeakerAndHeadset>
@@ -223,12 +224,12 @@
<userId>9999</userId>
<!-- Begin URL's -->
<idleURL>http://192.168.0.3/idle.php</idleURL>
<authenticationURL>http://192.168.0.3/authenticate.php</authenticationURL>
<informationURL>http://192.168.0.3/cisco_menu/help/help.php</informationURL>
<idleURL>http://192.168.178.3/idle.php</idleURL>
<authenticationURL>http://192.168.178.3/authenticate.php</authenticationURL>
<informationURL>http://192.168.178.3/cisco_menu/help/help.php</informationURL>
<messagesURL/>
<proxyServerURL/>
<servicesURL>http://192.168.0.3/tests.xml</servicesURL>
<directoryURL>http://192.168.0.3/cisco_menu/directory/menu.php</directoryURL>
<servicesURL>http://192.168.178.3/tests.xml</servicesURL>
<directoryURL>http://192.168.178.3/cisco_menu/directory/menu.php</directoryURL>
<!-- End URL's -->
</Default>

View File

@@ -15,8 +15,7 @@ our %EXPORT_TAGS = (header => [qw/HEADER_VERSION HEADER_LENGTH HEADER_SIGNER_I
RECORD_SERIAL_NUMBER RECORD_PUBLIC_KEY RECORD_SIGNATURE RECORD_CERTIFICATE
RECORD_IP_ADDRESS RECORD_CERTIFICATE_HASH RECORD_HASH_ALGORITHM/],
digest => [qw/DIGEST_SHA1 DIGEST_SHA256 DIGEST_SHA384 DIGEST_SHA512/],
function => [qw/FUNCTION_SAST FUNCTION_CCM FUNCTION_CCM_TFTP FUNCTION_TFTP FUNCTION_CAPF FUNCTION_SRST
FUNCTION_HTTPS FUNCTION_TVS/]);
function => [qw/FUNCTION_SAST FUNCTION_CCM FUNCTION_CCM_TFTP FUNCTION_TFTP FUNCTION_HTTPS/]);
our @EXPORT_OK = (@{$EXPORT_TAGS{header}}, @{$EXPORT_TAGS{record}}, @{$EXPORT_TAGS{digest}}, @{$EXPORT_TAGS{function}});

View File

@@ -30,7 +30,14 @@ eval {
my $digest = Digest->new ('SHA-1');
$digest->add ($x509->as_string (FORMAT_ASN1));
print $digest->b64digest, "\n";
$content = $digest->b64digest;
# Digest must be padded to a 4 byte length
while (length ($content) % 4) {
$content .= '=';
}
print $content, "\n";
};
if (length $EVAL_ERROR) {

View File

@@ -370,7 +370,7 @@ eval {
build_sgn ($content_file, $certificate_file, $digest_algorithm, $filename);
} else {
die 'No mode specified';
die 'No mode specified, choose ether --build, --parse or --help for available options';
}
};

View File

@@ -185,14 +185,8 @@ sub parse_tlv {
print 'CCM+TFTP';
} elsif ($function == FUNCTION_TFTP) {
print 'TFTP';
} elsif ($function == FUNCTION_CAPF) {
print 'CAPF';
} elsif ($function == FUNCTION_SRST) {
print 'SRST';
} elsif ($function == FUNCTION_HTTPS) {
print 'HTTPS';
} elsif ($function == FUNCTION_TVS) {
print 'TVS';
}
print "\n";
@@ -438,14 +432,8 @@ sub build_tlv {
FUNCTION_CCM_TFTP;
} elsif ($function eq 'TFTP') {
FUNCTION_TFTP;
} elsif ($function eq 'CAPF') {
FUNCTION_CAPF;
} elsif ($function eq 'SRST') {
FUNCTION_SRST;
} elsif ($function eq 'HTTPS') {
FUNCTION_HTTPS;
} elsif ($function eq 'TVS') {
FUNCTION_TVS;
} else {
die 'Unknown record function: ' . $function;
};
@@ -556,7 +544,7 @@ eval {
build_tlv ($tlv_file, $certificate_file, $digest_algorithm, $filename, $records);
} else {
die 'No mode specified';
die 'No mode specified, choose either --build, --parse or --help for available options';
}
};