mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-14 21:47:19 +02:00
bug fixes
This commit is contained in:
parent
4c0c155922
commit
bc5789665a
37 changed files with 949 additions and 137 deletions
184
checks/checkit
Executable file
184
checks/checkit
Executable file
|
@ -0,0 +1,184 @@
|
|||
#!/bin/bash
|
||||
# Script for G10 testing
|
||||
#---------------------------------------------------------
|
||||
|
||||
#--------------------------------
|
||||
#------ constants ---------------
|
||||
#--------------------------------
|
||||
|
||||
usrname1="one"
|
||||
usrpass1="def"
|
||||
usrname2="two"
|
||||
usrpass2="abc"
|
||||
plain_files="plain-1 plain-2 plain-3"
|
||||
data_files=""
|
||||
exp_files=""
|
||||
last_command=""
|
||||
|
||||
|
||||
#--------------------------------
|
||||
#------ utility functions -------
|
||||
#--------------------------------
|
||||
|
||||
fatal () {
|
||||
echo "$pgmname: fatal:" $* >&2
|
||||
exit 1;
|
||||
}
|
||||
|
||||
error () {
|
||||
echo "$pgmname:" $* >&2
|
||||
echo "($last_command) failed" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
info () {
|
||||
echo "$pgmname:" $* >&2
|
||||
}
|
||||
|
||||
chdir () {
|
||||
cd $1 || fatal "cannot cd to $1"
|
||||
}
|
||||
|
||||
run_g10 () {
|
||||
last_command="HOME=. ../g10/g10 $*"
|
||||
eval HOME=. ../g10/g10 $*
|
||||
}
|
||||
|
||||
#--------------------------------
|
||||
#-------- main program ----------
|
||||
#--------------------------------
|
||||
|
||||
set -e
|
||||
pgmname=$(basename $0)
|
||||
|
||||
# some checks
|
||||
[ -d "./.g10" ] || fatal "subdirectory .g10 missing"
|
||||
for i in $plain_files; do
|
||||
[ -f $i ] || fatal "$i: missing"
|
||||
done
|
||||
for i in $exp_files; do
|
||||
[ -f $i ] || fatal "$i: script missing"
|
||||
done
|
||||
|
||||
cat <<EOF >./.g10/options
|
||||
no-greeting
|
||||
no-secmem-warning
|
||||
batch
|
||||
EOF
|
||||
|
||||
# print the G10 version
|
||||
run_g10 --version
|
||||
|
||||
info Checking cleartext signatures
|
||||
# There is a minor glitch, which appends a lf to the cleartext.
|
||||
# I do not consider that a bug, but I have to use the head .. mimic.
|
||||
# It is not clear what should happen to leading LFs, we must
|
||||
# change the defintion of cleartext, so that only 1 empty line
|
||||
# must follow the headers, but some specs say: any number of empty lines ..
|
||||
# clean-sat removes leading LFs
|
||||
# I know that this does not work for random data files (due to large lines
|
||||
# or what ever) - I hope we can live with it.
|
||||
for i in $plain_files; do
|
||||
echo "$usrpass1" | run_g10 --passphrase-fd 0 -sat -o x --yes $i || error "g10 failed: $?"
|
||||
run_g10 -o y --yes x || error "g10 failed: $?"
|
||||
../tools/clean-sat < $i > z
|
||||
head -c $[ $(cat y | wc -c) - 1 ] y | diff - z || error "$i: mismatch"
|
||||
done
|
||||
|
||||
info Creating some random data files
|
||||
for i in 500 9000 32000 80000; do
|
||||
head -c $i /dev/urandom >data-$i
|
||||
data_files="$data_files data-$i"
|
||||
done
|
||||
|
||||
info Checking armored signatures
|
||||
for i in $plain_files $data_files ; do
|
||||
echo "$usrpass1" | run_g10 --passphrase-fd 0 -sa -o x --yes $i || error "g10 failed: $?"
|
||||
run_g10 -o y --yes x || error "g10 failed: $?"
|
||||
cmp $i y || error "$i: mismatch"
|
||||
done
|
||||
|
||||
info Checking signatures
|
||||
for i in $plain_files $data_files; do
|
||||
echo "$usrpass1" | run_g10 --passphrase-fd 0 -s -o x --yes $i || error "g10 failed: $?"
|
||||
run_g10 -o y --yes x || error "g10 failed: $?"
|
||||
cmp $i y || error "$i: mismatch"
|
||||
done
|
||||
|
||||
|
||||
info Checking armored encryption
|
||||
for i in $plain_files $data_files ; do
|
||||
run_g10 -ea -o x --yes -r "$usrname2" $i || error "g10 failed: $?"
|
||||
run_g10 -o y --yes x || error "g10 failed: $?"
|
||||
cmp $i y || error "$i: mismatch"
|
||||
done
|
||||
|
||||
info Checking armored encryption with a pipe
|
||||
for i in $plain_files $data_files ; do
|
||||
run_g10 -ea --yes -r "$usrname2" < $i | tee x \
|
||||
| run_g10 -o y --yes || error "g10 failed: $?"
|
||||
cmp $i y || error "$i: mismatch"
|
||||
run_g10 --yes < x > y || error "g10 failed: $?"
|
||||
cmp $i y || error "$i: mismatch"
|
||||
done
|
||||
|
||||
info Checking encryption
|
||||
for i in $plain_files $data_files ; do
|
||||
run_g10 -e -o x --yes -r "$usrname2" $i || error "g10 failed: $?"
|
||||
run_g10 -o y --yes x || error "g10 failed: $?"
|
||||
cmp $i y || error "$i: mismatch"
|
||||
done
|
||||
|
||||
info Checking encryption with a pipe
|
||||
for i in $plain_files $data_files ; do
|
||||
run_g10 -e --yes -r "$usrname2" < $i \
|
||||
| run_g10 --yes > y || error "g10 failed: $?"
|
||||
cmp $i y || error "$i: mismatch"
|
||||
done
|
||||
|
||||
|
||||
info Checking signing and encryption
|
||||
for i in $plain_files $data_files ; do
|
||||
echo "$usrpass1" \
|
||||
| run_g10 --passphrase-fd 0 -se -o x --yes -r "$usrname2" $i
|
||||
run_g10 -o y --yes x || error "g10 failed: $?"
|
||||
cmp $i y || error "$i: mismatch"
|
||||
done
|
||||
|
||||
info Checking armored signing and encryption
|
||||
for i in $plain_files $data_files ; do
|
||||
echo "$usrpass1" \
|
||||
| run_g10 --passphrase-fd 0 -sae -o x --yes -r "$usrname2" $i || error "g10 failed: $?"
|
||||
run_g10 -o y --yes x || error "g10 failed: $?"
|
||||
cmp $i y || error "$i: mismatch"
|
||||
done
|
||||
|
||||
|
||||
info Checking armored detached signatures
|
||||
for i in $plain_files $data_files ; do
|
||||
echo "$usrpass1" | run_g10 --passphrase-fd 0 -sab -o x --yes $i || error "g10 failed: $?"
|
||||
run_g10 -o /dev/null --yes x <$i || error "$i: bad signature"
|
||||
done
|
||||
|
||||
info Checking detached signatures
|
||||
for i in $plain_files $data_files ; do
|
||||
echo "$usrpass1" | run_g10 --passphrase-fd 0 -sb -o x --yes $i || error "g10 failed: $?"
|
||||
run_g10 -o /dev/null --yes x <$i || error "$i: bad signature"
|
||||
done
|
||||
|
||||
|
||||
info Checking detached signatures of multiple files
|
||||
i="$plain_files $data_files"
|
||||
echo "$usrpass1" | run_g10 --passphrase-fd 0 -sb -o x --yes $i || error "g10 failed: $?"
|
||||
cat $i | run_g10 -o /dev/null --yes x || error "$i: bad signature"
|
||||
|
||||
info Checking armored detached signatures of multiple files
|
||||
i="$plain_files $data_files"
|
||||
echo "$usrpass1" | run_g10 --passphrase-fd 0 -sab -o x --yes $i || error "g10 failed: $?"
|
||||
cat $i | run_g10 -o /dev/null --yes x || error "$i: bad signature"
|
||||
|
||||
rm $data_files x y z
|
||||
|
||||
info "All tests passed."
|
||||
exit 0
|
||||
|
1
checks/distfiles
Normal file
1
checks/distfiles
Normal file
|
@ -0,0 +1 @@
|
|||
checkit plain-1 plain-2 plain-3
|
23
checks/plain-1
Normal file
23
checks/plain-1
Normal file
|
@ -0,0 +1,23 @@
|
|||
<!-- Dies ist Seite 3, dort ist keine Seitenzahl angegeben,
|
||||
oben rechts ist wieder der Stempel von meinem Opa zu finden -->
|
||||
|
||||
<sect1>Name <q>Groß-Bartloff</>
|
||||
|
||||
<p>
|
||||
Der Name <q/Bartloff/ ist schwer zu deuten. Man hat viele Mutmaßungen
|
||||
angestellt, von denen man aber bislang keine einzige als unbedingt
|
||||
richtig erklären kann.
|
||||
<fontinfo rem="mit Leerzeichen geschrieben">Urkundlich</> wird das
|
||||
Dorf bis zur Reformation stets <q/Bartorf/ (anno 1253) und
|
||||
<q/Bardorf/ (1306, 1318, 1329, 1429) genannt und das_ sowohl Klein-
|
||||
wie Großbartloff. Erst 1586 im Bischofssteiner Jurisdiktionalbuch
|
||||
heißt unser Dorf <q/Bartteloff/ und so auch in der ältesten noch
|
||||
vorhandenen Kirchenrechnung vom Jahre 1651. NAch dem Jahre 1700 wird
|
||||
in den Urkunden begonnen, den vollen Namen <q/Groß-Bartloff/ und
|
||||
<q/Klein-Bartloff/ zu schreiben.
|
||||
---------------- [wegen dashed escaped text]
|
||||
<p>
|
||||
Nimmt man an, daß die urkundliche, älteste Bezeichnung Bartorf die
|
||||
ursprüngliche ist und nicht die mundartliche Bartloff, so könnte der
|
||||
Name gut gedeutet werden als Dorf an der <q/Borde/ oder am Rande
|
||||
oder an der Grenze entweder des Waldes
|
49
checks/plain-2
Normal file
49
checks/plain-2
Normal file
|
@ -0,0 +1,49 @@
|
|||
|
||||
|
||||
<sect>Vorwort
|
||||
<p>
|
||||
Der Wert einer Ortschronik ist offenbar und bedarf keiner Erörterung.
|
||||
Mit Ausbruch des Weltkrieges_, inmitten der gewaltigen Geschehnisse, fühlte
|
||||
der Klerus_ unseres_ Eichs_feldes_ das_ mehr wie früher und so
|
||||
erstarkte das_ Streben, eine solche Orts_geschichte zu scahffen, um
|
||||
unseren Nachkommen zu berichten, was_ auch die kleinsten Dörfer in
|
||||
der großen Zeit geleistet, erlebt und erlitten haben.
|
||||
<p>
|
||||
Und so begann auch ich im Dezember 1914, den ?????????
|
||||
Stoff, wo immer ich ihn auch nur so spärlich finden konnte, zu
|
||||
sammeln, ich befragte zunächst emsig die ältesten Leute,
|
||||
durchforschte sodann das ganze Pfarrarchiv, das Schulzenarchiv
|
||||
beider Pfarrdörfer, das Kommissariats_archiv zu Heiligenstadt,
|
||||
endlich auch 1916 das Staats_archiv zu Magdeburg. Selbstverständlich
|
||||
arbeitete ich auch die einschlägige Literatur durch. Gar viele Zeit
|
||||
und Mühe hat es_ gekostet um nach mehr als 8 Jahren die Ortschronik von
|
||||
Großbartloff und vom Filialdorf Wilbich gesondert zu schaffen.
|
||||
<p vspace="2ex">
|
||||
<bf>Großbartloff,</> den 23. März 1923.
|
||||
<p vspace="3ex" align=right>
|
||||
<bf/Nikolaus Göring,/ Pfarrer.
|
||||
</p>
|
||||
|
||||
<!-- Hier folgt ein Stempel von meinem Opa:
|
||||
Rud. Koch
|
||||
Großbartloff/Eichsfeld
|
||||
Anger 161
|
||||
-->
|
||||
<!-- FIXME: hier kommt einen Zierlinie -->
|
||||
|
||||
<p vspace=fill> <!-- Der Rest kam am Ende der Seite -->
|
||||
<p align=center> Literatur: </p>
|
||||
1) Joh. Wolf: Politische Geschichte des Eichsf. Gött. 1792 und
|
||||
Löffler 1921. 2) K. Geschichte, Wolf 1816 Gött. 3) Knieb: Gesch.
|
||||
der Ref. u. Gegenref???
|
||||
|
||||
<!-- FIXME: Der Rest fehlt noch -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</sect>
|
1
checks/plain-3
Normal file
1
checks/plain-3
Normal file
|
@ -0,0 +1 @@
|
|||
Dies ist eine einfache Zeile ohne LF am Ende.
|
Loading…
Add table
Add a link
Reference in a new issue