File tree Expand file tree Collapse file tree 6 files changed +50
-18
lines changed Expand file tree Collapse file tree 6 files changed +50
-18
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ KERNEL_TYPE.esx := generic
22
22
KERNEL_TYPE.gcp := gcp
23
23
KERNEL_TYPE.kvm := kvm
24
24
25
+ DELPHIX_SIGNATURE_TYPES = registration upgrade
26
+
25
27
#
26
28
# The following meta-package consolidates all the kernel packages required
27
29
# by the Delphix Appliance for a given platform. Note that delphix-kernel
@@ -166,8 +168,9 @@ override_dh_install:
166
168
>debian/tmp/var/lib/delphix-appliance/platform
167
169
rm debian/tmp/var/lib/delphix-appliance/platform.in
168
170
169
- ./scripts/download-signature-key.sh upgrade 5.3 \
170
- >debian/tmp/var/lib/delphix-appliance/key-public.pem.upgrade.5.3
171
+ for type in $(DELPHIX_SIGNATURE_TYPES) ; do \
172
+ ./scripts/download-signature-key.sh $$type "$(DELPHIX_SIGNATURE_VERSION)" \
173
+ >"debian/tmp/var/lib/delphix-appliance/key-public.pem.$$type.$(DELPHIX_SIGNATURE_VERSION)" ; done
171
174
172
175
dh_install --autodest "debian/tmp/*"
173
176
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ #
3
+ # Copyright 2019 Delphix
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+ set -o errexit
19
+ set -o pipefail
20
+
21
+ zfs get -Hpo value \
22
+ " com.delphix:current-version" \
23
+ " $( dirname " $( zfs list -Hpo name /) " ) " | tr -d ' \n'
Original file line number Diff line number Diff line change @@ -80,21 +80,23 @@ UNPACK_DIR=$(mktemp -d -p "$UPDATE_DIR" -t unpack.XXXXXXX)
80
80
[[ -d " $UNPACK_DIR " ]] || die " failed to create unpack directory '$UNPACK_DIR '"
81
81
pushd " $UNPACK_DIR " & > /dev/null || die " 'pushd $UNPACK_DIR ' failed"
82
82
83
- tar -x SHA256SUMS SHA256SUMS.sig.5.3 version.info -f " $UPGRADE_IMAGE_PATH " ||
83
+ DELPHIX_SIGNATURE_VERSION=$( /usr/bin/get-appliance-version | cut -d - -f 1 | cut -d . -f 1-2)
84
+
85
+ tar -x SHA256SUMS SHA256SUMS.sig." $DELPHIX_SIGNATURE_VERSION " version.info -f " $UPGRADE_IMAGE_PATH " ||
84
86
die 14 " failed to extract files from upgrade image '$UPGRADE_IMAGE_PATH '"
85
87
86
- for file in SHA256SUMS SHA256SUMS.sig.5.3 version.info; do
88
+ for file in SHA256SUMS SHA256SUMS.sig." $DELPHIX_SIGNATURE_VERSION " version.info; do
87
89
[[ -f " $file " ]] || die 15 " image is corrupt; missing '$file ' file"
88
90
done
89
91
90
92
if [[ -z " $opt_s " ]]; then
91
93
openssl dgst -sha256 \
92
- -verify /var/lib/delphix-appliance/key-public.pem.upgrade.5.3 \
93
- -signature SHA256SUMS.sig.5.3 \
94
+ -verify /var/lib/delphix-appliance/key-public.pem.upgrade." $DELPHIX_SIGNATURE_VERSION " \
95
+ -signature SHA256SUMS.sig." $DELPHIX_SIGNATURE_VERSION " \
94
96
SHA256SUMS > /dev/null ||
95
97
die 16 " image is corrupt; verification of 'SHA256SUMS' file," \
96
- " using signature 'SHA256SUMS.sig.5.3 '" \
97
- " and key 'key-public.pem.upgrade.5.3 ' failed"
98
+ " using signature 'SHA256SUMS.sig.$DELPHIX_SIGNATURE_VERSION '" \
99
+ " and key 'key-public.pem.upgrade.$DELPHIX_SIGNATURE_VERSION ' failed"
98
100
fi
99
101
100
102
awk ' $2 == "version.info" { print $0 }' SHA256SUMS |
Original file line number Diff line number Diff line change @@ -110,14 +110,16 @@ for file in SHA256SUMS prepare; do
110
110
[[ -f " $file " ]] || die 15 " image is corrupt; missing '$file ' file"
111
111
done
112
112
113
+ DELPHIX_SIGNATURE_VERSION=$( /usr/bin/get-appliance-version | cut -d - -f 1 | cut -d . -f 1-2)
114
+
113
115
if [[ -z " $opt_s " ]]; then
114
116
openssl dgst -sha256 \
115
- -verify /var/lib/delphix-appliance/key-public.pem.upgrade.5.3 \
116
- -signature SHA256SUMS.sig.5.3 \
117
+ -verify /var/lib/delphix-appliance/key-public.pem.upgrade." $DELPHIX_SIGNATURE_VERSION " \
118
+ -signature SHA256SUMS.sig." $DELPHIX_SIGNATURE_VERSION " \
117
119
SHA256SUMS > /dev/null ||
118
120
die 16 " image is corrupt; verification of 'SHA256SUMS' file," \
119
- " using signature 'SHA256SUMS.sig.5.3 '" \
120
- " and key 'key-public.pem.upgrade.5.3 ' failed"
121
+ " using signature 'SHA256SUMS.sig.$DELPHIX_SIGNATURE_VERSION '" \
122
+ " and key 'key-public.pem.upgrade.$DELPHIX_SIGNATURE_VERSION ' failed"
121
123
fi
122
124
123
125
sha256sum -c SHA256SUMS > /dev/null ||
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ $DOCKER_RUN --rm \
47
47
--env AWS_SECRET_ACCESS_KEY \
48
48
--env DELPHIX_SIGNATURE_URL \
49
49
--env DELPHIX_SIGNATURE_TOKEN \
50
+ --env DELPHIX_SIGNATURE_VERSION \
50
51
--volume " $TOP :/opt/delphix-platform" \
51
52
--workdir " /opt/delphix-platform" \
52
53
delphix-platform " $@ "
Original file line number Diff line number Diff line change 30
30
set -o errexit
31
31
set -o pipefail
32
32
33
- if [[ -z " $1 " ]] || [[ -z " $2 " ]]; then
34
- echo " Must specify key 'type' and 'version'."
35
- exit 1
36
- fi
37
-
38
33
TYPE=" $1 "
39
34
VERSION=" $2 "
40
35
@@ -46,7 +41,13 @@ VERSION="$2"
46
41
# package will not be correct. When this package is built by our build
47
42
# system and automation, these variables should be available.
48
43
#
49
- if [[ -n " ${DELPHIX_SIGNATURE_TOKEN:- } " ]] && [[ -n " ${DELPHIX_SIGNATURE_URL:- } " ]]; then
44
+ if [[ -n " ${DELPHIX_SIGNATURE_TOKEN:- } " ]] &&
45
+ [[ -n " ${DELPHIX_SIGNATURE_URL:- } " ]] &&
46
+ [[ -n " ${DELPHIX_SIGNATURE_VERSION:- } " ]]; then
47
+ if [[ -z " $TYPE " ]] || [[ -z " $VERSION " ]]; then
48
+ echo " Must specify key 'type' and 'version'."
49
+ exit 1
50
+ fi
50
51
curl -s -S -u " $DELPHIX_SIGNATURE_TOKEN " \
51
52
" $DELPHIX_SIGNATURE_URL /$TYPE /keyVersion/$VERSION " |
52
53
jq -Mr .publicKey
You can’t perform that action at this time.
0 commit comments