summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Jenkinsfile14
-rw-r--r--lib/OPMode.pm31
2 files changed, 33 insertions, 12 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
index b11267e..3b8daeb 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -73,7 +73,8 @@ pipeline {
agent {
docker {
args '--sysctl net.ipv6.conf.lo.disable_ipv6=0 -e GOSU_UID=1006 -e GOSU_GID=1006'
- image 'vyos/vyos-build:equuleus'
+ image 'vyos/vyos-build:current'
+ alwaysPull true
}
}
options {
@@ -87,7 +88,8 @@ pipeline {
steps {
script {
dir('build') {
- git branch: getGitBranchName(), url: getGitRepoURL()
+ git branch: getGitBranchName(),
+ url: getGitRepoURL()
}
}
}
@@ -96,7 +98,10 @@ pipeline {
steps {
script {
dir('build') {
- sh "dpkg-buildpackage -b -us -uc -tc"
+ def commitId = sh(returnStdout: true, script: 'git rev-parse --short=11 HEAD').trim()
+ currentBuild.description = sprintf('Git SHA1: %s', commitId[-11..-1])
+
+ sh 'dpkg-buildpackage -b -us -uc -tc'
}
}
}
@@ -118,9 +123,6 @@ pipeline {
// every option over and over again!
def VYOS_REPO_PATH = '/home/sentrium/web/dev.packages.vyos.net/public_html/repositories/' + getGitBranchName() + '/'
- if (getGitBranchName() != "equuleus")
- VYOS_REPO_PATH += 'vyos/'
-
def SSH_OPTS = '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=ERROR'
def SSH_REMOTE = 'khagen@10.217.48.113'
diff --git a/lib/OPMode.pm b/lib/OPMode.pm
index 38bea1c..013e896 100644
--- a/lib/OPMode.pm
+++ b/lib/OPMode.pm
@@ -97,6 +97,17 @@ sub conv_hash {
return $hash;
}
+sub is_it_hash_algo {
+ my $hash = pop(@_);
+ my $hash = conv_hash($hash);
+ if ($hash =~ /sha(.*)/ || $hash =~ /md5(.*)/){
+ return 'true';
+ }
+ else {
+ return 'false';
+ }
+}
+
sub conv_enc {
my $enc = pop(@_);
if ($enc =~ /(.*?)_.*?_(.*)/){
@@ -635,17 +646,25 @@ sub process_tunnels{
$tunnel_hash{$connectid}->{_ikehash} = $2;
$tunnel_hash{$connectid}->{_dhgrp} = $4;
+ } elsif ($line =~ /\]:\s+IKE.proposal:(.*?)\/(.*?)\/(.*)/) { # gcm encryption algo case where hash algo not present
+ $tunnel_hash{$connectid}->{_ikeencrypt} = $1;
+ $tunnel_hash{$connectid}->{_ikehash} = 'n/a';
+ $tunnel_hash{$connectid}->{_dhgrp} = $3;
+
} elsif ($line =~ /{(\d+)}:\s+INSTALLED.*ESP.*SPIs: (.*)_i (.*)_o/) {
$esp_hash{$connectid}{$1}->{_inspi} = $2;
$esp_hash{$connectid}{$1}->{_outspi} = $3;
- } elsif ($line =~ /{(\d+)}:\s+(.*?)\/(.*?), (\d+) bytes_i.* (\d+) bytes_o.*rekeying (disabled|in .*)/) {
+ } elsif ($line =~ /{(\d+)}:\s+(.*?), (\d+) bytes_i.* (\d+) bytes_o.*rekeying (disabled|in .*)/) {
my $esp_id = $1;
- $esp_hash{$connectid}{$esp_id}->{_encryption} = $2;
- $esp_hash{$connectid}{$esp_id}->{_hash} = $3;
- $esp_hash{$connectid}{$esp_id}->{_inbytes} = $4;
- $esp_hash{$connectid}{$esp_id}->{_outbytes} = $5;
- $esp_hash{$connectid}{$esp_id}->{_expire} = conv_time($6);
+ my @proposal = split('/', $2);
+ my $encryption = $proposal[0];
+ my $is_hash = is_it_hash_algo($proposal[1]);
+ $esp_hash{$connectid}{$esp_id}->{_encryption} = $encryption;
+ $esp_hash{$connectid}{$esp_id}->{_hash} = $is_hash eq 'true' ? $proposal[1] : 'n/a';
+ $esp_hash{$connectid}{$esp_id}->{_inbytes} = $3;
+ $esp_hash{$connectid}{$esp_id}->{_outbytes} = $4;
+ $esp_hash{$connectid}{$esp_id}->{_expire} = conv_time($5);
my $last_used = 1000;
$last_used = $1 if ($line =~ /\((\d+)s ago\)/);