From 5a05af2bca319adc9a915ff4466f04c3ef05142a Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 24 Feb 1998 18:50:46 +0000 Subject: [PATCH] Renamed to GNUPG --- ChangeLog | 5 + INSTALL | 11 +- NEWS | 11 + README | 101 ++++---- TODO | 2 - VERSION | 2 +- acconfig.h | 8 +- checks/Makefile.am | 2 +- checks/checkit | 15 +- checks/gnupg.asc | 12 + checks/pubring.g10 | Bin 2813 -> 0 bytes checks/secring.g10 | Bin 2210 -> 0 bytes cipher/ChangeLog | 5 + cipher/blowfish.c | 8 +- cipher/blowfish.h | 8 +- cipher/cast5.c | 8 +- cipher/cast5.h | 8 +- cipher/dsa.c | 8 +- cipher/dsa.h | 8 +- cipher/elgamal.c | 8 +- cipher/elgamal.h | 8 +- cipher/gost.c | 8 +- cipher/gost.h | 8 +- cipher/md.c | 8 +- cipher/md.h | 8 +- cipher/md5.c | 537 +++++++++++++++++++-------------------- cipher/md5.h | 25 +- cipher/misc.c | 8 +- cipher/primegen.c | 8 +- cipher/random.c | 15 +- cipher/rmd.h | 8 +- cipher/rmd160.c | 8 +- cipher/rmd160test.c | 8 +- cipher/sha1.c | 8 +- cipher/sha1.h | 8 +- cipher/smallprime.c | 8 +- config.h.in | 8 +- configure.in | 4 +- doc/DETAILS | 4 +- g10/ChangeLog | 21 ++ g10/Makefile.am | 6 +- g10/Makefile.in | 38 +-- g10/armor.c | 10 +- g10/build-packet.c | 27 +- g10/cipher.c | 8 +- g10/comment.c | 8 +- g10/compress.c | 8 +- g10/elg.c | 8 +- g10/encode.c | 14 +- g10/encr-data.c | 8 +- g10/export.c | 8 +- g10/filter.h | 8 +- g10/free-packet.c | 8 +- g10/g10.c | 30 +-- g10/g10maint.c | 32 +-- g10/getkey.c | 8 +- g10/import.c | 8 +- g10/kbnode.c | 8 +- g10/keydb.h | 12 +- g10/keygen.c | 42 +-- g10/keyid.c | 8 +- g10/main.h | 8 +- g10/mainproc.c | 10 +- g10/mdfilter.c | 8 +- g10/openfile.c | 12 +- g10/options.h | 8 +- g10/packet.h | 25 +- g10/parse-packet.c | 90 ++++++- g10/passphrase.c | 27 +- g10/pkclist.c | 8 +- g10/plaintext.c | 8 +- g10/pubkey-enc.c | 8 +- g10/revoke.c | 8 +- g10/ringedit.c | 14 +- g10/rsa.c | 8 +- g10/seckey-cert.c | 42 +-- g10/seskey.c | 8 +- g10/sig-check.c | 8 +- g10/sign.c | 23 +- g10/skclist.c | 8 +- g10/status.c | 8 +- g10/status.h | 8 +- g10/textfilter.c | 8 +- g10/trustdb.c | 27 +- g10/trustdb.h | 8 +- mpi/ChangeLog | 4 + mpi/alpha/mpih-add1.S | 8 +- mpi/alpha/mpih-shift.S | 8 +- mpi/hppa/mpih-add1.S | 8 +- mpi/hppa/mpih-shift.S | 8 +- mpi/hppa/mpih-sub1.S | 8 +- mpi/hppa1.1/mpih-mul1.S | 8 +- mpi/hppa1.1/mpih-mul2.S | 8 +- mpi/hppa1.1/mpih-mul3.S | 8 +- mpi/hppa1.1/udiv-qrnnd.S | 8 +- mpi/i386/mpih-add1.S | 8 +- mpi/i386/mpih-mul1.S | 8 +- mpi/i386/mpih-mul2.S | 8 +- mpi/i386/mpih-mul3.S | 8 +- mpi/i386/mpih-shift.S | 8 +- mpi/i386/mpih-sub1.S | 8 +- mpi/i586/mpih-add1.S | 6 +- mpi/i586/mpih-mul1.S | 6 +- mpi/i586/mpih-mul2.S | 8 +- mpi/i586/mpih-mul3.S | 8 +- mpi/i586/mpih-shift.S | 8 +- mpi/i586/mpih-sub1.S | 8 +- mpi/m68k/mpih-shift.S | 6 +- mpi/mpi-add.c | 8 +- mpi/mpi-bit.c | 8 +- mpi/mpi-cmp.c | 8 +- mpi/mpi-div.c | 8 +- mpi/mpi-gcd.c | 8 +- mpi/mpi-inline.h | 8 +- mpi/mpi-internal.h | 8 +- mpi/mpi-inv.c | 8 +- mpi/mpi-mpow.c | 8 +- mpi/mpi-mul.c | 8 +- mpi/mpi-pow.c | 8 +- mpi/mpi-scan.c | 8 +- mpi/mpicoder.c | 8 +- mpi/mpih-add.c | 8 +- mpi/mpih-cmp.c | 8 +- mpi/mpih-div.c | 8 +- mpi/mpih-mul.c | 8 +- mpi/mpih-sub.c | 8 +- mpi/mpiutil.c | 8 +- mpi/pa7100/mpih-shift.S | 8 +- po/de.po | 4 +- scripts/mkdiff | 36 +-- tools/bftest.c | 8 +- tools/mpicalc.c | 8 +- tools/primes.scm | 31 --- util/ChangeLog | 4 + util/argparse.c | 4 +- util/errors.c | 8 +- util/fileutil.c | 8 +- util/iobuf.c | 8 +- util/logger.c | 8 +- util/memory.c | 8 +- util/miscutil.c | 8 +- util/secmem.c | 10 +- util/strgutil.c | 8 +- util/ttyio.c | 174 +++++++++++-- 144 files changed, 1279 insertions(+), 1035 deletions(-) create mode 100644 checks/gnupg.asc delete mode 100644 checks/pubring.g10 delete mode 100644 checks/secring.g10 delete mode 100644 tools/primes.scm diff --git a/ChangeLog b/ChangeLog index 69cec0e24..351520362 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Feb 24 15:59:12 1998 Werner Koch (wk@isil.d.shuttle.de) + + * configure.in: Changed the name of the package to GNUPG and + chnaged several other names too. + Wed Feb 18 17:36:45 1998 Werner Koch (wk@isil.d.shuttle.de) * Makefile.am (checks): New. diff --git a/INSTALL b/INSTALL index e4e904efd..83e316b19 100644 --- a/INSTALL +++ b/INSTALL @@ -1,8 +1,8 @@ Please read the Basic Installation section somewhere below. -Configure options for G10 -========================= +Configure options for GNUPG +=========================== --with-zlib Forces usage of the local zlib sources. Default is to use the (sahred) library of the system. @@ -37,11 +37,10 @@ Don't forget to delete "config.cache" and run "./config.status --recheck". Installation ============ -G10 is not installed as suid:root; if you want to use it, do it manually -(only g10, not g10maint). +pgp is not installed as suid:root; if you want to do it, do it manually. -You have to create the ~/.g10 directory manually. Your first action after -this should be to create a key pair: "g10 --gen-key". +The ~/.gpg directory will be created if it does not exist. Your first +action should be to create a key pair: "gpg --gen-key". diff --git a/NEWS b/NEWS index e75ed83a5..6c12d7ff8 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,14 @@ +Noteworthy changes in version 0.2.8 +----------------------------------- + + * Changed the name to GNUPG, the binaries are called gpg and gpgm. + You must rename rename the directory "~/.g10" to ~/.gnupg/, rename + {pub,sec}ring.g10 to {pub,sec}ring.gpg, trustdb.g10 to trustdb.gpg + and g10.sig to gnupg.sig. + + * New or changed passphrases are now salted. + + Noteworthy changes in version 0.2.7 ----------------------------------- diff --git a/README b/README index 52e6e1426..bef9b48e5 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ - G10 - The GNU Encryption and Signing Tool - ------------------------------------------ + GNUPG - The GNU Privacy Guard + ------------------------------- THIS IS ALPHA SOFTWARE, EXPECT BUGS AND UNIMPLEMENTED STUFF. IT MAY HAPPEN THAT SOME DATA FORMATS OR PROGRAMM OPTIONS @@ -8,16 +8,16 @@ On a Linux box (version 2.x.x, alpha or x86 CPU) it should work reliable. You may create your key on such a machine and - use it. Please verify the tar file; there is a PGP and a G10 + use it. Please verify the tar file; there is a PGP and a GNUPG signature available. My PGP key is well known and published in the "Global Trust Register for 1998", ISBN 0-9532397-0-5. - I have included my pubring as "g10/pubring.10", which contains - the key used to make G10 signatures: + I have included my pubring as "g10/pubring.asc", which contains + the key used to make GNUPG signatures: "pub 1312G/FF3EAA0B 1998-02-09 Werner Koch " "Key fingerprint = 8489 6CD0 1851 0E33 45DA CD67 036F 11B8 FF3E AA0B" - You may add it to your G10 pubring and use it in the future to + You may add it to your GNUPG pubring and use it in the future to verify new releases. Because you verified the tar file containing this file here, you can be sure that the above fingerprint is correct. @@ -27,20 +27,20 @@ See the file COPYING for copyright and warranty information. - Due to the fact that G10 does not use use any patented algorithm, + Due to the fact that GNUPG does not use use any patented algorithm, it cannot be compatible to old PGP versions, because those use IDEA (which is worldwide patented) and RSA (which is patented in the United States until Sep 20, 2000). I'm sorry about this, but this is the world we have created (e.g. by using proprietary software). - Because the OpenPGP standard is still a draft, G10 is not yet + Because the OpenPGP standard is still a draft, GNUPG is not yet compatible to it (or PGP 5) - but it will. The data structures used are compatible with PGP 2.x, so it can parse an list such files - and PGP should be able to parse data created by G10 and complain + and PGP should be able to parse data created by GNUPG and complain about unsupported algorithms. - The default algorithms used by G10 are ElGamal for public-key + The default algorithms used by GNUPG are ElGamal for public-key encryption and signing; Blowfish with a 160 bit key for protecting the secret-key components, conventional and session encryption; RIPE MD-160 to create message digest. DSA, SHA-1 and CAST are @@ -61,19 +61,16 @@ 3) "make install" - 4) You end up with a binary "g10" in /usr/local/bin - - 5) Optional, but suggested: install the program "g10" as suid root. - - 6) Create a directory ".g10" under your home directory ("mkdir ~/.g10") + 4) You end up with a binary "gpg" in /usr/local/bin + 5) Optional, but suggested: install the program "gpg" as suid root. Key Generation -------------- - g10 --gen-key + gpg --gen-key This asks some questions and then starts key generation. To create good random numbers for prime number generation, it uses a /dev/random @@ -112,7 +109,7 @@ You should make a revocation certificate in cases someone gets knowledge of your secret key or you forgot your passphrase: - g10 --gen-revoke your_user_id + gpg --gen-revoke your_user_id Run this command and store it away; output is always ASCII armored, so that you can print it and (hopefully never) re-create it if @@ -121,11 +118,11 @@ You can sign a key with this command: - g10 --sign-key Donald + gpg --sign-key Donald This let you sign the key of "Donald" with your default userid. - g10 --sign-key -u Karl -u Joe Donald + gpg --sign-key -u Karl -u Joe Donald This let you sign the key of of "Donald" with the userids of "Karl" and "Joe". @@ -142,16 +139,16 @@ Sign ---- - g10 -s file + gpg -s file - This creates a file file.g10 which is compressed and has a signature + This creates a file file.gpg which is compressed and has a signature attached. - g10 -sa file + gpg -sa file - Same as above, but file.g10 is ascii armored. + Same as above, but file.gpg is ascii armored. - g10 -s -o out file + gpg -s -o out file Creates a signature of file, but writes the output to the file "out". @@ -159,12 +156,12 @@ Encrypt ------- - g10 -e -r heine file + gpg -e -r heine file This encrypts files with the public key of "heine" and writes it - to "file.g10" + to "file.gpg" - echo "hallo" | g10 -ea -r heine | mail heine + echo "hallo" | gpg -ea -r heine | mail heine Ditto, but encrypts "hallo\n" and mails it as ascii armored message. @@ -172,13 +169,13 @@ Sign and Encrypt ---------------- - g10 -se -r heine file + gpg -se -r heine file This encrypts files with the public key of "heine" and writes it - to "file.g10" after signing it with the default user id. + to "file.gpg" after signing it with the default user id. - g10 -se -r heine -u Suttner file + gpg -se -r heine -u Suttner file Ditto, but sign the file with the user id "Suttner" @@ -187,17 +184,17 @@ ------------------ To export your complete keyring(s) do this: - g10 --export + gpg --export To export only some user ids do this: - g10 --export userids + gpg --export userids Use "-a" or "--armor" to create ASCII armored output. Importing keys is done with the option, you guessed it, "--import": - g10 --import [filenames] + gpg --import [filenames] New keys are appended to the default keyring and already existing keys are merged. Keys without a self-signature are ignored. @@ -243,7 +240,7 @@ "#34" This can be used by a MUA to specify an exact key after selecting - a key from G10 (by the use of a special option or an extra utility) + a key from GNUPG (by the use of a special option or an extra utility) * Or by the usual substring: @@ -258,19 +255,19 @@ Batch mode ---------- - If you use the option "--batch", G10 runs in non-interactive mode and + If you use the option "--batch", GNUPG runs in non-interactive mode and never prompts for input data. This even does not allow to enter passphrase; until we have a better solution (something like ssh-agent), you can use the option "--passhrase-fd n", which works like PGPs PGPPASSFD. - Batch mode also causes G10 to terminate as soon as a BAD signature is + Batch mode also causes GNUPG to terminate as soon as a BAD signature is detected. Exit status ----------- - G10 returns with an exit status of 1 if in batch mode and a bad signature + GNUPG returns with an exit status of 1 if in batch mode and a bad signature has been detected or 2 or higher for all other errors. You should parse stderr to get detailed informations about the errors. @@ -278,26 +275,26 @@ Esoteric commands ----------------- - g10 --list-packets datafile + gpg --list-packets datafile Use this to list the contents of a data file. If the file is encrypted - you are asked for the passphrase, so that G10 is able to look at the + you are asked for the passphrase, so that GNUPG is able to look at the inner structure of a encrypted packet. - g10maint --quick-random + gpgm --quick-random Do not use the stroing random generator but a faster one. This can be used to generate keys for tests; those are marked as insecure. - g10maint --list-trustdb + gpgm --list-trustdb List the contents of the trustdb in a human readable format - g10maint --list-trustdb + gpgm --list-trustdb List the tree of certificates for the given usernames - g10maint --list-trust-path depth username + gpgm --list-trust-path depth username List the possible trust paths for the given username, up to the specified depth. If depth is negative, duplicate introducers are not listed, @@ -306,25 +303,25 @@ using a negative number). This option may create new entries in the trustdb. - g10maint --print-mds filenames + gpgm --print-mds filenames List all available message digest values for the fiven filenames - g10maint --gen-prime n + gpgm --gen-prime n Generate and print a simple prime number of size n - g10maint --gen-prime n q + gpgm --gen-prime n q Generate a prime number suitable for ElGamal signatures of size n with a q as largest primefactor of n-1. - g10maint --gen-prime n q 1 + gpgm --gen-prime n q 1 Ditto, but calculate a generator too. - For more options/commands see the file g10/OPTIONS, or use "g10 --help" + For more options/commands see the file g10/OPTIONS, or use "gpg --help" Debug Flags @@ -354,12 +351,12 @@ but for now I stick to my own formatting rules. The primary FTP site is "ftp://ftp.guug.de/pub/gcrypt/" - The primary WWW page is "http://www.d.shuttle.de/isil/crypt/g10.html" + The primary WWW page is "http://www.d.shuttle.de/isil/crypt/gnupg.html" - If you like, send your keys to ; use - "g10 --export --armor | mail g10-keys@isil.d.shuttle.de" to do this. + If you like, send your keys to ; use + "gnupg --export --armor | mail gnupg-keys@isil.d.shuttle.de" to do this. - Please direct bug reports to or better + Please direct bug reports to or better post them to the mailing list . diff --git a/TODO b/TODO index 022f65f52..68d2ec013 100644 --- a/TODO +++ b/TODO @@ -33,6 +33,4 @@ them to your key and because the user id which is signed by others has also be signed by you, all user-ids are bound together. - * create directory .g10 - diff --git a/VERSION b/VERSION index b0032849c..a45be4627 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2.7 +0.2.8 diff --git a/acconfig.h b/acconfig.h index 1cdf9bef4..d17081f1b 100644 --- a/acconfig.h +++ b/acconfig.h @@ -1,14 +1,14 @@ /* acconfig.h - used by autoheader to make config.h.in - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/checks/Makefile.am b/checks/Makefile.am index 4bf639739..2d999a502 100644 --- a/checks/Makefile.am +++ b/checks/Makefile.am @@ -2,7 +2,7 @@ TESTS = checkit -TEST_FILES = pubring.asc secring.asc plain-1 plain-2 plain-3o.asc \ +TEST_FILES = pubring.asc secring.asc gnupg.asc plain-1 plain-2 plain-3o.asc \ plain-1.asc plain-2.asc plain-3.asc EXTRA_DIST = $(TESTS) $(TEST_FILES) diff --git a/checks/checkit b/checks/checkit index 787da1153..7da825afe 100755 --- a/checks/checkit +++ b/checks/checkit @@ -44,15 +44,15 @@ cleanup () { run_g10 () { - if ! eval ../g10/g10 --homedir . $* ; then - echo "(../g10/g10 --homedir . $*) failed" >&2 + if ! eval ../g10/gpg --homedir . $* ; then + echo "(../g10/gpg --homedir . $*) failed" >&2 exit 1 fi } run_g10maint () { - if ! eval ../g10/g10maint --homedir . $* ; then - echo "(../g10/g10maint --homedir . $*) failed" >&2 + if ! eval ../g10/gpgm --homedir . $* ; then + echo "(../g10/gpgm --homedir . $*) failed" >&2 exit 1 fi } @@ -85,8 +85,9 @@ EOF run_g10 --version info Unpacking some material -run_g10maint --yes --dearmor -o pubring.g10 pubring.asc -run_g10maint --yes --dearmor -o secring.g10 secring.asc +run_g10maint --yes --dearmor -o pubring.gpg pubring.asc +run_g10maint --yes --dearmor -o secring.gpg secring.asc +run_g10maint --yes --dearmor -o gnupg.sig gnupg.asc run_g10maint --yes --dearmor -o plain-3 plain-3o.asc plain_files="$plain_files plain-3" # make sure all files are created @@ -94,7 +95,7 @@ echo "$usrpass1" | run_g10 --no-operation info Checking decryption for i in $plain_files ; do -run_g10 --passphrase-fd 0 -o y --yes $i.asc + echo "$usrpass1" | run_g10 --passphrase-fd 0 -o y --yes $i.asc cmp $i y || error "$i: mismatch" done diff --git a/checks/gnupg.asc b/checks/gnupg.asc new file mode 100644 index 000000000..54f9824d6 --- /dev/null +++ b/checks/gnupg.asc @@ -0,0 +1,12 @@ +-----BEGIN PGP ARMORED FILE----- +Version: GNUPG v0.2.7b (Linux) +Comment: This is an alpha version! +Comment: Use "g10maint --dearmor" for unpacking + +0CEjY3JlYXRlZCBieSBHTlVQRyB2MC4yLjdiIChMaW51eCmQDQMAAxDlaCrLPviEowGI1wMFADTy +2TnlaCrLPviEoxADgEwC/jmq4S8mH3ulVqOyszVXwLaOGwtNdQMc+q5yOTiGTme6tLrYshsXDrG0 +qEeLEny8gqPpuUSH0Qht5V45sD8EfYBqptoxYiwpHlQcghrEUqGgo+QgXffPcrlbGINs576mugMA +mj/y4wOgoeJmc8WWNEnx+LehCZE1OaLpV5IWHigefsVLLv7jcQ2j80yxdCllqzvQTPQN+tlVoGei +yoC4BF2wzoG8sWJ0B9xFkQ/WV0jh1vpWiSfnZU1yhVkRNMk7SodM +=Ehf8 +-----END PGP ARMORED FILE----- diff --git a/checks/pubring.g10 b/checks/pubring.g10 deleted file mode 100644 index 17fbe0507184f20fc290422f3e2a38625091d9b5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2813 zcmajg`#;l*9|!QYkIO2TxgF&)Th!c!aB_*c%w;Z>+>59&m*$eoM5o&1l1qt-w8=Gz z+)cpU$7~dcR-K_q!J%>k*8<5Q_JN<09bZN7dk$ zg7K(eydVBT2p+DcqOPKm-UDb(l5rpq6aZ18k$LAf>@~uM*_)J4gaY@4{&j+E<|!g#O9J}QDy)zL(Mjgrg2rRo6>;y) z1t1fN?q9bi9EGNXmZgL5>ULi!w(0k!7+sP~Ziy#EG@y2Hp1V{Z;f=9`kAsQrCd)Q$ z^k?_QNe*10`T2JCb^|ogP<%)zJTL$cm$x`+XNqyKHAN`I4FTLDKZAboQDmSuqw}CZ zj462cdZmjs+CfoBQ`Z1jeUI$5nMPmfS@bp{QVvQifn~GWQDDz0ac+yXE>zcv*Z}rf z>f(}Q7_UTd`ipRn@T!_U45r+S)VsqN#iJ=c57lV%3eLP8qwrm0wD^9$7(NdGl>BDm zI!u;CBiCSJA8buct|iwPWX>2G)>)9JXqHjqxa~yVKl@rf4K_08L<83u}=P#{#&anv=xGJw?&TPgFS?mo)dpM7qst zR9wbcGTFOwxSp}X$}sic^oWL?+vPU?__$I%#x^SoQM7%?_(_`1A4V8FVIYFqZh|#*S{SlCcISxJZiOI5mexTKsU;FLHrs>p(v;GVhPDsXQMFnCBd;_MktQ&$Y@ON9~ zdmNS`OL;%B_PMkvy+~XwoNF+_bj0gmO)K4oJ$(wnb?E7rV3w`PXsuIAlI<(;!q5GD zLZC`??|*mr?-{TQYC5cQ{7#lD--ZH-OMr|E@%rzC+Ka*Jr^FMhGeC^2l5SG}`H~u@ zT|AeMVhuAl4;6Azm>R{W#Oyjmwo*neRLhlbIX8*hIeCW}qb={&=0W#aNchE6YO81U z7C#T?ng8mnB-t93jqTsB!~=c53=;%k=;ILsTIjHQ!rh@QVLfYO!~l=g)!?UZS#pqX z>N>9>6>IBq4YvkD&Y+>EE*d!N6gycrNGAw)CTvW5>u}v|6grTQWP}mSG)iGwOGMFL#qJcdEq@@xgLyH;;_Px!JH-wjN?+~R{v4+TFQJg@d}vbfGoEzE0yr z&#JmSkJ|4khivDA!dnh9nOhq*s-kewQr&lI|Hm47Iq+Xte{}i>*2wH%opwn8V7kiV zy*|=It90vuEa!mV4BdgG*^EKQqT0gaK&MWe2OtWsZBlyFHk|pzpj~AB(dFj@yk#Go z>{E*gpfhVyMX2)nr7zpw#N;^rZ$%DzDRYbuz1mpK1=|o6p0>;g$6RpfYe0tJC3myA z?V(garJopNq@bYZ!bw7szVd0Yu4WcZ8Rd`C-vD&g$)+&TzGdS|0U%~^W=cIt%SJVAZ8vwcbQ%sC;Al~&cC*XSqOeZQ`e zX(s@RrKn@Ghu3Q_Df-@C!yGcjdFWLa&CYL##Li!2M!G?nN?<)GuCBIt_ibGkEWiM{ zcU{$;S}U?+RXn7zr8G|3CkdPp-TtbbA%u7k%RM;JI_jXMMY_YW&sfXrcMJgU9AEch z?re5Al6O+0q$>l@zK1n&>gUZQ>LK$TqP36SJ*UmH_0zRQDWt^EQ^@&^+cG;XE3y1Y za16x$>IU8^YK+pYOfy2jyrP4(dn1q}rHhPXhzxX^(ml+GO~hGMOnPo;_T@BqFlz{m5rq>f7&|}$ ztop}!eQUk(HP<^gd7_^P+|oWeu`SoX_#({Qt$ej7gih~=d^@!vF#Xo_tAkr#eE#b- zxvB52&1x=zG%H7G))jqf#FeYR?@Z&~l!+A+mk3{n#!-`%xrsYztO{S|!TaZUMSf~! z7a;!9+EHSYz~!mOtHRTMxHg@8fp~^_BEM2(qznWF`vo4)v z(S$;Mg7N?UtAA1bk@nXzUGxB%YwM+6j8~IPNLnsA_Szn{WX!6aRYPC?TiY`6lCe%Z zXJ3YkUB_KRSAHB!38!}c@N)A6WWlJcbk^5KxX=TZ<2yiOCf>nuGCyrQB7)r7oxQSU zj~;VXX}7sQ+j-;i8503jK<2_oY~SGdmbXFUX|+5L`7QITFeO~U)xzG?m!|beq@UIuEvJrZUZcSbPunLk zA{|j!O3V{Z@9@E7WI+5~T{CuPATNZfAg?Vkx9XB-&-eW-ZV@tqbjDBzoT=E|@LN<} z>E}#w}B7%NUy)QpZ(h`5bP+g!f8rfFA zdt^*+w=^Q;!KDgPTM0zt@m(pD(-EN`;pX<}P*$P5`SAt}ebG{Scn249Br_Fxyjy60 zT$%cdDEVU7e;CgGI z3J5IwdC&DJa$}$P)cu+k_FPuV@|xW3dtB~2vcA)hbsyL_{t?CUnz92?)a;IdRs{#rdhPtm PcD5esokID-cZ>f4dbu?? diff --git a/checks/secring.g10 b/checks/secring.g10 deleted file mode 100644 index 8f1223615c8dbef54d02061cbf29e2f51c22de2f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2210 zcma*nc|6mP1IO{{gIt@LD_54AGGaDobB}LxL{TBx;VVR&xs~Q9_m9e1eVZ)`4HZop z@{@BaG$LvAt#vt)8p-kP+vE4o_g9a{@Av=fzxVU;9@?QzppZhSBqAK22*>U=g`c31 zj47l@Qb-I5Zi+BNm=}xK0?6spcn}B*fGRTdnL*3@&EqC!Rx0Krt_6P>IsBC_>k8@P z9&Kp;&{N_m?XT=gRYwIk0D_&8P-g-OT+!D04QQ{rVTr+Hqh|pytBGTkHhbW4mhJ&} zDO))nEsY!8U-OdSEWgDU1c(EmqRKD3Tph4Q@``g1y9@+BW?M!9c0ktgx#i8QaV$jQ zMQ*Tg^@X3@EAoN{<(&0E$PMq2V-*f3)C%usMT?4gYgG%O3RcjVNWIgLyH;z9+qeXZ|G3}RgCj(?gAla^U+7i z`r8vQqNa-~l8hPKb{YIG+>nvBwF?d#92!EPMpLXopn)y8s^s@7xG#KWr$;$&CL1Qu zqb^p@sxNr_qD_*zS@`4^Eo6yHv0yWO0zWbkzHWa; z%5j|}PwngsQEO75l47Xv=qM80z}?f=#p!^L%MQb=r+}FJ_hkvM!;H9lRx+4SU?_FV zW|X*QR=Cr$TUpSH_^3l1kevG`OW8^O&e~=FVT@k^a@5r+4YcvL1>Fn{G8fDkOrNiM z6@AkBkY@Eh=(BCZkm^c{l9K}Q&y23vh4oCWEZDcNPj2<3zay#PAEg=Yfp6J7A^d|t z-d)NznRN&^2{vM+=1RXDPk$CWNR)Rcq7kco;?47{sEV%*vmxNflySp-#kSS6X}_b6 zg{X=)Z#;+66KK$V9k8aY*W5O|Db(1igU8&pdPvg6Acxa+lMh9Q{vXts@2F|?zfr^6 zqAOI&A@(M1{dbfJG{V}Oh1IZ>o;4BQ5j)C}Mml>N49z0j^MQJ!T35l&p#A zny{=YL}rkh}O^7*La7jj=JAhDLD7+GnlihTW+bWRF%)?n!g;{`CqO_ zRlFIr$L6G3$wEwCVXjR4s+Uimhq=SqJ&W-_$4chl4zRwWzyT7|>Pf}FVs)FFuOnYY z_k{w#h;!>%gh5YOSEWvn1SmD*Ys(>rE{^EM_wLDW-ui{)HNVKbNODpHyM?&@g)~O z#R3`hOGQcMAMTOS^IPw@t?aVf3Ws%1;Tvhpn=cKl=fN%xzqP)gcT7i(^#?C_t?2w9 zoC9d?_u_^zVg{>kJ!Qq!hITZ6Gw^x9t9$x7NnDGZo|3)sCBFLXIb9nE7OceL6Z-w) zNT)})hsL{umsBhQFXiMxb1jZD?IFfVO`?~f!GWG}Nh;Zowaa(eZ6XpLc?>_RaU^es z4{80+-%cnNaRZPu*LM6c-ox_F5hdDgMTkGpZ7CD`5PN9QqpE!&>`4PdQW|x025L6Z zOBVn1(PQm)jft>&4fwr1C1yA~RzKZNEahTe>6yyz=>}|7QgFC-qWJ;@$>D)NC349) zH?9cmNa#wSGs-~rZ{zT;0b`q$TCTc@;HFu;f+C|3u#IzNglzd#)T2jHi$%&{O{4n6C3M;wQxTbUEt zeWCY_NhGd*nr~E|S>trvtw$NyZl=OkIs!2=Bw4mcOto)pWI6Ww$@mb)ar=dzki>#X z=~=7=+xN2XYpIVVWrvF_6P=T2ZabB3T2+8Ip6UcSQpNm(WMhi%r3)WpW00XzV2;M6 zKuMNG%Om`9DVMkiQwrgs^nNA@E$^K&4iohgl=+5sn`TvtB}hyerKzQ8+t~aZtH(XO z+LC(DQw4ch3LiG_bv1RH{gJf-?TkY7&$0X|#^G`bgz z)+9#_qmcf2;y5X)n_lm@o{12!O zjBFH$?NpiLCzsN9d>KxTOR2-*gmv2QN)5V`ojpV}d+(L23z@Ne*L}sN^21Sxmb6i; z!@99gMrM_jGU)#ni`={u3Uow`oH8e{vX{ZR^x5I#?V;LZFCGbP*v diff --git a/cipher/ChangeLog b/cipher/ChangeLog index 29626e55e..8454706d0 100644 --- a/cipher/ChangeLog +++ b/cipher/ChangeLog @@ -1,3 +1,8 @@ +Tue Feb 24 12:28:42 1998 Werner Koch (wk@isil.d.shuttle.de) + + * md5.c, md.5 : Replaced by a modified version of md5.c from + GNU textutils 1.22. + Wed Feb 18 14:08:30 1998 Werner Koch (wk@isil.d.shuttle.de) * md.c, md.h : New debugging support diff --git a/cipher/blowfish.c b/cipher/blowfish.c index 8e3a49301..c0979b8ce 100644 --- a/cipher/blowfish.c +++ b/cipher/blowfish.c @@ -1,18 +1,18 @@ /* blowfish.c - Blowfish encryption - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * * For a description of the algorithm, see: * Bruce Schneier: Applied Cryptography. John Wiley & Sons, 1996. * ISBN 0-471-11709-9. Pages 336 ff. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/cipher/blowfish.h b/cipher/blowfish.h index 3b01f5263..998bc0c09 100644 --- a/cipher/blowfish.h +++ b/cipher/blowfish.h @@ -1,14 +1,14 @@ /* blowfish.h - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/cipher/cast5.c b/cipher/cast5.c index ef6c220a2..4d6d8408c 100644 --- a/cipher/cast5.c +++ b/cipher/cast5.c @@ -1,14 +1,14 @@ /* cast5.c - CAST5 cipher (RFC2144) - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/cipher/cast5.h b/cipher/cast5.h index 6e0b795f9..125112829 100644 --- a/cipher/cast5.h +++ b/cipher/cast5.h @@ -1,14 +1,14 @@ /* cast5.h - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/cipher/dsa.c b/cipher/dsa.c index 9d0a018a3..07f9e7075 100644 --- a/cipher/dsa.c +++ b/cipher/dsa.c @@ -1,14 +1,14 @@ /* dsa.c - DSA signature scheme - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/cipher/dsa.h b/cipher/dsa.h index 7ed38a4b3..1574560f6 100644 --- a/cipher/dsa.h +++ b/cipher/dsa.h @@ -1,14 +1,14 @@ /* dsa.h - DSA signature scheme - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/cipher/elgamal.c b/cipher/elgamal.c index 6defbc5f8..2141db0cc 100644 --- a/cipher/elgamal.c +++ b/cipher/elgamal.c @@ -1,18 +1,18 @@ /* elgamal.c - ElGamal Public Key encryption - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * * For a description of the algorithm, see: * Bruce Schneier: Applied Cryptography. John Wiley & Sons, 1996. * ISBN 0-471-11709-9. Pages 476 ff. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/cipher/elgamal.h b/cipher/elgamal.h index 26af1a007..d253fbd92 100644 --- a/cipher/elgamal.h +++ b/cipher/elgamal.h @@ -1,14 +1,14 @@ /* elgamal.h - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/cipher/gost.c b/cipher/gost.c index b890bc5e1..04f49261d 100644 --- a/cipher/gost.c +++ b/cipher/gost.c @@ -1,18 +1,18 @@ /* gost.c - GOST encryption - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * * The description of GOST (and the used S-boxes) are taken from: * Bruce Schneier: Applied Cryptography. John Wiley & Sons, 1996. * ISBN 0-471-11709-9. . * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/cipher/gost.h b/cipher/gost.h index d0f4186e3..4c0367477 100644 --- a/cipher/gost.h +++ b/cipher/gost.h @@ -1,14 +1,14 @@ /* gost.h - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/cipher/md.c b/cipher/md.c index fbae09765..dd40136a7 100644 --- a/cipher/md.c +++ b/cipher/md.c @@ -1,14 +1,14 @@ /* md.c - message digest dispatcher - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/cipher/md.h b/cipher/md.h index 5903946c2..dcdfe8000 100644 --- a/cipher/md.h +++ b/cipher/md.h @@ -1,14 +1,14 @@ /* md.h - digest functions - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/cipher/md5.c b/cipher/md5.c index ef95c7ef8..4a04abfda 100644 --- a/cipher/md5.c +++ b/cipher/md5.c @@ -1,51 +1,25 @@ /* md5.c - MD5 Message-Digest Algorithm - * Copyright (c) 1994 by Werner Koch (dd9jn) + * Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc. * - * This is a hacked version from WkLib + * according to the definition of MD5 in RFC 1321 from April 1992. + * NOTE: This is *not* the same file as the one from glibc. * - * This file is part of WkLib. + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2, or (at your option) any + * later version. * - * WkLib is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * WkLib is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - *********************************************************************** - ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. ** - ** ** - ** License to copy and use this software is granted provided that ** - ** it is identified as the "RSA Data Security, Inc. MD5 Message- ** - ** Digest Algorithm" in all material mentioning or referencing this ** - ** software or this function. ** - ** ** - ** License is also granted to make and use derivative works ** - ** provided that such works are identified as "derived from the RSA ** - ** Data Security, Inc. MD5 Message-Digest Algorithm" in all ** - ** material mentioning or referencing the derived work. ** - ** ** - ** RSA Data Security, Inc. makes no representations concerning ** - ** either the merchantability of this software or the suitability ** - ** of this software for any particular purpose. It is provided "as ** - ** is" without express or implied warranty of any kind. ** - ** ** - ** These notices must be retained in any copies of any part of this ** - ** documentation and/or software. ** - *********************************************************************** - * - * History: - * 16.01.95 wk now uses generic base-64 support - * 24.01.95 wk changed back to original base-64 coding, because - * the generic base-64 support was changed to go conform - * with RFC1113 ! + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* Written by Ulrich Drepper , 1995. */ +/* modified for GNUPG by */ /* Test values: * "" D4 1D 8C D9 8F 00 B2 04 E9 80 09 98 EC F8 42 7E @@ -64,128 +38,245 @@ #include "memory.h" -#if __WATCOMC__ && defined(M_I86) - /* 16-Bit Compiler breaks Code in Function Transform() */ - /* (at least when compiling for windows) */ - #ifndef __SW_OD - #error must be compiled without optimizations - #endif -#endif - - -static void Transform(u32 *buf,u32 *in); - -static byte PADDING[64] = { - 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -/* F, G, H and I are basic MD5 functions */ -#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) -#define G(x, y, z) (((x) & (z)) | ((y) & (~z))) -#define H(x, y, z) ((x) ^ (y) ^ (z)) -#define I(x, y, z) ((y) ^ ((x) | (~z))) - -/* ROTATE_LEFT rotates x left n bits */ -#if defined(__GNUC__) && defined(__i386__) -static inline u32 -ROTATE_LEFT(u32 x, int n) -{ - __asm__("roll %%cl,%0" - :"=r" (x) - :"0" (x),"c" (n)); - return x; -} +#ifdef BIG_ENDIAN_HOST + #define SWAP(n) \ + (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) #else - #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) + #define SWAP(n) (n) #endif -/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4 */ -/* Rotation is separate from addition to prevent recomputation */ -#define FF(a, b, c, d, x, s, ac) \ - {(a) += F ((b), (c), (d)) + (x) + (u32)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define GG(a, b, c, d, x, s, ac) \ - {(a) += G ((b), (c), (d)) + (x) + (u32)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define HH(a, b, c, d, x, s, ac) \ - {(a) += H ((b), (c), (d)) + (x) + (u32)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define II(a, b, c, d, x, s, ac) \ - {(a) += I ((b), (c), (d)) + (x) + (u32)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } - +/* This array contains the bytes used to pad the buffer to the next + 64-byte boundary. (RFC 1321, 3.1: Step 1) */ +static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; void -md5_init( MD5_CONTEXT *mdContext) +md5_init( MD5_CONTEXT *ctx ) { - mdContext->i[0] = mdContext->i[1] = (u32)0; - /* Load magic initialization constants. - */ - mdContext->buf[0] = (u32)0x67452301L; - mdContext->buf[1] = (u32)0xefcdab89L; - mdContext->buf[2] = (u32)0x98badcfeL; - mdContext->buf[3] = (u32)0x10325476L; - mdContext->count = 0; + ctx->A = 0x67452301; + ctx->B = 0xefcdab89; + ctx->C = 0x98badcfe; + ctx->D = 0x10325476; + + ctx->total[0] = ctx->total[1] = 0; + ctx->buflen = 0; } -/* The routine Update updates the message-digest context to + + + +/* These are the four functions used in the four steps of the MD5 algorithm + and defined in the RFC 1321. The first function is a little bit optimized + (as found in Colin Plumbs public domain implementation). */ +/* #define FF(b, c, d) ((b & c) | (~b & d)) */ +#define FF(b, c, d) (d ^ (b & (c ^ d))) +#define FG(b, c, d) FF (d, b, c) +#define FH(b, c, d) (b ^ c ^ d) +#define FI(b, c, d) (c ^ (b | ~d)) + + +/**************** + * transform n*64 bytes + */ +static void +transform( MD5_CONTEXT *ctx, const void *buffer, size_t len ) +{ + u32 correct_words[16]; + const u32 *words = buffer; + size_t nwords = len / sizeof(u32); + const u32 *endp = words + nwords; + u32 A = ctx->A; + u32 B = ctx->B; + u32 C = ctx->C; + u32 D = ctx->D; + + /* First increment the byte count. RFC 1321 specifies the possible + length of the file up to 2^64 bits. Here we only compute the + number of bytes. Do a double word increment. */ + ctx->total[0] += len; + if( ctx->total[0] < len ) + ++ctx->total[1]; + + + /* Process all bytes in the buffer with 64 bytes in each round of + the loop. */ + while(words < endp) { + u32 *cwp = correct_words; + u32 A_save = A; + u32 B_save = B; + u32 C_save = C; + u32 D_save = D; + + /* First round: using the given function, the context and a constant + the next context is computed. Because the algorithms processing + unit is a 32-bit word and it is determined to work on words in + little endian byte order we perhaps have to change the byte order + before the computation. To reduce the work for the next steps + we store the swapped words in the array CORRECT_WORDS. */ + +#define OP(a, b, c, d, s, T) \ + do \ + { \ + a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \ + ++words; \ + CYCLIC (a, s); \ + a += b; \ + } \ + while (0) + + /* It is unfortunate that C does not provide an operator for + cyclic rotation. Hope the C compiler is smart enough. */ +#define CYCLIC(w, s) (w = (w << s) | (w >> (32 - s))) + + /* Before we start, one word to the strange constants. + They are defined in RFC 1321 as + + T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64 + */ + + /* Round 1. */ + OP (A, B, C, D, 7, 0xd76aa478); + OP (D, A, B, C, 12, 0xe8c7b756); + OP (C, D, A, B, 17, 0x242070db); + OP (B, C, D, A, 22, 0xc1bdceee); + OP (A, B, C, D, 7, 0xf57c0faf); + OP (D, A, B, C, 12, 0x4787c62a); + OP (C, D, A, B, 17, 0xa8304613); + OP (B, C, D, A, 22, 0xfd469501); + OP (A, B, C, D, 7, 0x698098d8); + OP (D, A, B, C, 12, 0x8b44f7af); + OP (C, D, A, B, 17, 0xffff5bb1); + OP (B, C, D, A, 22, 0x895cd7be); + OP (A, B, C, D, 7, 0x6b901122); + OP (D, A, B, C, 12, 0xfd987193); + OP (C, D, A, B, 17, 0xa679438e); + OP (B, C, D, A, 22, 0x49b40821); + + /* For the second to fourth round we have the possibly swapped words + in CORRECT_WORDS. Redefine the macro to take an additional first + argument specifying the function to use. */ +#undef OP +#define OP(f, a, b, c, d, k, s, T) \ + do \ + { \ + a += f (b, c, d) + correct_words[k] + T; \ + CYCLIC (a, s); \ + a += b; \ + } \ + while (0) + + /* Round 2. */ + OP (FG, A, B, C, D, 1, 5, 0xf61e2562); + OP (FG, D, A, B, C, 6, 9, 0xc040b340); + OP (FG, C, D, A, B, 11, 14, 0x265e5a51); + OP (FG, B, C, D, A, 0, 20, 0xe9b6c7aa); + OP (FG, A, B, C, D, 5, 5, 0xd62f105d); + OP (FG, D, A, B, C, 10, 9, 0x02441453); + OP (FG, C, D, A, B, 15, 14, 0xd8a1e681); + OP (FG, B, C, D, A, 4, 20, 0xe7d3fbc8); + OP (FG, A, B, C, D, 9, 5, 0x21e1cde6); + OP (FG, D, A, B, C, 14, 9, 0xc33707d6); + OP (FG, C, D, A, B, 3, 14, 0xf4d50d87); + OP (FG, B, C, D, A, 8, 20, 0x455a14ed); + OP (FG, A, B, C, D, 13, 5, 0xa9e3e905); + OP (FG, D, A, B, C, 2, 9, 0xfcefa3f8); + OP (FG, C, D, A, B, 7, 14, 0x676f02d9); + OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a); + + /* Round 3. */ + OP (FH, A, B, C, D, 5, 4, 0xfffa3942); + OP (FH, D, A, B, C, 8, 11, 0x8771f681); + OP (FH, C, D, A, B, 11, 16, 0x6d9d6122); + OP (FH, B, C, D, A, 14, 23, 0xfde5380c); + OP (FH, A, B, C, D, 1, 4, 0xa4beea44); + OP (FH, D, A, B, C, 4, 11, 0x4bdecfa9); + OP (FH, C, D, A, B, 7, 16, 0xf6bb4b60); + OP (FH, B, C, D, A, 10, 23, 0xbebfbc70); + OP (FH, A, B, C, D, 13, 4, 0x289b7ec6); + OP (FH, D, A, B, C, 0, 11, 0xeaa127fa); + OP (FH, C, D, A, B, 3, 16, 0xd4ef3085); + OP (FH, B, C, D, A, 6, 23, 0x04881d05); + OP (FH, A, B, C, D, 9, 4, 0xd9d4d039); + OP (FH, D, A, B, C, 12, 11, 0xe6db99e5); + OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8); + OP (FH, B, C, D, A, 2, 23, 0xc4ac5665); + + /* Round 4. */ + OP (FI, A, B, C, D, 0, 6, 0xf4292244); + OP (FI, D, A, B, C, 7, 10, 0x432aff97); + OP (FI, C, D, A, B, 14, 15, 0xab9423a7); + OP (FI, B, C, D, A, 5, 21, 0xfc93a039); + OP (FI, A, B, C, D, 12, 6, 0x655b59c3); + OP (FI, D, A, B, C, 3, 10, 0x8f0ccc92); + OP (FI, C, D, A, B, 10, 15, 0xffeff47d); + OP (FI, B, C, D, A, 1, 21, 0x85845dd1); + OP (FI, A, B, C, D, 8, 6, 0x6fa87e4f); + OP (FI, D, A, B, C, 15, 10, 0xfe2ce6e0); + OP (FI, C, D, A, B, 6, 15, 0xa3014314); + OP (FI, B, C, D, A, 13, 21, 0x4e0811a1); + OP (FI, A, B, C, D, 4, 6, 0xf7537e82); + OP (FI, D, A, B, C, 11, 10, 0xbd3af235); + OP (FI, C, D, A, B, 2, 15, 0x2ad7d2bb); + OP (FI, B, C, D, A, 9, 21, 0xeb86d391); + /* Add the starting values of the context. */ + A += A_save; + B += B_save; + C += C_save; + D += D_save; + } + + /* Put checksum in context given as argument. */ + ctx->A = A; + ctx->B = B; + ctx->C = C; + ctx->D = D; +} + + + +/* The routine updates the message-digest context to * account for the presence of each of the characters inBuf[0..inLen-1] * in the message whose digest is being computed. */ void -md5_write( MD5_CONTEXT *mdContext, byte *inBuf, size_t inLen) +md5_write( MD5_CONTEXT *ctx, const void *buffer, size_t len) { - register int i, ii; - int mdi; - u32 in[16]; + /* When we already have some bits in our internal buffer concatenate + both inputs first. */ + if (ctx->buflen != 0) + { + size_t left_over = ctx->buflen; + size_t add = 128 - left_over > len ? len : 128 - left_over; - if(mdContext->count) { /* flush the buffer */ - i = mdContext->count; - mdContext->count = 0; - md5_write( mdContext, mdContext->digest, i); - } - if( !inBuf ) - return; + memcpy (&ctx->buffer[left_over], buffer, add); + ctx->buflen += add; - /* compute number of bytes mod 64 */ - mdi = (int)((mdContext->i[0] >> 3) & 0x3F); + if (left_over + add > 64) + { + transform(ctx, ctx->buffer, (left_over + add) & ~63); + /* The regions in the following copy operation cannot overlap. */ + memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63], + (left_over + add) & 63); + ctx->buflen = (left_over + add) & 63; + } - /* update number of bits */ - if((mdContext->i[0] + ((u32)inLen << 3)) < mdContext->i[0]) - mdContext->i[1]++; - mdContext->i[0] += ((u32)inLen << 3); - mdContext->i[1] += ((u32)inLen >> 29); + buffer = (const char *) buffer + add; + len -= add; + } - while(inLen--) { - /* add new character to buffer, increment mdi */ - mdContext->in[mdi++] = *inBuf++; + /* Process available complete blocks. */ + if (len > 64) + { + transform( ctx, buffer, len & ~63); + buffer = (const char *) buffer + (len & ~63); + len &= 63; + } - /* transform if necessary */ - if( mdi == 0x40 ) { - for(i = 0, ii = 0; i < 16; i++, ii += 4) - in[i] = (((u32)mdContext->in[ii+3]) << 24) | - (((u32)mdContext->in[ii+2]) << 16) | - (((u32)mdContext->in[ii+1]) << 8) | - ((u32)mdContext->in[ii]); - Transform(mdContext->buf, in); - mdi = 0; - } - } + /* Move remaining bytes in internal buffer. */ + if (len > 0) + { + memcpy (ctx->buffer, buffer, len); + ctx->buflen = len; + } } @@ -197,145 +288,33 @@ md5_write( MD5_CONTEXT *mdContext, byte *inBuf, size_t inLen) */ void -md5_final( MD5_CONTEXT *mdContext ) +md5_final( MD5_CONTEXT *ctx ) { - u32 in[16]; - int mdi; - unsigned int i, ii; - unsigned int padLen; + /* Take yet unprocessed bytes into account. */ + u32 bytes = ctx->buflen; + size_t pad; - if(mdContext->count) /* flush buffer */ - md5_write(mdContext, NULL, 0 ); - /* save number of bits */ - in[14] = mdContext->i[0]; - in[15] = mdContext->i[1]; + /* Now count remaining bytes. */ + ctx->total[0] += bytes; + if( ctx->total[0] < bytes ) + ++ctx->total[1]; - /* compute number of bytes mod 64 */ - mdi = (int)((mdContext->i[0] >> 3) & 0x3F); + pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes; + memcpy (&ctx->buffer[bytes], fillbuf, pad); - /* pad out to 56 mod 64 */ - padLen = (mdi < 56) ? (56 - mdi) : (120 - mdi); - md5_write(mdContext, PADDING, padLen); + /* Put the 64-bit file length in *bits* at the end of the buffer. */ + *(u32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3); + *(u32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) | + (ctx->total[0] >> 29)); - /* append length in bits and transform */ - for(i = 0, ii = 0; i < 14; i++, ii += 4) - in[i] = (((u32)mdContext->in[ii+3]) << 24) | - (((u32)mdContext->in[ii+2]) << 16) | - (((u32)mdContext->in[ii+1]) << 8) | - ((u32)mdContext->in[ii]); - Transform(mdContext->buf, in); + /* Process last bytes. */ + transform( ctx, ctx->buffer, bytes + pad + 8); - /* store buffer in digest */ - for(i = 0, ii = 0; i < 4; i++, ii += 4) { - mdContext->digest[ii] = (byte)(mdContext->buf[i] & 0xFF); - mdContext->digest[ii+1] = (byte)((mdContext->buf[i] >> 8) & 0xFF); - mdContext->digest[ii+2] = (byte)((mdContext->buf[i] >> 16) & 0xFF); - mdContext->digest[ii+3] = (byte)((mdContext->buf[i] >> 24) & 0xFF); - } -} - - -/* Basic MD5 step. Transforms buf based on in. Note that if the Mysterious - * Constants are arranged backwards in little-endian order and decrypted with - * the DES they produce OCCULT MESSAGES! - */ -static void -Transform(register u32 *buf,register u32 *in) -{ - register u32 a = buf[0], b = buf[1], c = buf[2], d = buf[3]; - - /* Round 1 */ -#define S11 7 -#define S12 12 -#define S13 17 -#define S14 22 - FF ( a, b, c, d, in[ 0], S11, 0xD76AA478L); /* 1 */ - FF ( d, a, b, c, in[ 1], S12, 0xE8C7B756L); /* 2 */ - FF ( c, d, a, b, in[ 2], S13, 0x242070DBL); /* 3 */ - FF ( b, c, d, a, in[ 3], S14, 0xC1BDCEEEL); /* 4 */ - FF ( a, b, c, d, in[ 4], S11, 0xF57C0FAFL); /* 5 */ - FF ( d, a, b, c, in[ 5], S12, 0x4787C62AL); /* 6 */ - FF ( c, d, a, b, in[ 6], S13, 0xA8304613L); /* 7 */ - FF ( b, c, d, a, in[ 7], S14, 0xFD469501L); /* 8 */ - FF ( a, b, c, d, in[ 8], S11, 0x698098D8L); /* 9 */ - FF ( d, a, b, c, in[ 9], S12, 0x8B44F7AFL); /* 10 */ - FF ( c, d, a, b, in[10], S13, 0xFFFF5BB1L); /* 11 */ - FF ( b, c, d, a, in[11], S14, 0x895CD7BEL); /* 12 */ - FF ( a, b, c, d, in[12], S11, 0x6B901122L); /* 13 */ - FF ( d, a, b, c, in[13], S12, 0xFD987193L); /* 14 */ - FF ( c, d, a, b, in[14], S13, 0xA679438EL); /* 15 */ - FF ( b, c, d, a, in[15], S14, 0x49B40821L); /* 16 */ - - /* Round 2 */ -#define S21 5 -#define S22 9 -#define S23 14 -#define S24 20 - GG ( a, b, c, d, in[ 1], S21, 0xF61E2562L); /* 17 */ - GG ( d, a, b, c, in[ 6], S22, 0xC040B340L); /* 18 */ - GG ( c, d, a, b, in[11], S23, 0x265E5A51L); /* 19 */ - GG ( b, c, d, a, in[ 0], S24, 0xE9B6C7AAL); /* 20 */ - GG ( a, b, c, d, in[ 5], S21, 0xD62F105DL); /* 21 */ - GG ( d, a, b, c, in[10], S22, 0x02441453L); /* 22 */ - GG ( c, d, a, b, in[15], S23, 0xD8A1E681L); /* 23 */ - GG ( b, c, d, a, in[ 4], S24, 0xE7D3FBC8L); /* 24 */ - GG ( a, b, c, d, in[ 9], S21, 0x21E1CDE6L); /* 25 */ - GG ( d, a, b, c, in[14], S22, 0xC33707D6L); /* 26 */ - GG ( c, d, a, b, in[ 3], S23, 0xF4D50D87L); /* 27 */ - GG ( b, c, d, a, in[ 8], S24, 0x455A14EDL); /* 28 */ - GG ( a, b, c, d, in[13], S21, 0xA9E3E905L); /* 29 */ - GG ( d, a, b, c, in[ 2], S22, 0xFCEFA3F8L); /* 30 */ - GG ( c, d, a, b, in[ 7], S23, 0x676F02D9L); /* 31 */ - GG ( b, c, d, a, in[12], S24, 0x8D2A4C8AL); /* 32 */ - - /* Round 3 */ -#define S31 4 -#define S32 11 -#define S33 16 -#define S34 23 - HH ( a, b, c, d, in[ 5], S31, 0xFFFA3942L); /* 33 */ - HH ( d, a, b, c, in[ 8], S32, 0x8771F681L); /* 34 */ - HH ( c, d, a, b, in[11], S33, 0x6D9D6122L); /* 35 */ - HH ( b, c, d, a, in[14], S34, 0xFDE5380CL); /* 36 */ - HH ( a, b, c, d, in[ 1], S31, 0xA4BEEA44L); /* 37 */ - HH ( d, a, b, c, in[ 4], S32, 0x4BDECFA9L); /* 38 */ - HH ( c, d, a, b, in[ 7], S33, 0xF6BB4B60L); /* 39 */ - HH ( b, c, d, a, in[10], S34, 0xBEBFBC70L); /* 40 */ - HH ( a, b, c, d, in[13], S31, 0x289B7EC6L); /* 41 */ - HH ( d, a, b, c, in[ 0], S32, 0xEAA127FAL); /* 42 */ - HH ( c, d, a, b, in[ 3], S33, 0xD4EF3085L); /* 43 */ - HH ( b, c, d, a, in[ 6], S34, 0x04881D05L); /* 44 */ - HH ( a, b, c, d, in[ 9], S31, 0xD9D4D039L); /* 45 */ - HH ( d, a, b, c, in[12], S32, 0xE6DB99E5L); /* 46 */ - HH ( c, d, a, b, in[15], S33, 0x1FA27CF8L); /* 47 */ - HH ( b, c, d, a, in[ 2], S34, 0xC4AC5665L); /* 48 */ - - /* Round 4 */ -#define S41 6 -#define S42 10 -#define S43 15 -#define S44 21 - II ( a, b, c, d, in[ 0], S41, 0xF4292244L); /* 49 */ - II ( d, a, b, c, in[ 7], S42, 0x432AFF97L); /* 50 */ - II ( c, d, a, b, in[14], S43, 0xAB9423A7L); /* 51 */ - II ( b, c, d, a, in[ 5], S44, 0xFC93A039L); /* 52 */ - II ( a, b, c, d, in[12], S41, 0x655B59C3L); /* 53 */ - II ( d, a, b, c, in[ 3], S42, 0x8F0CCC92L); /* 54 */ - II ( c, d, a, b, in[10], S43, 0xFFEFF47DL); /* 55 */ - II ( b, c, d, a, in[ 1], S44, 0x85845DD1L); /* 56 */ - II ( a, b, c, d, in[ 8], S41, 0x6FA87E4FL); /* 57 */ - II ( d, a, b, c, in[15], S42, 0xFE2CE6E0L); /* 58 */ - II ( c, d, a, b, in[ 6], S43, 0xA3014314L); /* 59 */ - II ( b, c, d, a, in[13], S44, 0x4E0811A1L); /* 60 */ - II ( a, b, c, d, in[ 4], S41, 0xF7537E82L); /* 61 */ - II ( d, a, b, c, in[11], S42, 0xBD3AF235L); /* 62 */ - II ( c, d, a, b, in[ 2], S43, 0x2AD7D2BBL); /* 63 */ - II ( b, c, d, a, in[ 9], S44, 0xEB86D391L); /* 64 */ - - buf[0] += a; - buf[1] += b; - buf[2] += c; - buf[3] += d; + /* Store the result in buffer */ + ((u32 *)ctx->buffer)[0] = SWAP (ctx->A); + ((u32 *)ctx->buffer)[1] = SWAP (ctx->B); + ((u32 *)ctx->buffer)[2] = SWAP (ctx->C); + ((u32 *)ctx->buffer)[3] = SWAP (ctx->D); } diff --git a/cipher/md5.h b/cipher/md5.h index c46075a3b..817a526a4 100644 --- a/cipher/md5.h +++ b/cipher/md5.h @@ -1,14 +1,14 @@ /* md5.h - message digest 5 - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -23,17 +23,16 @@ #include "types.h" typedef struct { - u32 i[2]; /* number of _bits_ handled mod 2^64 */ - u32 buf[4]; /* scratch buffer */ - int count; - byte in[64]; /* input buffer */ - byte digest[16+8+1]; /* actual digest after Final call */ + u32 A,B,C,D; /* chaining variables */ + u32 total[2]; + u32 buflen; + char buffer[128]; } MD5_CONTEXT; -void md5_init( MD5_CONTEXT *c ); -void md5_write( MD5_CONTEXT *hd, byte *inbuf, size_t inlen); -void md5_final( MD5_CONTEXT *hd); -#define md5_read(h) ( (h)->digest ) +void md5_init( MD5_CONTEXT *ctx ); +void md5_write( MD5_CONTEXT *ctx, const void *buffer, size_t len); +void md5_final( MD5_CONTEXT *ctx); +#define md5_read(h) ( (h)->buffer ) #endif /*G10_MD5_H*/ diff --git a/cipher/misc.c b/cipher/misc.c index 6dcd20245..4fe7450d1 100644 --- a/cipher/misc.c +++ b/cipher/misc.c @@ -1,14 +1,14 @@ /* misc.c - utility functions - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/cipher/primegen.c b/cipher/primegen.c index 3a2a91f7b..cf77e66a3 100644 --- a/cipher/primegen.c +++ b/cipher/primegen.c @@ -1,14 +1,14 @@ /* primegen.c - prime number generator - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/cipher/random.c b/cipher/random.c index 26777aa91..635c40a40 100644 --- a/cipher/random.c +++ b/cipher/random.c @@ -1,14 +1,14 @@ /* random.c - random number generator - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -53,11 +53,10 @@ quick_random_gen( int onoff ) int last = quick_test; if( onoff != -1 ) quick_test = onoff; - #ifdef HAVE_DEV_RANDOM - return last; - #else - return 1; /* insecure RNG */ + #ifndef HAVE_DEV_RANDOM + last = 1; /* insecure RNG */ #endif + return last; } diff --git a/cipher/rmd.h b/cipher/rmd.h index 8f53634d8..d6bc007d1 100644 --- a/cipher/rmd.h +++ b/cipher/rmd.h @@ -1,14 +1,14 @@ /* rmd.h - RIPE-MD hash functions - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/cipher/rmd160.c b/cipher/rmd160.c index 39f1c740c..7b87d4218 100644 --- a/cipher/rmd160.c +++ b/cipher/rmd160.c @@ -1,14 +1,14 @@ /* rmd160.c - RIPE-MD160 - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/cipher/rmd160test.c b/cipher/rmd160test.c index 365fde02c..bfbd9bc83 100644 --- a/cipher/rmd160test.c +++ b/cipher/rmd160test.c @@ -1,14 +1,14 @@ /* rmd160test.c - ripe md 160 test program - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/cipher/sha1.c b/cipher/sha1.c index a54ec6a80..1f7367dc4 100644 --- a/cipher/sha1.c +++ b/cipher/sha1.c @@ -1,16 +1,16 @@ /* sha1.c - SHA1 hash function - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * * Please see below for more legal informations! * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/cipher/sha1.h b/cipher/sha1.h index 93af2cace..1a183ffb8 100644 --- a/cipher/sha1.h +++ b/cipher/sha1.h @@ -1,14 +1,14 @@ /* sha1.h - SHA1 hash function - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/cipher/smallprime.c b/cipher/smallprime.c index 74a1304a4..1b3a1d454 100644 --- a/cipher/smallprime.c +++ b/cipher/smallprime.c @@ -1,14 +1,14 @@ /* smallprime.c - List of small primes - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/config.h.in b/config.h.in index 5405256d6..bca24c7e4 100644 --- a/config.h.in +++ b/config.h.in @@ -1,15 +1,15 @@ /* config.h.in. Generated automatically from configure.in by autoheader. */ /* acconfig.h - used by autoheader to make config.h.in - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/configure.in b/configure.in index e27b03131..f2eaa5ec7 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl -dnl Configure template for G10 +dnl Configure template for GNUPG dnl dnl (Process this file with autoconf to produce a configure script.) @@ -20,7 +20,7 @@ fi VERSION=`cat $srcdir/VERSION` -PACKAGE=g10 +PACKAGE=gnupg ALL_LINGUAS="de" AC_SUBST(VERSION) AC_SUBST(PACKAGE) diff --git a/doc/DETAILS b/doc/DETAILS index dc3e55421..4b8eda8ed 100644 --- a/doc/DETAILS +++ b/doc/DETAILS @@ -31,7 +31,7 @@ Record type 1: Version information for this TrustDB. This is always the first record of the DB and the onyl one with type 1. 1 byte value 1 - 3 bytes 'g10' magic value + 3 bytes 'gpg' magic value 1 byte Version of the TrustDB 3 byte reserved 1 u32 locked by (pid) 0 = not locked. @@ -185,7 +185,7 @@ Record type 7 (hash list) Packet Headers =============== -G10 uses PGP 2 packet headers and also understand OpenPGP packet header. +GNUPG uses PGP 2 packet headers and also understand OpenPGP packet header. There is one enhavement used ith the old style packet headers: CTB bits 10, the "packet-length length bits", have values listed in diff --git a/g10/ChangeLog b/g10/ChangeLog index c352db6fb..e4359ede9 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,24 @@ +Tue Feb 24 15:51:55 1998 Werner Koch (wk@isil.d.shuttle.de) + + * parse-packet.c (parse_certificate): Support for S2K. + * build-packet.c (do_secret_cert): Ditto. + * keygen.c (gen_elg): Ditto. + * seckey-cert.c (check_elg): Ditto + (protect_elg): Ditto. + * sign.c (chnage_passphrase): Ditto. + * passphrase.c (get_passphrase_hash): Support for a salt and + changed all callers. + (make_dek_from_passphrase): Ditto. + +Tue Feb 24 12:30:56 1998 Werner Koch (wk@isil.d.shuttle.de) + + * build-packet.c (hash_public_cert): Disabled debug output. + +Fri Feb 20 17:22:28 1998 Werner Koch (wk@isil.d.shuttle.de) + + * trustdb.c (init_trustdb) [MINGW32]: Removed 2nd mkdir arg. + (keyring_copy) [MINGW32]: Add a remove prior to the renames. + Wed Feb 18 18:39:02 1998 Werner Koch (wk@isil.d.shuttle.de) * Makefile.am (OMIT_DEPENDENCIES): New. diff --git a/g10/Makefile.am b/g10/Makefile.am index a2a72f778..bee2df285 100644 --- a/g10/Makefile.am +++ b/g10/Makefile.am @@ -5,7 +5,7 @@ EXTRA_DIST = OPTIONS pubring.asc OMIT_DEPENDENCIES = zlib.h zconf.h needed_libs = ../cipher/libcipher.a ../mpi/libmpi.a ../util/libutil.a -bin_PROGRAMS = g10 g10maint +bin_PROGRAMS = gpg gpgm common_source = \ build-packet.c \ @@ -49,12 +49,12 @@ common_source = \ revoke.c \ sig-check.c -g10_SOURCES = g10.c \ +gpg_SOURCES = g10.c \ $(common_source) \ keygen.c -g10maint_SOURCES = g10maint.c \ +gpgm_SOURCES = g10maint.c \ dearmor.c \ $(common_source) diff --git a/g10/Makefile.in b/g10/Makefile.in index 6b2a3b25a..034d4ba9e 100644 --- a/g10/Makefile.in +++ b/g10/Makefile.in @@ -91,7 +91,7 @@ EXTRA_DIST = OPTIONS pubring.asc OMIT_DEPENDENCIES = zlib.h zconf.h needed_libs = ../cipher/libcipher.a ../mpi/libmpi.a ../util/libutil.a -bin_PROGRAMS = g10 g10maint +bin_PROGRAMS = gpg gpgm common_source = \ build-packet.c \ @@ -135,11 +135,11 @@ common_source = \ revoke.c \ sig-check.c -g10_SOURCES = g10.c \ +gpg_SOURCES = g10.c \ $(common_source) \ keygen.c -g10maint_SOURCES = g10maint.c \ +gpgm_SOURCES = g10maint.c \ dearmor.c \ $(common_source) @@ -154,26 +154,26 @@ DEFS = @DEFS@ -I. -I$(srcdir) -I.. CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ -g10_OBJECTS = g10.o build-packet.o compress.o free-packet.o getkey.o \ +gpg_OBJECTS = g10.o build-packet.o compress.o free-packet.o getkey.o \ pkclist.o skclist.o ringedit.o kbnode.o mainproc.o armor.o mdfilter.o \ textfilter.o cipher.o elg.o rsa.o openfile.o keyid.o trustdb.o \ parse-packet.o passphrase.o pubkey-enc.o seckey-cert.o seskey.o \ import.o export.o comment.o status.o sign.o plaintext.o encr-data.o \ encode.o revoke.o sig-check.o keygen.o -g10_LDADD = $(LDADD) -g10_DEPENDENCIES = ../cipher/libcipher.a ../mpi/libmpi.a \ +gpg_LDADD = $(LDADD) +gpg_DEPENDENCIES = ../cipher/libcipher.a ../mpi/libmpi.a \ ../util/libutil.a -g10_LDFLAGS = -g10maint_OBJECTS = g10maint.o dearmor.o build-packet.o compress.o \ +gpg_LDFLAGS = +gpgm_OBJECTS = g10maint.o dearmor.o build-packet.o compress.o \ free-packet.o getkey.o pkclist.o skclist.o ringedit.o kbnode.o \ mainproc.o armor.o mdfilter.o textfilter.o cipher.o elg.o rsa.o \ openfile.o keyid.o trustdb.o parse-packet.o passphrase.o pubkey-enc.o \ seckey-cert.o seskey.o import.o export.o comment.o status.o sign.o \ plaintext.o encr-data.o encode.o revoke.o sig-check.o -g10maint_LDADD = $(LDADD) -g10maint_DEPENDENCIES = ../cipher/libcipher.a ../mpi/libmpi.a \ +gpgm_LDADD = $(LDADD) +gpgm_DEPENDENCIES = ../cipher/libcipher.a ../mpi/libmpi.a \ ../util/libutil.a -g10maint_LDFLAGS = +gpgm_LDFLAGS = CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ @@ -194,8 +194,8 @@ DEP_FILES = .deps/armor.P .deps/build-packet.P .deps/cipher.P \ .deps/revoke.P .deps/ringedit.P .deps/rsa.P .deps/seckey-cert.P \ .deps/seskey.P .deps/sig-check.P .deps/sign.P .deps/skclist.P \ .deps/status.P .deps/textfilter.P .deps/trustdb.P -SOURCES = $(g10_SOURCES) $(g10maint_SOURCES) -OBJECTS = $(g10_OBJECTS) $(g10maint_OBJECTS) +SOURCES = $(gpg_SOURCES) $(gpgm_SOURCES) +OBJECTS = $(gpg_OBJECTS) $(gpgm_OBJECTS) default: all @@ -253,13 +253,13 @@ distclean-compile: maintainer-clean-compile: -g10: $(g10_OBJECTS) $(g10_DEPENDENCIES) - @rm -f g10 - $(LINK) $(g10_LDFLAGS) $(g10_OBJECTS) $(g10_LDADD) $(LIBS) +gpg: $(gpg_OBJECTS) $(gpg_DEPENDENCIES) + @rm -f gpg + $(LINK) $(gpg_LDFLAGS) $(gpg_OBJECTS) $(gpg_LDADD) $(LIBS) -g10maint: $(g10maint_OBJECTS) $(g10maint_DEPENDENCIES) - @rm -f g10maint - $(LINK) $(g10maint_LDFLAGS) $(g10maint_OBJECTS) $(g10maint_LDADD) $(LIBS) +gpgm: $(gpgm_OBJECTS) $(gpgm_DEPENDENCIES) + @rm -f gpgm + $(LINK) $(gpgm_LDFLAGS) $(gpgm_OBJECTS) $(gpgm_LDADD) $(LIBS) tags: TAGS diff --git a/g10/armor.c b/g10/armor.c index 1fc8ae0b0..80de65551 100644 --- a/g10/armor.c +++ b/g10/armor.c @@ -1,14 +1,14 @@ /* armor.c - Armor filter - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -942,7 +942,7 @@ armor_filter( void *opaque, int control, iobuf_writestr(a, "-----"); iobuf_writestr(a, head_strings[afx->what] ); iobuf_writestr(a, "-----\n"); - iobuf_writestr(a, "Version: G10 v" VERSION " (" + iobuf_writestr(a, "Version: GNUPG v" VERSION " (" PRINTABLE_OS_NAME ")\n"); iobuf_writestr(a, "Comment: This is an alpha version!\n"); if( afx->hdrlines ) diff --git a/g10/build-packet.c b/g10/build-packet.c index b032a67b0..ea8a875ad 100644 --- a/g10/build-packet.c +++ b/g10/build-packet.c @@ -1,14 +1,14 @@ /* build-packet.c - assemble packets and write them - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -211,7 +211,7 @@ hash_public_cert( MD_HANDLE md, PKT_public_cert *pkc ) int rc = 0; int c; IOBUF a = iobuf_temp(); - #if 1 + #if 0 FILE *fp = fopen("dump.pkc", "a"); int i=0; @@ -225,7 +225,7 @@ hash_public_cert( MD_HANDLE md, PKT_public_cert *pkc ) if( (rc = build_packet( a, &pkt )) ) log_fatal("build public_cert for hashing failed: %s\n", g10_errstr(rc)); while( (c=iobuf_get(a)) != -1 ) { - #if 1 + #if 0 fprintf( fp," %02x", c ); if( (++i == 24) ) { putc('\n', fp); @@ -234,7 +234,7 @@ hash_public_cert( MD_HANDLE md, PKT_public_cert *pkc ) #endif md_putc( md, c ); } - #if 1 + #if 0 putc('\n', fp); fclose(fp); #endif @@ -260,9 +260,16 @@ do_secret_cert( IOBUF out, int ctb, PKT_secret_cert *skc ) mpi_write(a, skc->d.elg.g ); mpi_write(a, skc->d.elg.y ); if( skc->d.elg.is_protected ) { - assert( skc->d.elg.protect_algo == CIPHER_ALGO_BLOWFISH ); - iobuf_put(a, skc->d.elg.protect_algo ); - iobuf_write(a, skc->d.elg.protect.blowfish.iv, 8 ); + iobuf_put(a, 0xff ); + iobuf_put(a, skc->d.elg.protect.algo ); + iobuf_put(a, skc->d.elg.protect.s2k ); + iobuf_put(a, skc->d.elg.protect.hash ); + if( skc->d.elg.protect.s2k == 1 + || skc->d.elg.protect.s2k == 3 ) + iobuf_write(a, skc->d.elg.protect.salt, 8 ); + if( skc->d.elg.protect.s2k == 3 ) + iobuf_put(a, skc->d.elg.protect.count ); + iobuf_write(a, skc->d.elg.protect.iv, 8 ); } else iobuf_put(a, 0 ); diff --git a/g10/cipher.c b/g10/cipher.c index 37bba3458..43f0afb21 100644 --- a/g10/cipher.c +++ b/g10/cipher.c @@ -1,14 +1,14 @@ /* cipher.c - En-/De-ciphering filter - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/comment.c b/g10/comment.c index ce2e6cc4c..77b9a7ece 100644 --- a/g10/comment.c +++ b/g10/comment.c @@ -1,14 +1,14 @@ /* comment.c - write comment stuff - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/compress.c b/g10/compress.c index 7a1d9729f..ebad43045 100644 --- a/g10/compress.c +++ b/g10/compress.c @@ -1,14 +1,14 @@ /* compress.c - compress filter - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/elg.c b/g10/elg.c index f3a8923fa..62c5014c8 100644 --- a/g10/elg.c +++ b/g10/elg.c @@ -1,14 +1,14 @@ /* elg.c - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/encode.c b/g10/encode.c index 5726bc2b7..a7fa409c2 100644 --- a/g10/encode.c +++ b/g10/encode.c @@ -1,14 +1,14 @@ /* encode.c - encode data - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -89,7 +89,7 @@ encode_simple( const char *filename, int mode ) if( mode ) { cfx.dek = m_alloc_secure( sizeof *cfx.dek ); cfx.dek->algo = opt.def_cipher_algo; - if( (rc = make_dek_from_passphrase( cfx.dek , 2 )) ) { + if( (rc = make_dek_from_passphrase( cfx.dek , 2, NULL )) ) { m_free(cfx.dek); iobuf_close(inp); log_error("error creating passphrase: %s\n", g10_errstr(rc) ); @@ -106,7 +106,7 @@ encode_simple( const char *filename, int mode ) if( opt.armor ) iobuf_push_filter( out, armor_filter, &afx ); - write_comment( out, "#created by G10 v" VERSION " (" + write_comment( out, "#created by GNUPG v" VERSION " (" PRINTABLE_OS_NAME ")"); if( opt.compress ) @@ -193,7 +193,7 @@ encode_crypt( const char *filename, STRLIST remusr ) if( opt.armor ) iobuf_push_filter( out, armor_filter, &afx ); - write_comment( out, "#created by G10 v" VERSION " (" + write_comment( out, "#created by GNUPG v" VERSION " (" PRINTABLE_OS_NAME ")"); if( opt.compress ) diff --git a/g10/encr-data.c b/g10/encr-data.c index 43e48a96d..a1b4be0e9 100644 --- a/g10/encr-data.c +++ b/g10/encr-data.c @@ -1,14 +1,14 @@ /* encr-data.c - process an encrypted data packet - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/export.c b/g10/export.c index 619d69958..844098355 100644 --- a/g10/export.c +++ b/g10/export.c @@ -1,14 +1,14 @@ /* export.c - * Copyright (c) 1998 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/filter.h b/g10/filter.h index 965b75bd0..2fa3b8c45 100644 --- a/g10/filter.h +++ b/g10/filter.h @@ -1,14 +1,14 @@ /* filter.h - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/free-packet.c b/g10/free-packet.c index 9152f9051..fa1a53ccf 100644 --- a/g10/free-packet.c +++ b/g10/free-packet.c @@ -1,14 +1,14 @@ /* free-packet.c - cleanup stuff for packets - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/g10.c b/g10/g10.c index 433955717..89d9a3380 100644 --- a/g10/g10.c +++ b/g10/g10.c @@ -1,14 +1,14 @@ -/* g10.c - The G10 utility - * Copyright (c) 1997 by Werner Koch (dd9jn) +/* g10.c - The GNUPG utility (main for gpg) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -110,7 +110,7 @@ static ARGPARSE_OPTS opts[] = { { 523, "passphrase-fd",1, "\r" }, { 541, "no-operation", 0, "\r" }, /* used by regression tests */ { 543, "no-options", 0, "\r" }, /* shortcut for --options /dev/null */ - { 544, "homedir", 2, "\r" }, /* defaults to "~/.g10" */ + { 544, "homedir", 2, "\r" }, /* defaults to "~/.gnupg" */ { 545, "no-batch", 0, "\r" }, {0} }; @@ -137,18 +137,18 @@ strusage( int level ) static char *digests, *pubkeys, *ciphers; const char *p; switch( level ) { - case 11: p = "g10"; break; + case 11: p = "GNUPG"; break; case 13: p = VERSION; break; case 17: p = PRINTABLE_OS_NAME; break; case 19: p = _( -"Please report bugs to ." +"Please report bugs to .\n" ); break; case 1: case 40: p = _( -"Usage: g10 [options] [files] (-h for help)" +"Usage: gpg [options] [files] (-h for help)" ); break; case 41: p = _( -"Syntax: g10 [options] [files]\n" +"Syntax: gpg [options] [files]\n" "sign, check, encrypt or decrypt\n" "default operation depends on the input data\n" ); break; @@ -223,7 +223,7 @@ i18n_init(void) static void wrong_args( const char *text) { - fputs(_("usage: g10 [options] "),stderr); + fputs(_("usage: gpg [options] "),stderr); fputs(text,stderr); putc('\n',stderr); g10_exit(2); @@ -318,7 +318,7 @@ main( int argc, char **argv ) * secmem_init() somewhere after the option parsing */ - log_set_name("g10"); + log_set_name("gpg"); i18n_init(); opt.compress = -1; /* defaults to standard compress level */ opt.def_cipher_algo = CIPHER_ALGO_BLOWFISH; @@ -326,7 +326,7 @@ main( int argc, char **argv ) opt.def_digest_algo = DIGEST_ALGO_RMD160; opt.completes_needed = 1; opt.marginals_needed = 3; - opt.homedir = "~/.g10"; + opt.homedir = "~/.gnupg"; /* check wether we have a config file on the commandline */ orig_argc = argc; @@ -501,9 +501,9 @@ main( int argc, char **argv ) set_packet_list_mode(1); if( !sec_nrings || default_keyring ) /* add default secret rings */ - add_secret_keyring("secring.g10"); + add_secret_keyring("secring.gpg"); if( !nrings || default_keyring ) /* add default ring */ - add_keyring("pubring.g10"); + add_keyring("pubring.gpg"); if( argc ) { fname_print = fname = *argv; diff --git a/g10/g10maint.c b/g10/g10maint.c index 3204aab2b..ed0f90e56 100644 --- a/g10/g10maint.c +++ b/g10/g10maint.c @@ -1,14 +1,14 @@ -/* g10maint.c - The G10 maintenance utility - * Copyright (c) 1997 by Werner Koch (dd9jn) +/* g10maint.c - The GNUPG maintenance utility + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -62,19 +62,19 @@ strusage( int level ) static char *digests, *pubkeys, *ciphers; const char *p; switch( level ) { - case 11: p = "g10maint"; break; + case 11: p = "gpgm (GNUPG)"; break; case 13: p = VERSION; break; case 17: p = PRINTABLE_OS_NAME; break; case 19: p = _( -"Please report bugs to ." +"Please report bugs to .\n" ); break; case 1: case 40: p = _( -"Usage: g10maint [options] [files] (-h for help)" +"Usage: gpgm [options] [files] (-h for help)" ); break; case 41: p = _( -"Syntax: g10maint [options] [files]\n" -"G10 maintenance utility\n" +"Syntax: gpgm [options] [files]\n" +"GNUPG maintenance utility\n" ); break; case 31: p = "\n"; break; @@ -146,7 +146,7 @@ i18n_init(void) static void wrong_args( const char *text) { - fputs(_("Usage: g10maint [options] "),stderr); + fputs(_("Usage: gpgm [options] "),stderr); fputs(text,stderr); putc('\n',stderr); g10_exit(2); @@ -221,7 +221,7 @@ main( int argc, char **argv ) { 538, "trustdb-name", 2, "\r" }, { 540, "no-secmem-warning", 0, "\r" }, /* dummy */ { 543, "no-options", 0, "\r" }, /* shortcut for --options /dev/null */ - { 544, "homedir", 2, "\r" }, /* defaults to "~/.g10" */ + { 544, "homedir", 2, "\r" }, /* defaults to "~/.gpg" */ { 545, "no-batch", 0, "\r" }, { 546, "dearmor", 0, N_("De-Armor a file or stdin") }, { 547, "enarmor", 0, N_("En-Armor a file or stdin") }, @@ -250,7 +250,7 @@ main( int argc, char **argv ) secmem_init( 0 ); /* disable use of secmem */ - log_set_name("g10maint"); + log_set_name("gpgm"); i18n_init(); opt.compress = -1; /* defaults to standard compress level */ opt.def_cipher_algo = CIPHER_ALGO_BLOWFISH; @@ -258,7 +258,7 @@ main( int argc, char **argv ) opt.def_digest_algo = DIGEST_ALGO_RMD160; opt.completes_needed = 1; opt.marginals_needed = 3; - opt.homedir = "~/.g10"; + opt.homedir = "~/.gnupg"; /* check wether we have a config file on the commandline */ orig_argc = argc; @@ -424,12 +424,12 @@ main( int argc, char **argv ) if( cmd != aDeArmor && cmd != aEnArmor ) { if( !sec_nrings || default_keyring ) { /* add default secret rings */ - char *p = make_filename(opt.homedir, "secring.g10", NULL ); + char *p = make_filename(opt.homedir, "secring.gpg", NULL ); add_secret_keyring(p); m_free(p); } if( !nrings || default_keyring ) { /* add default ring */ - char *p = make_filename(opt.homedir, "pubring.g10", NULL ); + char *p = make_filename(opt.homedir, "pubring.gpg", NULL ); add_keyring(p); m_free(p); } diff --git a/g10/getkey.c b/g10/getkey.c index e58b0f813..dd72f6df0 100644 --- a/g10/getkey.c +++ b/g10/getkey.c @@ -1,14 +1,14 @@ /* getkey.c - Get a key from the database - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/import.c b/g10/import.c index fa08e8657..a99b4793b 100644 --- a/g10/import.c +++ b/g10/import.c @@ -1,14 +1,14 @@ /* import.c - * Copyright (c) 1998 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/kbnode.c b/g10/kbnode.c index 3137e6191..5a6d16abc 100644 --- a/g10/kbnode.c +++ b/g10/kbnode.c @@ -1,14 +1,14 @@ /* kbnode.c - keyblock node utility functions - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/keydb.h b/g10/keydb.h index eff603a04..7f49f3545 100644 --- a/g10/keydb.h +++ b/g10/keydb.h @@ -1,14 +1,14 @@ /* keydb.h - Key database - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -95,8 +95,8 @@ int build_skc_list( STRLIST locusr, SKC_LIST *ret_skc_list, int unlock ); /*-- passphrase.h --*/ void set_passphrase_fd( int fd ); int get_passphrase_fd(void); -DEK *get_passphrase_hash( u32 *keyid, char *text ); -int make_dek_from_passphrase( DEK *dek, int mode ); +DEK *get_passphrase_hash( u32 *keyid, char *text, byte *salt ); +int make_dek_from_passphrase( DEK *dek, int mode, byte *salt ); /*-- getkey.c --*/ void add_keyring( const char *name ); diff --git a/g10/keygen.c b/g10/keygen.c index 96a867c1e..f883f23af 100644 --- a/g10/keygen.c +++ b/g10/keygen.c @@ -1,14 +1,14 @@ /* keygen.c - generate a key pair - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -136,7 +136,7 @@ write_selfsig( KBNODE root, KBNODE pub_root, PKT_secret_cert *skc ) static int gen_elg(unsigned nbits, KBNODE pub_root, KBNODE sec_root, DEK *dek, - PKT_secret_cert **ret_skc ) + byte *salt, PKT_secret_cert **ret_skc ) { int rc; int i; @@ -162,15 +162,18 @@ gen_elg(unsigned nbits, KBNODE pub_root, KBNODE sec_root, DEK *dek, skc->d.elg.y = sk.y; skc->d.elg.x = sk.x; skc->d.elg.is_protected = 0; - skc->d.elg.protect_algo = 0; + skc->d.elg.protect.algo = 0; skc->d.elg.csum = checksum_mpi( skc->d.elg.x ); /* return an unprotected version of the skc */ *ret_skc = copy_secret_cert( NULL, skc ); if( dek ) { - skc->d.elg.protect_algo = CIPHER_ALGO_BLOWFISH; - randomize_buffer(skc->d.elg.protect.blowfish.iv, 8, 1); + skc->d.elg.protect.algo = CIPHER_ALGO_BLOWFISH; + skc->d.elg.protect.s2k = 1; + skc->d.elg.protect.hash = DIGEST_ALGO_RMD160; + memcpy(skc->d.elg.protect.salt, salt, 8); + randomize_buffer(skc->d.elg.protect.iv, 8, 1); rc = protect_secret_key( skc, dek ); if( rc ) { log_error("protect_secret_key failed: %s\n", g10_errstr(rc) ); @@ -203,7 +206,7 @@ gen_elg(unsigned nbits, KBNODE pub_root, KBNODE sec_root, DEK *dek, #ifdef ENABLE_RSA_KEYGEN static int gen_rsa(unsigned nbits, KBNODE pub_root, KBNODE sec_root, DEK *dek, - PKT_secret_cert **ret_skc ) + byte *salt, PKT_secret_cert **ret_skc ) { int rc; PACKET *pkt; @@ -267,7 +270,7 @@ gen_rsa(unsigned nbits, KBNODE pub_root, KBNODE sec_root, DEK *dek, static int gen_dsa(unsigned nbits, KBNODE pub_root, KBNODE sec_root, DEK *dek, - PKT_secret_cert **ret_skc ) + byte *salt, PKT_secret_cert **ret_skc ) { return G10ERR_GENERAL; } @@ -289,6 +292,7 @@ generate_keypair() KBNODE sec_root = NULL; PKT_secret_cert *skc = NULL; DEK *dek = NULL; + byte *salt; int rc; int algo; const char *algo_name; @@ -499,9 +503,11 @@ generate_keypair() tty_printf(_("You need a Passphrase to protect your secret key.\n\n") ); dek = m_alloc_secure( sizeof *dek ); + salt = (byte*)dek + sizeof *dek; for(;;) { dek->algo = CIPHER_ALGO_BLOWFISH; - rc = make_dek_from_passphrase( dek , 2 ); + randomize_buffer(salt, 8, 1); + rc = make_dek_from_passphrase( dek , 2, salt ); if( rc == -1 ) { m_free(dek); dek = NULL; tty_printf(_( @@ -525,8 +531,8 @@ generate_keypair() /* now check wether we a are allowed to write to the keyrings */ - pub_fname = make_filename(opt.homedir, "pubring.g10", NULL ); - sec_fname = make_filename(opt.homedir, "secring.g10", NULL ); + pub_fname = make_filename(opt.homedir, "pubring.gpg", NULL ); + sec_fname = make_filename(opt.homedir, "secring.gpg", NULL ); if( opt.verbose ) { tty_printf(_("writing public certificate to '%s'\n"), pub_fname ); tty_printf(_("writing secret certificate to '%s'\n"), sec_fname ); @@ -547,21 +553,21 @@ generate_keypair() "number generator a better chance to gain enough entropy.\n") ); if( algo == PUBKEY_ALGO_ELGAMAL ) - rc = gen_elg(nbits, pub_root, sec_root, dek, &skc ); + rc = gen_elg(nbits, pub_root, sec_root, dek, salt, &skc ); #ifdef ENABLE_RSA_KEYGEN else if( algo == PUBKEY_ALGO_RSA ) - rc = gen_rsa(nbits, pub_root, sec_root, dek, &skc ); + rc = gen_rsa(nbits, pub_root, sec_root, dek, salt, &skc ); #endif else if( algo == PUBKEY_ALGO_DSA ) - rc = gen_dsa(nbits, pub_root, sec_root, dek, &skc ); + rc = gen_dsa(nbits, pub_root, sec_root, dek, salt, &skc ); else BUG(); if( !rc ) { add_kbnode( pub_root, - make_comment_node("#created by G10 v" VERSION " (" + make_comment_node("#created by GNUPG v" VERSION " (" PRINTABLE_OS_NAME ")")); add_kbnode( sec_root, - make_comment_node("#created by G10 v" VERSION " (" + make_comment_node("#created by GNUPG v" VERSION " (" PRINTABLE_OS_NAME ")")); } if( !rc ) diff --git a/g10/keyid.c b/g10/keyid.c index 6e7b120e6..8d3e58da2 100644 --- a/g10/keyid.c +++ b/g10/keyid.c @@ -1,14 +1,14 @@ /* keyid.c - jeyid and fingerprint handling - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/main.h b/g10/main.h index 2990ef872..4b57cfe6b 100644 --- a/g10/main.h +++ b/g10/main.h @@ -1,14 +1,14 @@ /* main.h - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/mainproc.c b/g10/mainproc.c index 2bbe7418c..e2c0b703d 100644 --- a/g10/mainproc.c +++ b/g10/mainproc.c @@ -1,14 +1,14 @@ /* mainproc.c - handle packets - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -189,7 +189,7 @@ proc_encrypted( CTX c, PACKET *pkt ) /* assume this is conventional encrypted data */ c->dek = m_alloc_secure( sizeof *c->dek ); c->dek->algo = opt.def_cipher_algo; - result = make_dek_from_passphrase( c->dek, 0 ); + result = make_dek_from_passphrase( c->dek, 0, NULL ); } else if( !c->dek ) result = G10ERR_NO_SECKEY; diff --git a/g10/mdfilter.c b/g10/mdfilter.c index 17cf259eb..2b3864455 100644 --- a/g10/mdfilter.c +++ b/g10/mdfilter.c @@ -1,14 +1,14 @@ /* mdfilter.c - filter data and calculate a message digest - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/openfile.c b/g10/openfile.c index 388c9bfa7..512633080 100644 --- a/g10/openfile.c +++ b/g10/openfile.c @@ -1,14 +1,14 @@ /* openfile.c - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -81,7 +81,7 @@ overwrite_filep( const char *fname ) /**************** * Make an output filename for the inputfile INAME. * Returns an IOBUF - * Mode 0 = use ".g10" + * Mode 0 = use ".gpg" * 1 = use ".asc" * 2 = use ".sig" */ @@ -106,7 +106,7 @@ open_outfile( const char *iname, int mode ) else { buf = m_alloc(strlen(iname)+4+1); strcpy(stpcpy(buf,iname), mode==1 ? ".asc" : - mode==2 ? ".sig" : ".g10"); + mode==2 ? ".sig" : ".gpg"); name = buf; } if( !(rc=overwrite_filep( name )) ) { diff --git a/g10/options.h b/g10/options.h index 48c6bee21..0ac04184b 100644 --- a/g10/options.h +++ b/g10/options.h @@ -1,14 +1,14 @@ /* options.h - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/packet.h b/g10/packet.h index c41f32006..201313668 100644 --- a/g10/packet.h +++ b/g10/packet.h @@ -1,14 +1,14 @@ /* packet.h - packet read/write stuff - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -127,15 +127,16 @@ typedef struct { MPI x; /* secret exponent */ u16 csum; /* checksum */ byte is_protected; /* The above infos are protected and must */ - /* be decrypteded before use */ - byte protect_algo; /* cipher used to protect the secret informations*/ - union { /* information for the protection */ - struct { - byte iv[8]; /* initialization vector for CFB mode */ - /* when protected, the MPIs above are pointers + /* be decrypteded before use. */ + struct { + byte algo; /* cipher used to protect the secret informations*/ + byte s2k; + byte hash; + byte salt[8]; + byte count; + byte iv[8]; /* initialization vector for CFB mode */ + } protect; /* when protected, the MPIs above are pointers * to plain storage */ - } blowfish; - } protect; } elg; struct { MPI rsa_n; /* public modulus */ diff --git a/g10/parse-packet.c b/g10/parse-packet.c index b50c584bd..498dd1985 100644 --- a/g10/parse-packet.c +++ b/g10/parse-packet.c @@ -1,14 +1,14 @@ /* parse-packet.c - read packets - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -591,6 +591,7 @@ parse_certificate( IOBUF inp, int pkttype, unsigned long pktlen, unsigned long timestamp; unsigned short valid_period; int is_v4=0; + int rc=0; if( pktlen < 12 ) { @@ -658,11 +659,79 @@ parse_certificate( IOBUF inp, int pkttype, unsigned long pktlen, pkt->pkt.secret_cert->d.elg.p = elg_p; pkt->pkt.secret_cert->d.elg.g = elg_g; pkt->pkt.secret_cert->d.elg.y = elg_y; - cert->d.elg.protect_algo = iobuf_get_noeof(inp); pktlen--; - if( list_mode ) - printf( "\tprotect algo: %d\n", cert->d.elg.protect_algo); - if( cert->d.elg.protect_algo ) { + cert->d.elg.protect.algo = iobuf_get_noeof(inp); pktlen--; + if( cert->d.elg.protect.algo ) { cert->d.elg.is_protected = 1; + cert->d.elg.protect.count = 0; + if( cert->d.elg.protect.algo == 255 ) { + if( pktlen < 3 ) { + rc = G10ERR_INVALID_PACKET; + goto leave; + } + cert->d.elg.protect.algo = iobuf_get_noeof(inp); pktlen--; + cert->d.elg.protect.s2k = iobuf_get_noeof(inp); pktlen--; + cert->d.elg.protect.hash = iobuf_get_noeof(inp); pktlen--; + switch( cert->d.elg.protect.s2k ) { + case 1: + case 3: + for(i=0; i < 8 && pktlen; i++, pktlen-- ) + temp[i] = iobuf_get_noeof(inp); + memcpy(cert->d.elg.protect.salt, temp, 8 ); + break; + } + switch( cert->d.elg.protect.s2k ) { + case 0: if( list_mode ) printf( "\tsimple S2K" ); + break; + case 1: if( list_mode ) printf( "\tsalted S2K" ); + break; + case 3: if( list_mode ) printf( "\titer+salt S2K" ); + break; + default: + if( list_mode ) + printf( "\tunknown S2K %d\n", + cert->d.elg.protect.s2k ); + rc = G10ERR_INVALID_PACKET; + goto leave; + } + + if( list_mode ) { + printf(", algo: %d, hash: %d", + cert->d.elg.protect.algo, + cert->d.elg.protect.hash ); + if( cert->d.elg.protect.s2k == 1 + || cert->d.elg.protect.s2k == 3 ) { + printf(", salt: "); + for(i=0; i < 8; i++ ) + printf("%02x", cert->d.elg.protect.salt[i]); + } + putchar('\n'); + } + + if( cert->d.elg.protect.s2k == 3 ) { + if( !pktlen ) { + rc = G10ERR_INVALID_PACKET; + goto leave; + } + cert->d.elg.protect.count = iobuf_get_noeof(inp); + pktlen--; + } + + } + else { + if( list_mode ) + printf( "\tprotect algo: %d\n", + cert->d.elg.protect.algo); + /* old version, we don't have a S2K, so we fake one */ + cert->d.elg.protect.s2k = 0; + /* We need this kludge to cope with old GNUPG versions */ + cert->d.elg.protect.hash = + cert->d.elg.protect.algo == CIPHER_ALGO_BLOWFISH? + DIGEST_ALGO_RMD160 : DIGEST_ALGO_MD5; + } + if( pktlen < 8 ) { + rc = G10ERR_INVALID_PACKET; + goto leave; + } for(i=0; i < 8 && pktlen; i++, pktlen-- ) temp[i] = iobuf_get_noeof(inp); if( list_mode ) { @@ -671,8 +740,7 @@ parse_certificate( IOBUF inp, int pkttype, unsigned long pktlen, printf(" %02x", temp[i] ); putchar('\n'); } - if( cert->d.elg.protect_algo == CIPHER_ALGO_BLOWFISH ) - memcpy(cert->d.elg.protect.blowfish.iv, temp, 8 ); + memcpy(cert->d.elg.protect.iv, temp, 8 ); } else cert->d.elg.is_protected = 0; @@ -758,7 +826,7 @@ parse_certificate( IOBUF inp, int pkttype, unsigned long pktlen, leave: skip_rest(inp, pktlen); - return 0; + return rc; } diff --git a/g10/passphrase.c b/g10/passphrase.c index d1b91465e..ee5d4105b 100644 --- a/g10/passphrase.c +++ b/g10/passphrase.c @@ -1,14 +1,14 @@ /* passphrase.c - Get a passphrase - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -33,7 +33,7 @@ static int pwfd = -1; -static int hash_passphrase( DEK *dek, char *pw ); +static int hash_passphrase( DEK *dek, char *pw, byte *salt ); void set_passphrase_fd( int fd ) @@ -54,7 +54,7 @@ get_passphrase_fd() * Returns: m_alloced md5 passphrase hash; caller must free */ DEK * -get_passphrase_hash( u32 *keyid, char *text ) +get_passphrase_hash( u32 *keyid, char *text, byte *salt ) { char *pw; DEK *dek; @@ -97,8 +97,8 @@ get_passphrase_hash( u32 *keyid, char *text ) tty_kill_prompt(); } dek = m_alloc_secure( sizeof *dek ); - dek->algo = CIPHER_ALGO_BLOWFISH; - if( hash_passphrase( dek, pw ) ) + dek->algo = CIPHER_ALGO_BLOWFISH; /* fixme: allow others ciphers */ + if( hash_passphrase( dek, pw, salt ) ) log_bug("get_passphrase_hash\n"); m_free(pw); /* is allocated in secure memory, so it will be burned */ return dek; @@ -107,11 +107,12 @@ get_passphrase_hash( u32 *keyid, char *text ) /**************** * This function is used to construct a DEK from a user input. - * It uses the default CIPHER + * It uses the default CIPHER. If salt is != NULL, include these + * 8 bytes in the hash. * Returns: 0 = okay, -1 No passphrase entered, > 0 error */ int -make_dek_from_passphrase( DEK *dek, int mode ) +make_dek_from_passphrase( DEK *dek, int mode, byte *salt ) { char *pw, *pw2; int rc=0; @@ -131,14 +132,14 @@ make_dek_from_passphrase( DEK *dek, int mode ) if( !*pw ) rc = -1; else - rc = hash_passphrase( dek, pw ); + rc = hash_passphrase( dek, pw, salt ); m_free(pw); return rc; } static int -hash_passphrase( DEK *dek, char *pw ) +hash_passphrase( DEK *dek, char *pw, byte *salt ) { int rc = 0; @@ -147,6 +148,8 @@ hash_passphrase( DEK *dek, char *pw ) MD_HANDLE md; md = md_open(DIGEST_ALGO_RMD160, 1); + if( salt ) + md_write( md, salt, 8 ); md_write( md, pw, strlen(pw) ); md_final( md ); dek->keylen = 20; diff --git a/g10/pkclist.c b/g10/pkclist.c index cd453323f..5312c565a 100644 --- a/g10/pkclist.c +++ b/g10/pkclist.c @@ -1,14 +1,14 @@ /* pkclist.c - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/plaintext.c b/g10/plaintext.c index 11953b8d4..05685afb6 100644 --- a/g10/plaintext.c +++ b/g10/plaintext.c @@ -1,14 +1,14 @@ /* plaintext.c - process an plaintext packet - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/pubkey-enc.c b/g10/pubkey-enc.c index 0fcd9c21c..8ffa6483c 100644 --- a/g10/pubkey-enc.c +++ b/g10/pubkey-enc.c @@ -1,14 +1,14 @@ /* pubkey-enc.c - public key encoded packet handling - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/revoke.c b/g10/revoke.c index 59d866b92..86d465cc0 100644 --- a/g10/revoke.c +++ b/g10/revoke.c @@ -1,14 +1,14 @@ /* revoke.c - * Copyright (c) 1998 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/ringedit.c b/g10/ringedit.c index 95f0ef65a..b5d6ec8b1 100644 --- a/g10/ringedit.c +++ b/g10/ringedit.c @@ -1,14 +1,14 @@ /* ringedit.c - Function for key ring editing - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -888,12 +888,18 @@ keyring_copy( KBPOS *kbpos, int mode, KBNODE root ) } } /* rename and make backup file */ + #if __MINGW32__ + remove( bakfname ); + #endif if( rename( rentry->fname, bakfname ) ) { log_error("%s: rename to %s failed: %s\n", rentry->fname, bakfname, strerror(errno) ); rc = G10ERR_RENAME_FILE; goto leave; } + #if __MINGW32__ + remove( rentry->fname ); + #endif if( rename( tmpfname, rentry->fname ) ) { log_error("%s: rename to %s failed: %s\n", tmpfname, rentry->fname,strerror(errno) ); diff --git a/g10/rsa.c b/g10/rsa.c index f1e8f7b61..23df05575 100644 --- a/g10/rsa.c +++ b/g10/rsa.c @@ -1,14 +1,14 @@ /* rsa.c - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/seckey-cert.c b/g10/seckey-cert.c index 855e3d1b9..f963fd63f 100644 --- a/g10/seckey-cert.c +++ b/g10/seckey-cert.c @@ -1,14 +1,14 @@ /* seckey-cert.c - secret key certifucate packet handling - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -72,21 +72,27 @@ check_elg( PKT_secret_cert *cert ) MPI test_x; BLOWFISH_context *blowfish_ctx=NULL; - switch( cert->d.elg.protect_algo ) { + switch( cert->d.elg.protect.algo ) { case CIPHER_ALGO_NONE: BUG(); break; case CIPHER_ALGO_BLOWFISH: keyid_from_skc( cert, keyid ); - dek = get_passphrase_hash( keyid, NULL ); + if( cert->d.elg.protect.s2k == 1 + || cert->d.elg.protect.s2k == 3 ) + dek = get_passphrase_hash( keyid, NULL, + cert->d.elg.protect.salt ); + else + dek = get_passphrase_hash( keyid, NULL, NULL ); + blowfish_ctx = m_alloc_secure( sizeof *blowfish_ctx ); blowfish_setkey( blowfish_ctx, dek->key, dek->keylen ); m_free(dek); /* pw is in secure memory, so m_free() burns it */ blowfish_setiv( blowfish_ctx, NULL ); - memcpy(save_iv, cert->d.elg.protect.blowfish.iv, 8 ); + memcpy(save_iv, cert->d.elg.protect.iv, 8 ); blowfish_decode_cfb( blowfish_ctx, - cert->d.elg.protect.blowfish.iv, - cert->d.elg.protect.blowfish.iv, 8 ); + cert->d.elg.protect.iv, + cert->d.elg.protect.iv, 8 ); mpi_set_secure(cert->d.elg.x ); - /*fixme: maybe it is better to set the buger secure with a + /*fixme: maybe it is better to set the buffer secure with a * new get_buffer_secure() function */ buffer = mpi_get_buffer( cert->d.elg.x, &nbytes, NULL ); csum = checksum_u16( nbytes*8 ); @@ -99,7 +105,7 @@ check_elg( PKT_secret_cert *cert ) /* now let's see wether we have used the right passphrase */ if( csum != cert->d.elg.csum ) { mpi_free(test_x); - memcpy( cert->d.elg.protect.blowfish.iv, save_iv, 8 ); + memcpy( cert->d.elg.protect.iv, save_iv, 8 ); return G10ERR_BAD_PASS; } @@ -111,7 +117,7 @@ check_elg( PKT_secret_cert *cert ) memset( &skey, 0, sizeof skey ); if( !res ) { mpi_free(test_x); - memcpy( cert->d.elg.protect.blowfish.iv, save_iv, 8 ); + memcpy( cert->d.elg.protect.iv, save_iv, 8 ); return G10ERR_BAD_PASS; } mpi_set(cert->d.elg.x, test_x); @@ -144,15 +150,15 @@ protect_elg( PKT_secret_cert *cert, DEK *dek ) if( !cert->d.elg.is_protected ) { /* add the protection */ BLOWFISH_context *blowfish_ctx=NULL; - switch( cert->d.elg.protect_algo ) { + switch( cert->d.elg.protect.algo ) { case CIPHER_ALGO_NONE: BUG(); break; case CIPHER_ALGO_BLOWFISH: blowfish_ctx = m_alloc_secure( sizeof *blowfish_ctx ); blowfish_setkey( blowfish_ctx, dek->key, dek->keylen ); blowfish_setiv( blowfish_ctx, NULL ); blowfish_encode_cfb( blowfish_ctx, - cert->d.elg.protect.blowfish.iv, - cert->d.elg.protect.blowfish.iv, 8 ); + cert->d.elg.protect.iv, + cert->d.elg.protect.iv, 8 ); buffer = mpi_get_buffer( cert->d.elg.x, &nbytes, NULL ); blowfish_encode_cfb( blowfish_ctx, buffer, buffer, nbytes ); mpi_set_buffer( cert->d.elg.x, buffer, nbytes, 0 ); @@ -296,7 +302,7 @@ int is_secret_key_protected( PKT_secret_cert *cert ) { if( cert->pubkey_algo == PUBKEY_ALGO_ELGAMAL ) - return cert->d.elg.is_protected? cert->d.elg.protect_algo : 0; + return cert->d.elg.is_protected? cert->d.elg.protect.algo : 0; #ifdef HAVE_RSA_CIPHER else if( cert->pubkey_algo == PUBKEY_ALGO_RSA ) return cert->d.rsa.is_protected? cert->d.rsa.protect_algo : 0; @@ -317,10 +323,6 @@ protect_secret_key( PKT_secret_cert *cert, DEK *dek ) if( cert->pubkey_algo == PUBKEY_ALGO_ELGAMAL ) return protect_elg( cert, dek ); - #if 0 /* noy yet implemented */ - else if( cert->pubkey_algo == PUBKEY_ALGO_RSA ) - return protect_rsa( cert, dek ); - #endif else return G10ERR_PUBKEY_ALGO; } diff --git a/g10/seskey.c b/g10/seskey.c index f157032d5..314347a8b 100644 --- a/g10/seskey.c +++ b/g10/seskey.c @@ -1,14 +1,14 @@ /* seskey.c - make sesssion keys etc. - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/sig-check.c b/g10/sig-check.c index 360a184c8..299fedc83 100644 --- a/g10/sig-check.c +++ b/g10/sig-check.c @@ -1,14 +1,14 @@ /* sig-check.c - Check a signature - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/sign.c b/g10/sign.c index 0cbcbd3a2..a3ad4ba80 100644 --- a/g10/sign.c +++ b/g10/sign.c @@ -1,14 +1,14 @@ /* sign.c - sign data - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -152,7 +152,7 @@ sign_file( STRLIST filenames, int detached, STRLIST locusr, if( opt.armor && !outfile ) iobuf_push_filter( out, armor_filter, &afx ); - write_comment( out, "#created by G10 v" VERSION " (" + write_comment( out, "#created by GNUPG v" VERSION " (" PRINTABLE_OS_NAME ")"); if( opt.compress && !outfile ) iobuf_push_filter( out, compress_filter, &zfx ); @@ -916,13 +916,15 @@ change_passphrase( const char *username ) if( rc ) tty_printf("Can't edit this key: %s\n", g10_errstr(rc)); else { - DEK *dek = m_alloc_secure( sizeof *dek ); + DEK *dek = m_alloc_secure( sizeof *dek + 8 ); + byte *salt = (byte*)dek + sizeof( *dek ); tty_printf( "Enter the new passphrase for this secret key.\n\n" ); for(;;) { dek->algo = CIPHER_ALGO_BLOWFISH; - rc = make_dek_from_passphrase( dek , 2 ); + randomize_buffer(salt, 8, 1); + rc = make_dek_from_passphrase( dek , 2, salt ); if( rc == -1 ) { rc = 0; tty_printf( "You don't want a passphrase -" @@ -943,8 +945,11 @@ change_passphrase( const char *username ) break; } else { /* okay */ - skc->d.elg.protect_algo = CIPHER_ALGO_BLOWFISH; - randomize_buffer(skc->d.elg.protect.blowfish.iv, 8, 1); + skc->d.elg.protect.algo = CIPHER_ALGO_BLOWFISH; + skc->d.elg.protect.s2k = 1; + skc->d.elg.protect.hash = DIGEST_ALGO_RMD160; + memcpy(skc->d.elg.protect.salt, salt, 8); + randomize_buffer(skc->d.elg.protect.iv, 8, 1); rc = protect_secret_key( skc, dek ); if( rc ) log_error("protect_secret_key failed: %s\n", g10_errstr(rc) ); diff --git a/g10/skclist.c b/g10/skclist.c index f906fc6af..53941cbfe 100644 --- a/g10/skclist.c +++ b/g10/skclist.c @@ -1,14 +1,14 @@ /* skclist.c - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/status.c b/g10/status.c index 47cc7bd53..05f902a5f 100644 --- a/g10/status.c +++ b/g10/status.c @@ -1,14 +1,14 @@ /* status.c - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/status.h b/g10/status.h index f8e3f60f1..a3d493b89 100644 --- a/g10/status.h +++ b/g10/status.h @@ -1,14 +1,14 @@ /* status.h - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/textfilter.c b/g10/textfilter.c index 4734fe4ca..c42624eff 100644 --- a/g10/textfilter.c +++ b/g10/textfilter.c @@ -1,14 +1,14 @@ /* textfilter.c - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/g10/trustdb.c b/g10/trustdb.c index 836f9806d..3554c6e5a 100644 --- a/g10/trustdb.c +++ b/g10/trustdb.c @@ -1,14 +1,14 @@ /* trustdb.c - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -329,8 +329,8 @@ create_db( const char *fname ) log_fatal("can't create %s: %s\n", fname, strerror(errno) ); fwrite_8( fp, 1 ); fwrite_8( fp, 'g' ); - fwrite_8( fp, '1' ); - fwrite_8( fp, '0' ); + fwrite_8( fp, 'p' ); + fwrite_8( fp, 'g' ); fwrite_8( fp, 1 ); /* version */ fwrite_zeros( fp, 3 ); /* reserved */ fwrite_32( fp, 0 ); /* not locked */ @@ -451,7 +451,8 @@ read_record( ulong recnum, TRUSTREC *rec, int expected ) case 0: /* unused record */ break; case RECTYPE_VER: /* version record */ - if( memcmp(buf+1, "g10", 3 ) ) { + /* g10 was the original name */ + if( memcmp(buf+1, "gpg", 3 ) && memcmp(buf+1, "g10", 3 ) ) { log_error("%s: not a trustdb file\n", db_name ); rc = G10ERR_TRUSTDB; } @@ -1510,7 +1511,7 @@ init_trustdb( int level, const char *dbname ) if( !level || level==1 ) { char *fname = dbname? m_strdup( dbname ) - : make_filename(opt.homedir, "trustdb.g10", NULL ); + : make_filename(opt.homedir, "trustdb.gpg", NULL ); if( access( fname, R_OK ) ) { if( errno != ENOENT ) { log_error("can't access %s: %s\n", fname, strerror(errno) ); @@ -1522,7 +1523,11 @@ init_trustdb( int level, const char *dbname ) assert(p); *p = 0; if( access( fname, F_OK ) ) { + #if __MINGW32__ + if( mkdir( fname ) ) + #else if( mkdir( fname, S_IRUSR|S_IWUSR|S_IXUSR ) ) + #endif log_fatal("can't create directory '%s': %s\n", fname, strerror(errno) ); } @@ -1974,7 +1979,7 @@ int verify_private_data() { int rc = 0; - char *sigfile = make_filename(opt.homedir, "g10.sig", NULL ); + char *sigfile = make_filename(opt.homedir, "gnupg.sig", NULL ); if( access( sigfile, R_OK ) ) { if( errno != ENOENT ) { @@ -2002,8 +2007,8 @@ int sign_private_data() { int rc; - char *sigfile = make_filename(opt.homedir, "g10.sig", NULL ); - char *secring = make_filename(opt.homedir, "secring.g10", NULL ); + char *sigfile = make_filename(opt.homedir, "gnupg.sig", NULL ); + char *secring = make_filename(opt.homedir, "secring.gpg", NULL ); STRLIST list = NULL; add_to_strlist( &list, db_name ); diff --git a/g10/trustdb.h b/g10/trustdb.h index 48f006e76..3c81b2b2b 100644 --- a/g10/trustdb.h +++ b/g10/trustdb.h @@ -1,14 +1,14 @@ /* trustdb.h - Trust database - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/ChangeLog b/mpi/ChangeLog index f05c13e17..115da6f61 100644 --- a/mpi/ChangeLog +++ b/mpi/ChangeLog @@ -1,3 +1,7 @@ +Mon Feb 23 12:21:40 1998 Werner Koch (wk@isil.d.shuttle.de) + + * mpi/m68k/mpih-shift.S (Lspecial): Changed duplicate symbol. + Mon Feb 16 13:00:27 1998 Werner Koch (wk@isil.d.shuttle.de) * config.links : Add detection of m68k cpus diff --git a/mpi/alpha/mpih-add1.S b/mpi/alpha/mpih-add1.S index 6f88499c9..54cec43fa 100644 --- a/mpi/alpha/mpih-add1.S +++ b/mpi/alpha/mpih-add1.S @@ -2,16 +2,16 @@ * sum in a third limb vector. * * Copyright (C) 1995 Free Software Foundation, Inc. - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/alpha/mpih-shift.S b/mpi/alpha/mpih-shift.S index dcf0a1f46..8bbd10cd3 100644 --- a/mpi/alpha/mpih-shift.S +++ b/mpi/alpha/mpih-shift.S @@ -1,15 +1,15 @@ /* alpha rshift, lshift * Copyright (C) 1994, 1995 Free Software Foundation, Inc. - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/hppa/mpih-add1.S b/mpi/hppa/mpih-add1.S index 21cad314e..e01c2eed0 100644 --- a/mpi/hppa/mpih-add1.S +++ b/mpi/hppa/mpih-add1.S @@ -2,16 +2,16 @@ * sum in a third limb vector. * * Copyright (C) 1992, 1994 Free Software Foundation, Inc. - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/hppa/mpih-shift.S b/mpi/hppa/mpih-shift.S index 5039c7381..153fbd7f0 100644 --- a/mpi/hppa/mpih-shift.S +++ b/mpi/hppa/mpih-shift.S @@ -1,15 +1,15 @@ /* hppa rshift, lshift * Copyright (C) 1992, 1994 Free Software Foundation, Inc. - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/hppa/mpih-sub1.S b/mpi/hppa/mpih-sub1.S index 361cc6832..8672e3145 100644 --- a/mpi/hppa/mpih-sub1.S +++ b/mpi/hppa/mpih-sub1.S @@ -1,16 +1,16 @@ /* hppa sub_n -- Sub two limb vectors of the same length > 0 and store * sum in a third limb vector. * Copyright (C) 1992, 1994 Free Software Foundation, Inc. - * Copyright (c) 1998 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/hppa1.1/mpih-mul1.S b/mpi/hppa1.1/mpih-mul1.S index d68b4eb6f..1f7377473 100644 --- a/mpi/hppa1.1/mpih-mul1.S +++ b/mpi/hppa1.1/mpih-mul1.S @@ -1,16 +1,16 @@ /* hppa1.1 mul_1 -- Multiply a limb vector with a limb and store * the result in a second limb vector. * Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. - * Copyright (c) 1998 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/hppa1.1/mpih-mul2.S b/mpi/hppa1.1/mpih-mul2.S index 654eb074f..89c025952 100644 --- a/mpi/hppa1.1/mpih-mul2.S +++ b/mpi/hppa1.1/mpih-mul2.S @@ -1,16 +1,16 @@ /* hppa1.1 addmul_1 -- Multiply a limb vector with a limb and add * the result to a second limb vector. * Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/hppa1.1/mpih-mul3.S b/mpi/hppa1.1/mpih-mul3.S index 87f9e6a6b..80868a3ef 100644 --- a/mpi/hppa1.1/mpih-mul3.S +++ b/mpi/hppa1.1/mpih-mul3.S @@ -1,16 +1,16 @@ /* hppa1.1 submul_1 -- Multiply a limb vector with a limb and add * the result to a second limb vector. * Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/hppa1.1/udiv-qrnnd.S b/mpi/hppa1.1/udiv-qrnnd.S index 5e88f5c26..2b0e8cf76 100644 --- a/mpi/hppa1.1/udiv-qrnnd.S +++ b/mpi/hppa1.1/udiv-qrnnd.S @@ -2,16 +2,16 @@ * This version runs fast on PA 7000 and later. * * Copyright (C) 1993, 1994 Free Software Foundation, Inc. - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/i386/mpih-add1.S b/mpi/i386/mpih-add1.S index a9648302d..b7517cf01 100644 --- a/mpi/i386/mpih-add1.S +++ b/mpi/i386/mpih-add1.S @@ -2,16 +2,16 @@ * sum in a third limb vector. * * Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc. - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/i386/mpih-mul1.S b/mpi/i386/mpih-mul1.S index a8869e6c8..106796431 100644 --- a/mpi/i386/mpih-mul1.S +++ b/mpi/i386/mpih-mul1.S @@ -1,16 +1,16 @@ /* i80386 mul_1 -- Multiply a limb vector with a limb and store * the result in a second limb vector. - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * Copyright (C) 1992, 1994 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/i386/mpih-mul2.S b/mpi/i386/mpih-mul2.S index 391504b79..8b124bda7 100644 --- a/mpi/i386/mpih-mul2.S +++ b/mpi/i386/mpih-mul2.S @@ -1,16 +1,16 @@ /* i80386 addmul_1 -- Multiply a limb vector with a limb and add * the result to a second limb vector. - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * Copyright (C) 1992, 1994 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/i386/mpih-mul3.S b/mpi/i386/mpih-mul3.S index 2654b5604..5f3655611 100644 --- a/mpi/i386/mpih-mul3.S +++ b/mpi/i386/mpih-mul3.S @@ -1,16 +1,16 @@ /* i80386 submul_1 -- Multiply a limb vector with a limb and add * the result to a second limb vector. - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * Copyright (C) 1992, 1994 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/i386/mpih-shift.S b/mpi/i386/mpih-shift.S index 09ce31a53..f10f268e5 100644 --- a/mpi/i386/mpih-shift.S +++ b/mpi/i386/mpih-shift.S @@ -1,15 +1,15 @@ /* i80386 rshift, lshift - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * Copyright (C) 1992, 1994 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/i386/mpih-sub1.S b/mpi/i386/mpih-sub1.S index c03450830..fe1cdeeeb 100644 --- a/mpi/i386/mpih-sub1.S +++ b/mpi/i386/mpih-sub1.S @@ -1,16 +1,16 @@ /* i80386 sub_n -- Sub two limb vectors of the same length > 0 and store * sum in a third limb vector. * Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc. - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/i586/mpih-add1.S b/mpi/i586/mpih-add1.S index e9883285d..a52c16464 100644 --- a/mpi/i586/mpih-add1.S +++ b/mpi/i586/mpih-add1.S @@ -3,14 +3,14 @@ * * Copyright (C) 1992, 1994, 1995, 1996 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/i586/mpih-mul1.S b/mpi/i586/mpih-mul1.S index c0bedec0a..b338b1a8b 100644 --- a/mpi/i586/mpih-mul1.S +++ b/mpi/i586/mpih-mul1.S @@ -2,14 +2,14 @@ * the result in a second limb vector. * Copyright (C) 1992, 1994, 1996 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/i586/mpih-mul2.S b/mpi/i586/mpih-mul2.S index 6b5646239..df22a4282 100644 --- a/mpi/i586/mpih-mul2.S +++ b/mpi/i586/mpih-mul2.S @@ -1,16 +1,16 @@ /* i80586 addmul_1 -- Multiply a limb vector with a limb and add * the result to a second limb vector. - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * Copyright (C) 1992, 1994 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/i586/mpih-mul3.S b/mpi/i586/mpih-mul3.S index 69b7f4672..014e33cb1 100644 --- a/mpi/i586/mpih-mul3.S +++ b/mpi/i586/mpih-mul3.S @@ -1,16 +1,16 @@ /* i80586 submul_1 -- Multiply a limb vector with a limb and add * the result to a second limb vector. - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * Copyright (C) 1992, 1994 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/i586/mpih-shift.S b/mpi/i586/mpih-shift.S index 9f1563810..07d5fbc84 100644 --- a/mpi/i586/mpih-shift.S +++ b/mpi/i586/mpih-shift.S @@ -1,15 +1,15 @@ /* i80586 rshift, lshift - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * Copyright (C) 1992, 1994 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/i586/mpih-sub1.S b/mpi/i586/mpih-sub1.S index 1f5c0bfdd..2ed704e89 100644 --- a/mpi/i586/mpih-sub1.S +++ b/mpi/i586/mpih-sub1.S @@ -1,16 +1,16 @@ /* i80586 sub_n -- Sub two limb vectors of the same length > 0 and store * sum in a third limb vector. * Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc. - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/m68k/mpih-shift.S b/mpi/m68k/mpih-shift.S index a9208745e..09b1bcd57 100644 --- a/mpi/m68k/mpih-shift.S +++ b/mpi/m68k/mpih-shift.S @@ -186,7 +186,7 @@ PROLOG(mpihelp_rshift) cmpl R(d5),R(cnt) bne L(Rnormal) cmpl R(res_ptr),R(s_ptr) - bls L(Lspecial) /* jump if res_ptr >= s_ptr */ + bls L(Rspecial) /* jump if res_ptr >= s_ptr */ #if (defined (__mc68020__) || defined (__NeXT__) || defined(mc68020)) lea MEM_INDX1(res_ptr,s_size,l,4),R(a2) #else /* not mc68020 */ @@ -195,7 +195,7 @@ PROLOG(mpihelp_rshift) lea MEM_INDX(res_ptr,d0,l),R(a2) #endif cmpl R(s_ptr),R(a2) - bls L(Lspecial) /* jump if s_ptr >= res_ptr + s_size */ + bls L(Rspecial) /* jump if s_ptr >= res_ptr + s_size */ L(Rnormal:) moveql #32,R(d5) @@ -242,7 +242,7 @@ L(Rend:) permissable if the source and destination don't overlap, since the function is documented to work for overlapping source and destination. */ -L(Lspecial:) +L(Rspecial:) #if (defined (__mc68020__) || defined (__NeXT__) || defined(mc68020)) lea MEM_INDX1(s_ptr,s_size,l,4),R(s_ptr) lea MEM_INDX1(res_ptr,s_size,l,4),R(res_ptr) diff --git a/mpi/mpi-add.c b/mpi/mpi-add.c index dbea7ac38..9e70316e0 100644 --- a/mpi/mpi-add.c +++ b/mpi/mpi-add.c @@ -1,15 +1,15 @@ /* mpi-add.c - MPI functions - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * Copyright (C) 1994, 1996 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/mpi-bit.c b/mpi/mpi-bit.c index 0d8cab706..eff7be259 100644 --- a/mpi/mpi-bit.c +++ b/mpi/mpi-bit.c @@ -1,14 +1,14 @@ /* mpi-bit.c - MPI bit level fucntions - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/mpi-cmp.c b/mpi/mpi-cmp.c index 83e85ceb0..7d4c8330a 100644 --- a/mpi/mpi-cmp.c +++ b/mpi/mpi-cmp.c @@ -1,14 +1,14 @@ /* mpi-cmp.c - MPI functions - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/mpi-div.c b/mpi/mpi-div.c index 527375748..b00b45425 100644 --- a/mpi/mpi-div.c +++ b/mpi/mpi-div.c @@ -1,15 +1,15 @@ /* mpi-div.c - MPI functions - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * Copyright (C) 1994, 1996 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/mpi-gcd.c b/mpi/mpi-gcd.c index f31e917f6..eabee63d4 100644 --- a/mpi/mpi-gcd.c +++ b/mpi/mpi-gcd.c @@ -1,14 +1,14 @@ /* mpi-gcd.c - MPI functions - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/mpi-inline.h b/mpi/mpi-inline.h index 03b5fbc86..fab790551 100644 --- a/mpi/mpi-inline.h +++ b/mpi/mpi-inline.h @@ -1,15 +1,15 @@ /* mpi-inline.h - Internal to the Multi Precision Integers - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * Copyright (C) 1994, 1996 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/mpi-internal.h b/mpi/mpi-internal.h index 638d980b3..f0b414d2a 100644 --- a/mpi/mpi-internal.h +++ b/mpi/mpi-internal.h @@ -1,15 +1,15 @@ /* mpi-internal.h - Internal to the Multi Precision Integers - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * Copyright (C) 1994, 1996 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/mpi-inv.c b/mpi/mpi-inv.c index dcded3e58..2cea72811 100644 --- a/mpi/mpi-inv.c +++ b/mpi/mpi-inv.c @@ -1,14 +1,14 @@ /* mpi-inv.c - MPI functions - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/mpi-mpow.c b/mpi/mpi-mpow.c index 5ac3c6399..e0ed53109 100644 --- a/mpi/mpi-mpow.c +++ b/mpi/mpi-mpow.c @@ -1,14 +1,14 @@ /* mpi-mpow.c - MPI functions - * Copyright (c) 1998 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/mpi-mul.c b/mpi/mpi-mul.c index 85ee1d8c5..bfca5d0d5 100644 --- a/mpi/mpi-mul.c +++ b/mpi/mpi-mul.c @@ -1,15 +1,15 @@ /* mpi-mul.c - MPI functions - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * Copyright (C) 1994, 1996 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/mpi-pow.c b/mpi/mpi-pow.c index 2df34b778..2a0a4ef3b 100644 --- a/mpi/mpi-pow.c +++ b/mpi/mpi-pow.c @@ -1,15 +1,15 @@ /* mpi-pow.c - MPI functions - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * Copyright (C) 1994, 1996 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/mpi-scan.c b/mpi/mpi-scan.c index 329b868ca..d0a3ef51e 100644 --- a/mpi/mpi-scan.c +++ b/mpi/mpi-scan.c @@ -1,14 +1,14 @@ /* mpi-scan.c - MPI functions - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/mpicoder.c b/mpi/mpicoder.c index 3daea767f..4d3f454ac 100644 --- a/mpi/mpicoder.c +++ b/mpi/mpicoder.c @@ -1,14 +1,14 @@ /* mpicoder.c - Coder for the external representation of MPIs - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/mpih-add.c b/mpi/mpih-add.c index c01928d14..566469c3e 100644 --- a/mpi/mpih-add.c +++ b/mpi/mpih-add.c @@ -1,15 +1,15 @@ /* mpihelp-add.c - MPI helper functions - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * Copyright (C) 1994, 1996 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/mpih-cmp.c b/mpi/mpih-cmp.c index 235a1cdd9..dad993c2e 100644 --- a/mpi/mpih-cmp.c +++ b/mpi/mpih-cmp.c @@ -1,15 +1,15 @@ /* mpihelp-sub.c - MPI helper functions - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * Copyright (C) 1994, 1996 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/mpih-div.c b/mpi/mpih-div.c index 9729304ea..cda6150f1 100644 --- a/mpi/mpih-div.c +++ b/mpi/mpih-div.c @@ -1,15 +1,15 @@ /* mpihelp-div.c - MPI helper functions - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * Copyright (C) 1994, 1996 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/mpih-mul.c b/mpi/mpih-mul.c index 3b6b732b6..b02664695 100644 --- a/mpi/mpih-mul.c +++ b/mpi/mpih-mul.c @@ -1,15 +1,15 @@ /* mpihelp-mul.c - MPI helper functions - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * Copyright (C) 1994, 1996 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/mpih-sub.c b/mpi/mpih-sub.c index 0864ef8f0..52d25b329 100644 --- a/mpi/mpih-sub.c +++ b/mpi/mpih-sub.c @@ -1,15 +1,15 @@ /* mpihelp-sub.c - MPI helper functions - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * Copyright (C) 1994, 1996 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/mpiutil.c b/mpi/mpiutil.c index 3eb09f0cd..2227cfc19 100644 --- a/mpi/mpiutil.c +++ b/mpi/mpiutil.c @@ -1,14 +1,14 @@ /* mpiutilac - Utility functions for MPI - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/mpi/pa7100/mpih-shift.S b/mpi/pa7100/mpih-shift.S index daff03f3f..1287f30f1 100644 --- a/mpi/pa7100/mpih-shift.S +++ b/mpi/pa7100/mpih-shift.S @@ -1,16 +1,16 @@ /* hppa rshift, lshift * optimized for the PA7100, where is runs at 3.25 cycles/limb * Copyright (C) 1992, 1994 Free Software Foundation, Inc. - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/po/de.po b/po/de.po index 512e34eeb..83c606206 100644 --- a/po/de.po +++ b/po/de.po @@ -47,11 +47,11 @@ msgstr "" #: g10/g10.c:72 msgid "" -"Syntax: g10 [options] [files]\n" +"Syntax: gpg [options] [files]\n" "sign, check, encrypt or decrypt\n" "default operation depends on the input data\n" msgstr "" -"Aufruf: g10 [Optionen] [Dateien]\n" +"Aufruf: gpg [Optionen] [Dateien]\n" "Signieren, prüfen, verschlüsseln, entschlüsseln\n" "Die voreingestellte Operation ist abhängig von den Eingabedaten\n" diff --git a/scripts/mkdiff b/scripts/mkdiff index 86eea361a..659768374 100755 --- a/scripts/mkdiff +++ b/scripts/mkdiff @@ -2,28 +2,28 @@ set -e -curr_ver=$(ls g10-*.tar.gz | sort -r -t '.' -n +0.4 -1 +1 -2 +2 \ - | head -1 | sed -e 's/g10-\(.*\).tar.gz/\1/' ) -prev_ver=$(ls g10-*.tar.gz | sort -r -t '.' -n +0.4 -1 +1 -2 +2 \ - | head -2 | tail -1 | sed -e 's/g10-\(.*\).tar.gz/\1/' ) +curr_ver=$(ls gnupg-*.tar.gz | sort -r -t '.' -n +0.4 -1 +1 -2 +2 \ + | head -1 | sed -e 's/gnupg-\(.*\).tar.gz/\1/' ) +prev_ver=$(ls gnupg-*.tar.gz | sort -r -t '.' -n +0.4 -1 +1 -2 +2 \ + | head -2 | tail -1 | sed -e 's/gnupg-\(.*\).tar.gz/\1/' ) echo "Current is: $curr_ver" echo "Previous is: $prev_ver" echo "Removing old directories" -[ -d "g10-$curr_ver" ] && rm -rf "g10-$curr_ver" -[ -d "g10-$prev_ver" ] && rm -rf "g10-$prev_ver" +[ -d "gnupg-$curr_ver" ] && rm -rf "gnupg-$curr_ver" +[ -d "gnupg-$prev_ver" ] && rm -rf "gnupg-$prev_ver" echo "Unpacking previous and current tar" -tar xzf "g10-$curr_ver.tar.gz" -tar xzf "g10-$prev_ver.tar.gz" +tar xzf "gnupg-$curr_ver.tar.gz" +tar xzf "gnupg-$prev_ver.tar.gz" echo "Diffing" -tmp_name="g10-$curr_ver.diff.tmp" -diff_name="g10-$curr_ver.diff" +tmp_name="gnupg-$curr_ver.diff.tmp" +diff_name="gnupg-$curr_ver.diff" -diff -urN "g10-$prev_ver/" "g10-$curr_ver/" > $tmp_name || true +diff -urN "gnupg-$prev_ver/" "gnupg-$curr_ver/" > $tmp_name || true echo "Making patch file" @@ -31,12 +31,12 @@ cat < $diff_name This is a patch file against $prev_ver. -Change to directory g10-$prev_ver (or however you renamed it) +Change to directory gnupg-$prev_ver (or however you renamed it) and give this command: - zcat somepath/g10-$curr_ver.diff.gz | patch -p1 + zcat somepath/gnupg-$curr_ver.diff.gz | patch -p1 -It is a good idea to rename your current directory to g10-$curr_ver now. +It is a good idea to rename your current directory to gnupg-$curr_ver now. @@ -54,12 +54,12 @@ echo "Compressing patch file" gzip -9 $diff_name echo "Checking patch file" -cd g10-$prev_ver +cd gnupg-$prev_ver zcat ../$diff_name.gz | patch -s -p1 rm $(find . -name "*.orig") cd .. -if ! diff -urN "g10-$prev_ver/" "g10-$curr_ver/" >/dev/null ; then +if ! diff -urN "gnupg-$prev_ver/" "gnupg-$curr_ver/" >/dev/null ; then echo "compare failed" exit 1 fi @@ -67,8 +67,8 @@ fi echo "cleaning up" -rm -rf "g10-$curr_ver" -rm -rf "g10-$prev_ver" +rm -rf "gnupg-$curr_ver" +rm -rf "gnupg-$prev_ver" echo "Patch file $diff_name.gz is good." diff --git a/tools/bftest.c b/tools/bftest.c index cd0eef972..764a82610 100644 --- a/tools/bftest.c +++ b/tools/bftest.c @@ -1,14 +1,14 @@ /* bftest.c - Blowfish test program - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/tools/mpicalc.c b/tools/mpicalc.c index 0bee7fc42..f5ea14a81 100644 --- a/tools/mpicalc.c +++ b/tools/mpicalc.c @@ -1,5 +1,5 @@ /* mpitest.c - test the mpi functions - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * * This is a RPN calculator; values must be given in hex. * Operaion is like dc(1) except that the input/output radix is @@ -7,14 +7,14 @@ * Addition operators: ++ and --. All operators must be delimeted by a blank * * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/tools/primes.scm b/tools/primes.scm deleted file mode 100644 index 0772cdcf9..000000000 --- a/tools/primes.scm +++ /dev/null @@ -1,31 +0,0 @@ -(define (prime? n) - (define (smallest-divisor n) - (find-divisor n 2)) - (define (find-divisor n test) - (cond ((> (square test) n) n) - ((divides? test n) test) - (else (find-divisor n (+ test 1))))) - (define (divides? a b) - (= (remainder b a) 0)) - (define (square n) - (* n n)) - (= n (smallest-divisor n))) - -(define count 0) - - - -(define (display-prime n) - (display n) - (display ", ") - (cond ((> count 8) (display "\n") (let count 0)) - (else (define count (+ count 1))))) - - -(define (primes n limit) - (if (prime? n) - (display-prime n) ) - (if (< n limit) - (primes (+ n 1) limit)) ) - -(primes 3 5000) diff --git a/util/ChangeLog b/util/ChangeLog index a6d2a340c..e911c54ca 100644 --- a/util/ChangeLog +++ b/util/ChangeLog @@ -1,3 +1,7 @@ +Fri Feb 20 17:43:05 1998 Werner Koch (wk@isil.d.shuttle.de) + + * ttyio.c [MINGW32]: Add support for mingw32. + Tue Feb 17 19:43:44 1998 Werner Koch (wk@isil.d.shuttle.de) * memory.c (dump_table_at_exit): New. diff --git a/util/argparse.c b/util/argparse.c index a9965d836..38e809806 100644 --- a/util/argparse.c +++ b/util/argparse.c @@ -1,5 +1,5 @@ /* [argparse.c wk 17.06.97] Argument Parser for option handling - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * This file is part of WkLib. * * WkLib is free software; you can redistribute it and/or modify @@ -670,7 +670,7 @@ default_strusage( int level ) switch( level ) { case 11: p = "foo"; break; case 13: p = "0.0"; break; - case 14: p = "Copyright (C) 1998 Werner Koch (dd9jn)" ; break; + case 14: p = "Copyright (C) 1998 Free Software Foundation, Inc."; break; case 15: p = "This program comes with ABSOLUTELY NO WARRANTY.\n" "This is free software, and you are welcome to redistribute it\n" diff --git a/util/errors.c b/util/errors.c index 79a96d698..28a418536 100644 --- a/util/errors.c +++ b/util/errors.c @@ -1,14 +1,14 @@ /* errors.c - error strings - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/util/fileutil.c b/util/fileutil.c index 28bd866c5..e5f9311bc 100644 --- a/util/fileutil.c +++ b/util/fileutil.c @@ -1,14 +1,14 @@ /* fileutil.c - file utilities - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/util/iobuf.c b/util/iobuf.c index 5815cb538..ca3398674 100644 --- a/util/iobuf.c +++ b/util/iobuf.c @@ -1,14 +1,14 @@ /* iobuf.c - file handling - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/util/logger.c b/util/logger.c index 8b53a7b8d..5ccc44cfa 100644 --- a/util/logger.c +++ b/util/logger.c @@ -1,14 +1,14 @@ /* logger.c - log functions - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/util/memory.c b/util/memory.c index 6633b94a6..1ef1da64d 100644 --- a/util/memory.c +++ b/util/memory.c @@ -1,5 +1,5 @@ /* memory.c - memory allocation - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * * We use our own memory allocation functions instead of plain malloc(), * so that we can provide some special enhancements: @@ -12,14 +12,14 @@ * free() function and do some overflow checking. * d) memory checking and reporting if compiled with M_DEBUG * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/util/miscutil.c b/util/miscutil.c index d04d1595a..9dbb13ac1 100644 --- a/util/miscutil.c +++ b/util/miscutil.c @@ -1,14 +1,14 @@ /* miscutil.c - miscellaneous utilities - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/util/secmem.c b/util/secmem.c index a54848d54..68c6a43c8 100644 --- a/util/secmem.c +++ b/util/secmem.c @@ -1,14 +1,14 @@ /* secmem.c - memory allocation from a secure heap - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -88,7 +88,7 @@ lock_pool( void *p, size_t n ) } #else - log_info("Please note that you don´t have secure memory on this system\n"); + log_info("Please note that you don't have secure memory on this system\n"); #endif } diff --git a/util/strgutil.c b/util/strgutil.c index e04367a7e..271949fb5 100644 --- a/util/strgutil.c +++ b/util/strgutil.c @@ -1,14 +1,14 @@ /* strgutil.c - miscellaneous utilities - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. diff --git a/util/ttyio.c b/util/ttyio.c index ec7b6502b..415de65e4 100644 --- a/util/ttyio.c +++ b/util/ttyio.c @@ -1,14 +1,14 @@ /* ttyio.c - tty i/O functions - * Copyright (c) 1997 by Werner Koch (dd9jn) + * Copyright (C) 1998 Free Software Foundation, Inc. * - * This file is part of G10. + * This file is part of GNUPG. * - * G10 is free software; you can redistribute it and/or modify + * GNUPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * G10 is distributed in the hope that it will be useful, + * GNUPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -27,28 +27,75 @@ #ifdef HAVE_TCGETATTR #include #endif +#ifdef __MINGW32__ /* use the odd Win32 functions */ + #include + #ifdef HAVE_TCGETATTR + #error mingw32 and termios + #endif +#endif #include #include #include "util.h" #include "memory.h" #include "ttyio.h" + +#ifdef __MINGW32__ /* use the odd Win32 functions */ +static struct { + HANDLE in, out; +} con; +#define DEF_INPMODE (ENABLE_LINE_INPUT|ENABLE_ECHO_INPUT \ + |ENABLE_PROCESSED_INPUT ) +#define HID_INPMODE (ENABLE_LINE_INPUT|ENABLE_PROCESSED_INPUT ) +#define DEF_OUTMODE (ENABLE_WRAP_AT_EOL_OUTPUT|ENABLE_PROCESSED_OUTPUT) + +#else /* yeah, we have a real OS */ static FILE *ttyfp = NULL; +#endif + +static int initialized; static int last_prompt_len; + + + + static void init_ttyfp() { - if( ttyfp ) + if( initialized ) return; #if defined(__MINGW32__) - ttyfp = stderr; /* fixme */ + { + SECURITY_ATTRIBUTES sa; + + memset(&sa, 0, sizeof(sa)); + sa.nLength = sizeof(sa); + sa.bInheritHandle = TRUE; + con.out = CreateFileA( "CONOUT$", GENERIC_READ|GENERIC_WRITE, + FILE_SHARE_READ|FILE_SHARE_WRITE, + &sa, OPEN_EXISTING, 0, 0 ); + if( con.out == INVALID_HANDLE_VALUE ) + log_fatal("open(CONOUT$) failed: rc=%d", (int)GetLastError() ); + memset(&sa, 0, sizeof(sa)); + sa.nLength = sizeof(sa); + sa.bInheritHandle = TRUE; + con.in = CreateFileA( "CONIN$", GENERIC_READ|GENERIC_WRITE, + FILE_SHARE_READ|FILE_SHARE_WRITE, + &sa, OPEN_EXISTING, 0, 0 ); + if( con.in == INVALID_HANDLE_VALUE ) + log_fatal("open(CONIN$) failed: rc=%d", (int)GetLastError() ); + } + SetConsoleMode(con.in, DEF_INPMODE ); + SetConsoleMode(con.out, DEF_OUTMODE ); + #else ttyfp = fopen("/dev/tty", "r+"); - #endif if( !ttyfp ) log_fatal("cannot open /dev/tty: %s\n", strerror(errno) ); + #endif + initialized = 1; } @@ -57,13 +104,50 @@ tty_printf( const char *fmt, ... ) { va_list arg_ptr; - if( !ttyfp ) + if( !initialized ) init_ttyfp(); va_start( arg_ptr, fmt ) ; + #ifdef __MINGW32__ + { static char *buf; + static size_t bufsize; + int n; + DWORD nwritten; + + #if 0 /* the dox say, that there is a snprintf, but I didn't found + * it, so we use a static buffer for now */ + do { + if( n == -1 || !buf ) { + m_free(buf); + bufsize += 200; + /* better check the new size; (we use M$ functions) */ + if( bufsize > 50000 ) + log_bug("vsnprintf probably failed\n"); + buf = m_alloc( bufsize ); + } + n = _vsnprintf(buf, bufsize-1, fmt, arg_ptr); + } while( n == -1 ); + #else + if( !buf ) { + bufsize += 1000; + buf = m_alloc( bufsize ); + } + n = vsprintf(buf, fmt, arg_ptr); + if( n == -1 ) + log_bug("vsprintf() failed\n"); + #endif + + if( !WriteConsoleA( con.out, buf, n, &nwritten, NULL ) ) + log_fatal("WriteConsole failed: rc=%d", (int)GetLastError() ); + if( n != nwritten ) + log_fatal("WriteConsole failed: %d != %ld\n", n, nwritten ); + last_prompt_len += n; + } + #else last_prompt_len += vfprintf(ttyfp,fmt,arg_ptr) ; - va_end(arg_ptr); fflush(ttyfp); + #endif + va_end(arg_ptr); } @@ -73,9 +157,23 @@ tty_printf( const char *fmt, ... ) void tty_print_string( byte *p, size_t n ) { - if( !ttyfp ) + if( !initialized ) init_ttyfp(); + #ifdef __MINGW32__ + /* not so effective, change it if you want */ + for( ; n; n--, p++ ) + if( iscntrl( *p ) ) { + if( *p == '\n' ) + tty_printf("\\n"); + else if( !*p ) + tty_printf("\\0"); + else + tty_printf("\\x%02x", *p); + } + else + tty_printf("%c", *p); + #else for( ; n; n--, p++ ) if( iscntrl( *p ) ) { putc('\\', ttyfp); @@ -88,6 +186,7 @@ tty_print_string( byte *p, size_t n ) } else putc(*p, ttyfp); + #endif } @@ -104,7 +203,7 @@ do_get( const char *prompt, int hidden ) struct termios termsave; #endif - if( !ttyfp ) + if( !initialized ) init_ttyfp(); last_prompt_len = 0; @@ -112,6 +211,38 @@ do_get( const char *prompt, int hidden ) buf = m_alloc(n=50); i = 0; + #if __MINGW32__ /* windoze version */ + if( hidden ) + SetConsoleMode(con.in, HID_INPMODE ); + + for(;;) { + DWORD nread; + + if( !ReadConsoleA( con.in, cbuf, 1, &nread, NULL ) ) + log_fatal("ReadConsole failed: rc=%d", (int)GetLastError() ); + if( !nread ) + continue; + if( *cbuf == '\n' ) + break; + + if( !hidden ) + last_prompt_len++; + c = *cbuf; + if( c == '\t' ) + c = ' '; + else if( iscntrl(c) ) + continue; + if( !(i < n-1) ) { + n += 50; + buf = m_realloc( buf, n ); + } + buf[i++] = c; + } + + if( hidden ) + SetConsoleMode(con.in, DEF_INPMODE ); + + #else /* unix version */ if( hidden ) { #ifdef HAVE_TCGETATTR struct termios term; @@ -149,6 +280,7 @@ do_get( const char *prompt, int hidden ) log_error("tcsetattr() failed: %s\n", strerror(errno) ); #endif } + #endif /* end unix version */ buf[i] = 0; return buf; } @@ -170,17 +302,23 @@ tty_get_hidden( const char *prompt ) void tty_kill_prompt() { - int i; - if( !ttyfp ) + if( !initialized ) init_ttyfp(); if( !last_prompt_len ) return; - fputc('\r', ttyfp); - for(i=0; i < last_prompt_len; i ++ ) - fputc(' ', ttyfp); - fputc('\r', ttyfp); + #if __MINGW32__ + tty_printf("\r%*s\r", last_prompt_len, ""); + #else + { + int i; + putc('\r', ttyfp); + for(i=0; i < last_prompt_len; i ++ ) + putc(' ', ttyfp); + putc('\r', ttyfp); + fflush(ttyfp); + } + #endif last_prompt_len = 0; - fflush(ttyfp); }