Lines 1117-1135
Link Here
|
1117 |
|
1117 |
|
1118 |
# Fetch metadata signature, aka "tag". |
1118 |
# Fetch metadata signature, aka "tag". |
1119 |
fetch_tag () { |
1119 |
fetch_tag () { |
1120 |
echo -n "Fetching metadata signature " |
1120 |
if [ -z "$1" ]; then |
1121 |
echo ${NDEBUG} "for ${RELNUM} from ${SERVERNAME}... " |
1121 |
echo -n "Fetching metadata signature " |
1122 |
rm -f latest.ssl |
1122 |
echo ${NDEBUG} "for ${RELNUM} from ${SERVERNAME}... " |
1123 |
fetch ${QUIETFLAG} http://${SERVERNAME}/${FETCHDIR}/latest.ssl \ |
1123 |
rm -f latest.ssl |
1124 |
2>${QUIETREDIR} || true |
1124 |
fetch ${QUIETFLAG} http://${SERVERNAME}/${FETCHDIR}/latest.ssl \ |
1125 |
if ! [ -r latest.ssl ]; then |
1125 |
2>${QUIETREDIR} || true |
1126 |
echo "failed." |
1126 |
if ! [ -r latest.ssl ]; then |
1127 |
return 1 |
1127 |
echo "failed." |
1128 |
fi |
1128 |
return 1 |
|
|
1129 |
fi |
1129 |
|
1130 |
|
1130 |
openssl rsautl -pubin -inkey pub.ssl -verify \ |
1131 |
openssl rsautl -pubin -inkey pub.ssl -verify \ |
1131 |
< latest.ssl > tag.new 2>${QUIETREDIR} || true |
1132 |
< latest.ssl > tag.new 2>${QUIETREDIR} || true |
1132 |
rm latest.ssl |
1133 |
rm latest.ssl |
|
|
1134 |
else |
1135 |
echo "Using metadata signature from environment TAG_OVERRIDE." |
1136 |
echo "$1" > tag.new |
1137 |
fi |
1133 |
|
1138 |
|
1134 |
if ! [ `wc -l < tag.new` = 1 ] || |
1139 |
if ! [ `wc -l < tag.new` = 1 ] || |
1135 |
! grep -qE \ |
1140 |
! grep -qE \ |
Lines 2073-2079
Link Here
|
2073 |
|
2078 |
|
2074 |
# Try to fetch the metadata index signature ("tag") until we run |
2079 |
# Try to fetch the metadata index signature ("tag") until we run |
2075 |
# out of available servers; and sanity check the downloaded tag. |
2080 |
# out of available servers; and sanity check the downloaded tag. |
2076 |
while ! fetch_tag; do |
2081 |
while ! fetch_tag "$TAG_OVERRIDE"; do |
2077 |
fetch_pick_server || return 1 |
2082 |
fetch_pick_server || return 1 |
2078 |
done |
2083 |
done |
2079 |
fetch_tagsanity || return 1 |
2084 |
fetch_tagsanity || return 1 |
Lines 2540-2546
Link Here
|
2540 |
|
2545 |
|
2541 |
# Try to fetch the NEW metadata index signature ("tag") until we run |
2546 |
# Try to fetch the NEW metadata index signature ("tag") until we run |
2542 |
# out of available servers; and sanity check the downloaded tag. |
2547 |
# out of available servers; and sanity check the downloaded tag. |
2543 |
while ! fetch_tag; do |
2548 |
while ! fetch_tag "$TAG_OVERRIDE"; do |
2544 |
fetch_pick_server || return 1 |
2549 |
fetch_pick_server || return 1 |
2545 |
done |
2550 |
done |
2546 |
|
2551 |
|