1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

Renamed to GNUPG

This commit is contained in:
Werner Koch 1998-02-24 18:50:46 +00:00
parent 9119f2bf59
commit 5a05af2bca
144 changed files with 1279 additions and 1035 deletions

View File

@ -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) Wed Feb 18 17:36:45 1998 Werner Koch (wk@isil.d.shuttle.de)
* Makefile.am (checks): New. * Makefile.am (checks): New.

11
INSTALL
View File

@ -1,8 +1,8 @@
Please read the Basic Installation section somewhere below. 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 --with-zlib Forces usage of the local zlib sources. Default is
to use the (sahred) library of the system. 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 Installation
============ ============
G10 is not installed as suid:root; if you want to use it, do it manually pgp is not installed as suid:root; if you want to do it, do it manually.
(only g10, not g10maint).
You have to create the ~/.g10 directory manually. Your first action after The ~/.gpg directory will be created if it does not exist. Your first
this should be to create a key pair: "g10 --gen-key". action should be to create a key pair: "gpg --gen-key".

11
NEWS
View File

@ -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 Noteworthy changes in version 0.2.7
----------------------------------- -----------------------------------

101
README
View File

@ -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. THIS IS ALPHA SOFTWARE, EXPECT BUGS AND UNIMPLEMENTED STUFF.
IT MAY HAPPEN THAT SOME DATA FORMATS OR PROGRAMM OPTIONS 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 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 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 signature available. My PGP key is well known and published in
the "Global Trust Register for 1998", ISBN 0-9532397-0-5. the "Global Trust Register for 1998", ISBN 0-9532397-0-5.
I have included my pubring as "g10/pubring.10", which contains I have included my pubring as "g10/pubring.asc", which contains
the key used to make G10 signatures: the key used to make GNUPG signatures:
"pub 1312G/FF3EAA0B 1998-02-09 Werner Koch <wk@isil.d.shuttle.de>" "pub 1312G/FF3EAA0B 1998-02-09 Werner Koch <wk@isil.d.shuttle.de>"
"Key fingerprint = 8489 6CD0 1851 0E33 45DA CD67 036F 11B8 FF3E AA0B" "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 verify new releases. Because you verified the tar file containing
this file here, you can be sure that the above fingerprint is correct. 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. 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 it cannot be compatible to old PGP versions, because those use
IDEA (which is worldwide patented) and RSA (which is patented in IDEA (which is worldwide patented) and RSA (which is patented in
the United States until Sep 20, 2000). I'm sorry about this, but 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). 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 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 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. 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 encryption and signing; Blowfish with a 160 bit key for protecting
the secret-key components, conventional and session encryption; the secret-key components, conventional and session encryption;
RIPE MD-160 to create message digest. DSA, SHA-1 and CAST are RIPE MD-160 to create message digest. DSA, SHA-1 and CAST are
@ -61,19 +61,16 @@
3) "make install" 3) "make install"
4) You end up with a binary "g10" in /usr/local/bin 4) You end up with a binary "gpg" 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")
5) Optional, but suggested: install the program "gpg" as suid root.
Key Generation Key Generation
-------------- --------------
g10 --gen-key gpg --gen-key
This asks some questions and then starts key generation. To create This asks some questions and then starts key generation. To create
good random numbers for prime number generation, it uses a /dev/random 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 You should make a revocation certificate in cases someone gets
knowledge of your secret key or you forgot your passphrase: 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, 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 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: 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. 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" This let you sign the key of of "Donald" with the userids of "Karl"
and "Joe". and "Joe".
@ -142,16 +139,16 @@
Sign 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. 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". Creates a signature of file, but writes the output to the file "out".
@ -159,12 +156,12 @@
Encrypt Encrypt
------- -------
g10 -e -r heine file gpg -e -r heine file
This encrypts files with the public key of "heine" and writes it 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. Ditto, but encrypts "hallo\n" and mails it as ascii armored message.
@ -172,13 +169,13 @@
Sign and Encrypt 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 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" Ditto, but sign the file with the user id "Suttner"
@ -187,17 +184,17 @@
------------------ ------------------
To export your complete keyring(s) do this: To export your complete keyring(s) do this:
g10 --export gpg --export
To export only some user ids do this: To export only some user ids do this:
g10 --export userids gpg --export userids
Use "-a" or "--armor" to create ASCII armored output. Use "-a" or "--armor" to create ASCII armored output.
Importing keys is done with the option, you guessed it, "--import": 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 New keys are appended to the default keyring and already existing
keys are merged. Keys without a self-signature are ignored. keys are merged. Keys without a self-signature are ignored.
@ -243,7 +240,7 @@
"#34" "#34"
This can be used by a MUA to specify an exact key after selecting 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: * Or by the usual substring:
@ -258,19 +255,19 @@
Batch mode 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 never prompts for input data. This even does not allow to enter
passphrase; until we have a better solution (something like ssh-agent), passphrase; until we have a better solution (something like ssh-agent),
you can use the option "--passhrase-fd n", which works like PGPs you can use the option "--passhrase-fd n", which works like PGPs
PGPPASSFD. 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. detected.
Exit status 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 has been detected or 2 or higher for all other errors. You should parse
stderr to get detailed informations about the errors. stderr to get detailed informations about the errors.
@ -278,26 +275,26 @@
Esoteric commands 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 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. 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 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. 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 List the contents of the trustdb in a human readable format
g10maint --list-trustdb <usernames> gpgm --list-trustdb <usernames>
List the tree of certificates for the given usernames 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 List the possible trust paths for the given username, up to the specified
depth. If depth is negative, duplicate introducers are not listed, 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 using a negative number). This option may create new entries in the
trustdb. trustdb.
g10maint --print-mds filenames gpgm --print-mds filenames
List all available message digest values for the fiven 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 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 Generate a prime number suitable for ElGamal signatures of size n with
a q as largest primefactor of n-1. 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. 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 Debug Flags
@ -354,12 +351,12 @@
but for now I stick to my own formatting rules. but for now I stick to my own formatting rules.
The primary FTP site is "ftp://ftp.guug.de/pub/gcrypt/" 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 <g10-keys@isil.d.shuttle.de>; use If you like, send your keys to <gnupg-keys@isil.d.shuttle.de>; use
"g10 --export --armor | mail g10-keys@isil.d.shuttle.de" to do this. "gnupg --export --armor | mail gnupg-keys@isil.d.shuttle.de" to do this.
Please direct bug reports to <g10-bugs@isil.d.shuttle.de> or better Please direct bug reports to <gnupg-bugs@isil.d.shuttle.de> or better
post them to the mailing list <g10@net.lut.ac.uk>. post them to the mailing list <g10@net.lut.ac.uk>.

2
TODO
View File

@ -33,6 +33,4 @@
them to your key and because the user id which is signed by others has 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. also be signed by you, all user-ids are bound together.
* create directory .g10

View File

@ -1 +1 @@
0.2.7 0.2.8

View File

@ -1,14 +1,14 @@
/* acconfig.h - used by autoheader to make config.h.in /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -2,7 +2,7 @@
TESTS = checkit 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 plain-1.asc plain-2.asc plain-3.asc
EXTRA_DIST = $(TESTS) $(TEST_FILES) EXTRA_DIST = $(TESTS) $(TEST_FILES)

View File

@ -44,15 +44,15 @@ cleanup () {
run_g10 () { run_g10 () {
if ! eval ../g10/g10 --homedir . $* ; then if ! eval ../g10/gpg --homedir . $* ; then
echo "(../g10/g10 --homedir . $*) failed" >&2 echo "(../g10/gpg --homedir . $*) failed" >&2
exit 1 exit 1
fi fi
} }
run_g10maint () { run_g10maint () {
if ! eval ../g10/g10maint --homedir . $* ; then if ! eval ../g10/gpgm --homedir . $* ; then
echo "(../g10/g10maint --homedir . $*) failed" >&2 echo "(../g10/gpgm --homedir . $*) failed" >&2
exit 1 exit 1
fi fi
} }
@ -85,8 +85,9 @@ EOF
run_g10 --version run_g10 --version
info Unpacking some material info Unpacking some material
run_g10maint --yes --dearmor -o pubring.g10 pubring.asc run_g10maint --yes --dearmor -o pubring.gpg pubring.asc
run_g10maint --yes --dearmor -o secring.g10 secring.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 run_g10maint --yes --dearmor -o plain-3 plain-3o.asc
plain_files="$plain_files plain-3" plain_files="$plain_files plain-3"
# make sure all files are created # make sure all files are created
@ -94,7 +95,7 @@ echo "$usrpass1" | run_g10 --no-operation
info Checking decryption info Checking decryption
for i in $plain_files ; do 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" cmp $i y || error "$i: mismatch"
done done

12
checks/gnupg.asc Normal file
View File

@ -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-----

Binary file not shown.

Binary file not shown.

View File

@ -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) Wed Feb 18 14:08:30 1998 Werner Koch (wk@isil.d.shuttle.de)
* md.c, md.h : New debugging support * md.c, md.h : New debugging support

View File

@ -1,18 +1,18 @@
/* blowfish.c - Blowfish encryption /* 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: * For a description of the algorithm, see:
* Bruce Schneier: Applied Cryptography. John Wiley & Sons, 1996. * Bruce Schneier: Applied Cryptography. John Wiley & Sons, 1996.
* ISBN 0-471-11709-9. Pages 336 ff. * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* blowfish.h /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* cast5.c - CAST5 cipher (RFC2144) /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* cast5.h /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* dsa.c - DSA signature scheme /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* dsa.h - DSA signature scheme /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,18 +1,18 @@
/* elgamal.c - ElGamal Public Key encryption /* 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: * For a description of the algorithm, see:
* Bruce Schneier: Applied Cryptography. John Wiley & Sons, 1996. * Bruce Schneier: Applied Cryptography. John Wiley & Sons, 1996.
* ISBN 0-471-11709-9. Pages 476 ff. * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* elgamal.h /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,18 +1,18 @@
/* gost.c - GOST encryption /* 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: * The description of GOST (and the used S-boxes) are taken from:
* Bruce Schneier: Applied Cryptography. John Wiley & Sons, 1996. * Bruce Schneier: Applied Cryptography. John Wiley & Sons, 1996.
* ISBN 0-471-11709-9. . * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* gost.h /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* md.c - message digest dispatcher /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* md.h - digest functions /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,51 +1,25 @@
/* md5.c - MD5 Message-Digest Algorithm /* 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 * This program is distributed in the hope that it will be useful,
* it under the terms of the GNU General Public License as published by * but WITHOUT ANY WARRANTY; without even the implied warranty of
* the Free Software Foundation; either version 2 of the License, or * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* (at your option) any later version. * GNU General Public License for more details.
* *
* WkLib is distributed in the hope that it will be useful, * You should have received a copy of the GNU General Public License
* but WITHOUT ANY WARRANTY; without even the implied warranty of * along with this program; if not, write to the Free Software Foundation,
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* 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 !
*/ */
/* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. */
/* modified for GNUPG by <werner.koch@guug.de> */
/* Test values: /* Test values:
* "" D4 1D 8C D9 8F 00 B2 04 E9 80 09 98 EC F8 42 7E * "" D4 1D 8C D9 8F 00 B2 04 E9 80 09 98 EC F8 42 7E
@ -64,128 +38,245 @@
#include "memory.h" #include "memory.h"
#if __WATCOMC__ && defined(M_I86) #ifdef BIG_ENDIAN_HOST
/* 16-Bit Compiler breaks Code in Function Transform() */ #define SWAP(n) \
/* (at least when compiling for windows) */ (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
#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;
}
#else #else
#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) #define SWAP(n) (n)
#endif #endif
/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4 */ /* This array contains the bytes used to pad the buffer to the next
/* Rotation is separate from addition to prevent recomputation */ 64-byte boundary. (RFC 1321, 3.1: Step 1) */
#define FF(a, b, c, d, x, s, ac) \ static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ };
{(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); \
}
void void
md5_init( MD5_CONTEXT *mdContext) md5_init( MD5_CONTEXT *ctx )
{ {
mdContext->i[0] = mdContext->i[1] = (u32)0; ctx->A = 0x67452301;
/* Load magic initialization constants. ctx->B = 0xefcdab89;
*/ ctx->C = 0x98badcfe;
mdContext->buf[0] = (u32)0x67452301L; ctx->D = 0x10325476;
mdContext->buf[1] = (u32)0xefcdab89L;
mdContext->buf[2] = (u32)0x98badcfeL; ctx->total[0] = ctx->total[1] = 0;
mdContext->buf[3] = (u32)0x10325476L; ctx->buflen = 0;
mdContext->count = 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] * account for the presence of each of the characters inBuf[0..inLen-1]
* in the message whose digest is being computed. * in the message whose digest is being computed.
*/ */
void 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; /* When we already have some bits in our internal buffer concatenate
int mdi; both inputs first. */
u32 in[16]; 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 */ memcpy (&ctx->buffer[left_over], buffer, add);
i = mdContext->count; ctx->buflen += add;
mdContext->count = 0;
md5_write( mdContext, mdContext->digest, i);
}
if( !inBuf )
return;
/* compute number of bytes mod 64 */ if (left_over + add > 64)
mdi = (int)((mdContext->i[0] >> 3) & 0x3F); {
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 */ buffer = (const char *) buffer + add;
if((mdContext->i[0] + ((u32)inLen << 3)) < mdContext->i[0]) len -= add;
mdContext->i[1]++; }
mdContext->i[0] += ((u32)inLen << 3);
mdContext->i[1] += ((u32)inLen >> 29);
while(inLen--) { /* Process available complete blocks. */
/* add new character to buffer, increment mdi */ if (len > 64)
mdContext->in[mdi++] = *inBuf++; {
transform( ctx, buffer, len & ~63);
buffer = (const char *) buffer + (len & ~63);
len &= 63;
}
/* transform if necessary */ /* Move remaining bytes in internal buffer. */
if( mdi == 0x40 ) { if (len > 0)
for(i = 0, ii = 0; i < 16; i++, ii += 4) {
in[i] = (((u32)mdContext->in[ii+3]) << 24) | memcpy (ctx->buffer, buffer, len);
(((u32)mdContext->in[ii+2]) << 16) | ctx->buflen = len;
(((u32)mdContext->in[ii+1]) << 8) | }
((u32)mdContext->in[ii]);
Transform(mdContext->buf, in);
mdi = 0;
}
}
} }
@ -197,145 +288,33 @@ md5_write( MD5_CONTEXT *mdContext, byte *inBuf, size_t inLen)
*/ */
void void
md5_final( MD5_CONTEXT *mdContext ) md5_final( MD5_CONTEXT *ctx )
{ {
u32 in[16]; /* Take yet unprocessed bytes into account. */
int mdi; u32 bytes = ctx->buflen;
unsigned int i, ii; size_t pad;
unsigned int padLen;
if(mdContext->count) /* flush buffer */ /* Now count remaining bytes. */
md5_write(mdContext, NULL, 0 ); ctx->total[0] += bytes;
/* save number of bits */ if( ctx->total[0] < bytes )
in[14] = mdContext->i[0]; ++ctx->total[1];
in[15] = mdContext->i[1];
/* compute number of bytes mod 64 */ pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes;
mdi = (int)((mdContext->i[0] >> 3) & 0x3F); memcpy (&ctx->buffer[bytes], fillbuf, pad);
/* pad out to 56 mod 64 */ /* Put the 64-bit file length in *bits* at the end of the buffer. */
padLen = (mdi < 56) ? (56 - mdi) : (120 - mdi); *(u32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3);
md5_write(mdContext, PADDING, padLen); *(u32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) |
(ctx->total[0] >> 29));
/* append length in bits and transform */ /* Process last bytes. */
for(i = 0, ii = 0; i < 14; i++, ii += 4) transform( ctx, ctx->buffer, bytes + pad + 8);
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);
/* store buffer in digest */ /* Store the result in buffer */
for(i = 0, ii = 0; i < 4; i++, ii += 4) { ((u32 *)ctx->buffer)[0] = SWAP (ctx->A);
mdContext->digest[ii] = (byte)(mdContext->buf[i] & 0xFF); ((u32 *)ctx->buffer)[1] = SWAP (ctx->B);
mdContext->digest[ii+1] = (byte)((mdContext->buf[i] >> 8) & 0xFF); ((u32 *)ctx->buffer)[2] = SWAP (ctx->C);
mdContext->digest[ii+2] = (byte)((mdContext->buf[i] >> 16) & 0xFF); ((u32 *)ctx->buffer)[3] = SWAP (ctx->D);
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;
} }

View File

@ -1,14 +1,14 @@
/* md5.h - message digest 5 /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
@ -23,17 +23,16 @@
#include "types.h" #include "types.h"
typedef struct { typedef struct {
u32 i[2]; /* number of _bits_ handled mod 2^64 */ u32 A,B,C,D; /* chaining variables */
u32 buf[4]; /* scratch buffer */ u32 total[2];
int count; u32 buflen;
byte in[64]; /* input buffer */ char buffer[128];
byte digest[16+8+1]; /* actual digest after Final call */
} MD5_CONTEXT; } MD5_CONTEXT;
void md5_init( MD5_CONTEXT *c ); void md5_init( MD5_CONTEXT *ctx );
void md5_write( MD5_CONTEXT *hd, byte *inbuf, size_t inlen); void md5_write( MD5_CONTEXT *ctx, const void *buffer, size_t len);
void md5_final( MD5_CONTEXT *hd); void md5_final( MD5_CONTEXT *ctx);
#define md5_read(h) ( (h)->digest ) #define md5_read(h) ( (h)->buffer )
#endif /*G10_MD5_H*/ #endif /*G10_MD5_H*/

View File

@ -1,14 +1,14 @@
/* misc.c - utility functions /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* primegen.c - prime number generator /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* random.c - random number generator /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
@ -53,11 +53,10 @@ quick_random_gen( int onoff )
int last = quick_test; int last = quick_test;
if( onoff != -1 ) if( onoff != -1 )
quick_test = onoff; quick_test = onoff;
#ifdef HAVE_DEV_RANDOM #ifndef HAVE_DEV_RANDOM
return last; last = 1; /* insecure RNG */
#else
return 1; /* insecure RNG */
#endif #endif
return last;
} }

View File

@ -1,14 +1,14 @@
/* rmd.h - RIPE-MD hash functions /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* rmd160.c - RIPE-MD160 /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* rmd160test.c - ripe md 160 test program /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,16 +1,16 @@
/* sha1.c - SHA1 hash function /* 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! * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* sha1.h - SHA1 hash function /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* smallprime.c - List of small primes /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,15 +1,15 @@
/* config.h.in. Generated automatically from configure.in by autoheader. */ /* config.h.in. Generated automatically from configure.in by autoheader. */
/* acconfig.h - used by autoheader to make config.h.in /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,5 +1,5 @@
dnl dnl
dnl Configure template for G10 dnl Configure template for GNUPG
dnl dnl
dnl (Process this file with autoconf to produce a configure script.) dnl (Process this file with autoconf to produce a configure script.)
@ -20,7 +20,7 @@ fi
VERSION=`cat $srcdir/VERSION` VERSION=`cat $srcdir/VERSION`
PACKAGE=g10 PACKAGE=gnupg
ALL_LINGUAS="de" ALL_LINGUAS="de"
AC_SUBST(VERSION) AC_SUBST(VERSION)
AC_SUBST(PACKAGE) AC_SUBST(PACKAGE)

View File

@ -31,7 +31,7 @@ Record type 1:
Version information for this TrustDB. This is always the first Version information for this TrustDB. This is always the first
record of the DB and the onyl one with type 1. record of the DB and the onyl one with type 1.
1 byte value 1 1 byte value 1
3 bytes 'g10' magic value 3 bytes 'gpg' magic value
1 byte Version of the TrustDB 1 byte Version of the TrustDB
3 byte reserved 3 byte reserved
1 u32 locked by (pid) 0 = not locked. 1 u32 locked by (pid) 0 = not locked.
@ -185,7 +185,7 @@ Record type 7 (hash list)
Packet Headers 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: There is one enhavement used ith the old style packet headers:
CTB bits 10, the "packet-length length bits", have values listed in CTB bits 10, the "packet-length length bits", have values listed in

View File

@ -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) Wed Feb 18 18:39:02 1998 Werner Koch (wk@isil.d.shuttle.de)
* Makefile.am (OMIT_DEPENDENCIES): New. * Makefile.am (OMIT_DEPENDENCIES): New.

View File

@ -5,7 +5,7 @@ EXTRA_DIST = OPTIONS pubring.asc
OMIT_DEPENDENCIES = zlib.h zconf.h OMIT_DEPENDENCIES = zlib.h zconf.h
needed_libs = ../cipher/libcipher.a ../mpi/libmpi.a ../util/libutil.a needed_libs = ../cipher/libcipher.a ../mpi/libmpi.a ../util/libutil.a
bin_PROGRAMS = g10 g10maint bin_PROGRAMS = gpg gpgm
common_source = \ common_source = \
build-packet.c \ build-packet.c \
@ -49,12 +49,12 @@ common_source = \
revoke.c \ revoke.c \
sig-check.c sig-check.c
g10_SOURCES = g10.c \ gpg_SOURCES = g10.c \
$(common_source) \ $(common_source) \
keygen.c keygen.c
g10maint_SOURCES = g10maint.c \ gpgm_SOURCES = g10maint.c \
dearmor.c \ dearmor.c \
$(common_source) $(common_source)

View File

@ -91,7 +91,7 @@ EXTRA_DIST = OPTIONS pubring.asc
OMIT_DEPENDENCIES = zlib.h zconf.h OMIT_DEPENDENCIES = zlib.h zconf.h
needed_libs = ../cipher/libcipher.a ../mpi/libmpi.a ../util/libutil.a needed_libs = ../cipher/libcipher.a ../mpi/libmpi.a ../util/libutil.a
bin_PROGRAMS = g10 g10maint bin_PROGRAMS = gpg gpgm
common_source = \ common_source = \
build-packet.c \ build-packet.c \
@ -135,11 +135,11 @@ common_source = \
revoke.c \ revoke.c \
sig-check.c sig-check.c
g10_SOURCES = g10.c \ gpg_SOURCES = g10.c \
$(common_source) \ $(common_source) \
keygen.c keygen.c
g10maint_SOURCES = g10maint.c \ gpgm_SOURCES = g10maint.c \
dearmor.c \ dearmor.c \
$(common_source) $(common_source)
@ -154,26 +154,26 @@ DEFS = @DEFS@ -I. -I$(srcdir) -I..
CPPFLAGS = @CPPFLAGS@ CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@ LDFLAGS = @LDFLAGS@
LIBS = @LIBS@ 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 \ 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 \ 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 \ 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 \ import.o export.o comment.o status.o sign.o plaintext.o encr-data.o \
encode.o revoke.o sig-check.o keygen.o encode.o revoke.o sig-check.o keygen.o
g10_LDADD = $(LDADD) gpg_LDADD = $(LDADD)
g10_DEPENDENCIES = ../cipher/libcipher.a ../mpi/libmpi.a \ gpg_DEPENDENCIES = ../cipher/libcipher.a ../mpi/libmpi.a \
../util/libutil.a ../util/libutil.a
g10_LDFLAGS = gpg_LDFLAGS =
g10maint_OBJECTS = g10maint.o dearmor.o build-packet.o compress.o \ gpgm_OBJECTS = g10maint.o dearmor.o build-packet.o compress.o \
free-packet.o getkey.o pkclist.o skclist.o ringedit.o kbnode.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 \ 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 \ 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 \ 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 plaintext.o encr-data.o encode.o revoke.o sig-check.o
g10maint_LDADD = $(LDADD) gpgm_LDADD = $(LDADD)
g10maint_DEPENDENCIES = ../cipher/libcipher.a ../mpi/libmpi.a \ gpgm_DEPENDENCIES = ../cipher/libcipher.a ../mpi/libmpi.a \
../util/libutil.a ../util/libutil.a
g10maint_LDFLAGS = gpgm_LDFLAGS =
CFLAGS = @CFLAGS@ CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ 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/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/seskey.P .deps/sig-check.P .deps/sign.P .deps/skclist.P \
.deps/status.P .deps/textfilter.P .deps/trustdb.P .deps/status.P .deps/textfilter.P .deps/trustdb.P
SOURCES = $(g10_SOURCES) $(g10maint_SOURCES) SOURCES = $(gpg_SOURCES) $(gpgm_SOURCES)
OBJECTS = $(g10_OBJECTS) $(g10maint_OBJECTS) OBJECTS = $(gpg_OBJECTS) $(gpgm_OBJECTS)
default: all default: all
@ -253,13 +253,13 @@ distclean-compile:
maintainer-clean-compile: maintainer-clean-compile:
g10: $(g10_OBJECTS) $(g10_DEPENDENCIES) gpg: $(gpg_OBJECTS) $(gpg_DEPENDENCIES)
@rm -f g10 @rm -f gpg
$(LINK) $(g10_LDFLAGS) $(g10_OBJECTS) $(g10_LDADD) $(LIBS) $(LINK) $(gpg_LDFLAGS) $(gpg_OBJECTS) $(gpg_LDADD) $(LIBS)
g10maint: $(g10maint_OBJECTS) $(g10maint_DEPENDENCIES) gpgm: $(gpgm_OBJECTS) $(gpgm_DEPENDENCIES)
@rm -f g10maint @rm -f gpgm
$(LINK) $(g10maint_LDFLAGS) $(g10maint_OBJECTS) $(g10maint_LDADD) $(LIBS) $(LINK) $(gpgm_LDFLAGS) $(gpgm_OBJECTS) $(gpgm_LDADD) $(LIBS)
tags: TAGS tags: TAGS

View File

@ -1,14 +1,14 @@
/* armor.c - Armor filter /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
@ -942,7 +942,7 @@ armor_filter( void *opaque, int control,
iobuf_writestr(a, "-----"); iobuf_writestr(a, "-----");
iobuf_writestr(a, head_strings[afx->what] ); iobuf_writestr(a, head_strings[afx->what] );
iobuf_writestr(a, "-----\n"); iobuf_writestr(a, "-----\n");
iobuf_writestr(a, "Version: G10 v" VERSION " (" iobuf_writestr(a, "Version: GNUPG v" VERSION " ("
PRINTABLE_OS_NAME ")\n"); PRINTABLE_OS_NAME ")\n");
iobuf_writestr(a, "Comment: This is an alpha version!\n"); iobuf_writestr(a, "Comment: This is an alpha version!\n");
if( afx->hdrlines ) if( afx->hdrlines )

View File

@ -1,14 +1,14 @@
/* build-packet.c - assemble packets and write them /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * 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 rc = 0;
int c; int c;
IOBUF a = iobuf_temp(); IOBUF a = iobuf_temp();
#if 1 #if 0
FILE *fp = fopen("dump.pkc", "a"); FILE *fp = fopen("dump.pkc", "a");
int i=0; int i=0;
@ -225,7 +225,7 @@ hash_public_cert( MD_HANDLE md, PKT_public_cert *pkc )
if( (rc = build_packet( a, &pkt )) ) if( (rc = build_packet( a, &pkt )) )
log_fatal("build public_cert for hashing failed: %s\n", g10_errstr(rc)); log_fatal("build public_cert for hashing failed: %s\n", g10_errstr(rc));
while( (c=iobuf_get(a)) != -1 ) { while( (c=iobuf_get(a)) != -1 ) {
#if 1 #if 0
fprintf( fp," %02x", c ); fprintf( fp," %02x", c );
if( (++i == 24) ) { if( (++i == 24) ) {
putc('\n', fp); putc('\n', fp);
@ -234,7 +234,7 @@ hash_public_cert( MD_HANDLE md, PKT_public_cert *pkc )
#endif #endif
md_putc( md, c ); md_putc( md, c );
} }
#if 1 #if 0
putc('\n', fp); putc('\n', fp);
fclose(fp); fclose(fp);
#endif #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.g );
mpi_write(a, skc->d.elg.y ); mpi_write(a, skc->d.elg.y );
if( skc->d.elg.is_protected ) { if( skc->d.elg.is_protected ) {
assert( skc->d.elg.protect_algo == CIPHER_ALGO_BLOWFISH ); iobuf_put(a, 0xff );
iobuf_put(a, skc->d.elg.protect_algo ); iobuf_put(a, skc->d.elg.protect.algo );
iobuf_write(a, skc->d.elg.protect.blowfish.iv, 8 ); 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 else
iobuf_put(a, 0 ); iobuf_put(a, 0 );

View File

@ -1,14 +1,14 @@
/* cipher.c - En-/De-ciphering filter /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* comment.c - write comment stuff /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* compress.c - compress filter /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* elg.c /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* encode.c - encode data /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
@ -89,7 +89,7 @@ encode_simple( const char *filename, int mode )
if( mode ) { if( mode ) {
cfx.dek = m_alloc_secure( sizeof *cfx.dek ); cfx.dek = m_alloc_secure( sizeof *cfx.dek );
cfx.dek->algo = opt.def_cipher_algo; 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); m_free(cfx.dek);
iobuf_close(inp); iobuf_close(inp);
log_error("error creating passphrase: %s\n", g10_errstr(rc) ); log_error("error creating passphrase: %s\n", g10_errstr(rc) );
@ -106,7 +106,7 @@ encode_simple( const char *filename, int mode )
if( opt.armor ) if( opt.armor )
iobuf_push_filter( out, armor_filter, &afx ); 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 ")"); PRINTABLE_OS_NAME ")");
if( opt.compress ) if( opt.compress )
@ -193,7 +193,7 @@ encode_crypt( const char *filename, STRLIST remusr )
if( opt.armor ) if( opt.armor )
iobuf_push_filter( out, armor_filter, &afx ); 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 ")"); PRINTABLE_OS_NAME ")");
if( opt.compress ) if( opt.compress )

View File

@ -1,14 +1,14 @@
/* encr-data.c - process an encrypted data packet /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* export.c /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* filter.h /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* free-packet.c - cleanup stuff for packets /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* g10.c - The G10 utility /* g10.c - The GNUPG utility (main for gpg)
* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
@ -110,7 +110,7 @@ static ARGPARSE_OPTS opts[] = {
{ 523, "passphrase-fd",1, "\r" }, { 523, "passphrase-fd",1, "\r" },
{ 541, "no-operation", 0, "\r" }, /* used by regression tests */ { 541, "no-operation", 0, "\r" }, /* used by regression tests */
{ 543, "no-options", 0, "\r" }, /* shortcut for --options /dev/null */ { 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" }, { 545, "no-batch", 0, "\r" },
{0} }; {0} };
@ -137,18 +137,18 @@ strusage( int level )
static char *digests, *pubkeys, *ciphers; static char *digests, *pubkeys, *ciphers;
const char *p; const char *p;
switch( level ) { switch( level ) {
case 11: p = "g10"; break; case 11: p = "GNUPG"; break;
case 13: p = VERSION; break; case 13: p = VERSION; break;
case 17: p = PRINTABLE_OS_NAME; break; case 17: p = PRINTABLE_OS_NAME; break;
case 19: p = _( case 19: p = _(
"Please report bugs to <g10-bugs@isil.d.shuttle.de>." "Please report bugs to <gnupg-bugs@isil.d.shuttle.de>.\n"
); break; ); break;
case 1: case 1:
case 40: p = _( case 40: p = _(
"Usage: g10 [options] [files] (-h for help)" "Usage: gpg [options] [files] (-h for help)"
); break; ); break;
case 41: p = _( case 41: p = _(
"Syntax: g10 [options] [files]\n" "Syntax: gpg [options] [files]\n"
"sign, check, encrypt or decrypt\n" "sign, check, encrypt or decrypt\n"
"default operation depends on the input data\n" "default operation depends on the input data\n"
); break; ); break;
@ -223,7 +223,7 @@ i18n_init(void)
static void static void
wrong_args( const char *text) wrong_args( const char *text)
{ {
fputs(_("usage: g10 [options] "),stderr); fputs(_("usage: gpg [options] "),stderr);
fputs(text,stderr); fputs(text,stderr);
putc('\n',stderr); putc('\n',stderr);
g10_exit(2); g10_exit(2);
@ -318,7 +318,7 @@ main( int argc, char **argv )
* secmem_init() somewhere after the option parsing * secmem_init() somewhere after the option parsing
*/ */
log_set_name("g10"); log_set_name("gpg");
i18n_init(); i18n_init();
opt.compress = -1; /* defaults to standard compress level */ opt.compress = -1; /* defaults to standard compress level */
opt.def_cipher_algo = CIPHER_ALGO_BLOWFISH; opt.def_cipher_algo = CIPHER_ALGO_BLOWFISH;
@ -326,7 +326,7 @@ main( int argc, char **argv )
opt.def_digest_algo = DIGEST_ALGO_RMD160; opt.def_digest_algo = DIGEST_ALGO_RMD160;
opt.completes_needed = 1; opt.completes_needed = 1;
opt.marginals_needed = 3; opt.marginals_needed = 3;
opt.homedir = "~/.g10"; opt.homedir = "~/.gnupg";
/* check wether we have a config file on the commandline */ /* check wether we have a config file on the commandline */
orig_argc = argc; orig_argc = argc;
@ -501,9 +501,9 @@ main( int argc, char **argv )
set_packet_list_mode(1); set_packet_list_mode(1);
if( !sec_nrings || default_keyring ) /* add default secret rings */ 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 */ if( !nrings || default_keyring ) /* add default ring */
add_keyring("pubring.g10"); add_keyring("pubring.gpg");
if( argc ) { if( argc ) {
fname_print = fname = *argv; fname_print = fname = *argv;

View File

@ -1,14 +1,14 @@
/* g10maint.c - The G10 maintenance utility /* g10maint.c - The GNUPG maintenance utility
* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
@ -62,19 +62,19 @@ strusage( int level )
static char *digests, *pubkeys, *ciphers; static char *digests, *pubkeys, *ciphers;
const char *p; const char *p;
switch( level ) { switch( level ) {
case 11: p = "g10maint"; break; case 11: p = "gpgm (GNUPG)"; break;
case 13: p = VERSION; break; case 13: p = VERSION; break;
case 17: p = PRINTABLE_OS_NAME; break; case 17: p = PRINTABLE_OS_NAME; break;
case 19: p = _( case 19: p = _(
"Please report bugs to <g10-bugs@isil.d.shuttle.de>." "Please report bugs to <gnupg-bugs@isil.d.shuttle.de>.\n"
); break; ); break;
case 1: case 1:
case 40: p = _( case 40: p = _(
"Usage: g10maint [options] [files] (-h for help)" "Usage: gpgm [options] [files] (-h for help)"
); break; ); break;
case 41: p = _( case 41: p = _(
"Syntax: g10maint [options] [files]\n" "Syntax: gpgm [options] [files]\n"
"G10 maintenance utility\n" "GNUPG maintenance utility\n"
); break; ); break;
case 31: p = "\n"; break; case 31: p = "\n"; break;
@ -146,7 +146,7 @@ i18n_init(void)
static void static void
wrong_args( const char *text) wrong_args( const char *text)
{ {
fputs(_("Usage: g10maint [options] "),stderr); fputs(_("Usage: gpgm [options] "),stderr);
fputs(text,stderr); fputs(text,stderr);
putc('\n',stderr); putc('\n',stderr);
g10_exit(2); g10_exit(2);
@ -221,7 +221,7 @@ main( int argc, char **argv )
{ 538, "trustdb-name", 2, "\r" }, { 538, "trustdb-name", 2, "\r" },
{ 540, "no-secmem-warning", 0, "\r" }, /* dummy */ { 540, "no-secmem-warning", 0, "\r" }, /* dummy */
{ 543, "no-options", 0, "\r" }, /* shortcut for --options /dev/null */ { 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" }, { 545, "no-batch", 0, "\r" },
{ 546, "dearmor", 0, N_("De-Armor a file or stdin") }, { 546, "dearmor", 0, N_("De-Armor a file or stdin") },
{ 547, "enarmor", 0, N_("En-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 */ secmem_init( 0 ); /* disable use of secmem */
log_set_name("g10maint"); log_set_name("gpgm");
i18n_init(); i18n_init();
opt.compress = -1; /* defaults to standard compress level */ opt.compress = -1; /* defaults to standard compress level */
opt.def_cipher_algo = CIPHER_ALGO_BLOWFISH; opt.def_cipher_algo = CIPHER_ALGO_BLOWFISH;
@ -258,7 +258,7 @@ main( int argc, char **argv )
opt.def_digest_algo = DIGEST_ALGO_RMD160; opt.def_digest_algo = DIGEST_ALGO_RMD160;
opt.completes_needed = 1; opt.completes_needed = 1;
opt.marginals_needed = 3; opt.marginals_needed = 3;
opt.homedir = "~/.g10"; opt.homedir = "~/.gnupg";
/* check wether we have a config file on the commandline */ /* check wether we have a config file on the commandline */
orig_argc = argc; orig_argc = argc;
@ -424,12 +424,12 @@ main( int argc, char **argv )
if( cmd != aDeArmor && cmd != aEnArmor ) { if( cmd != aDeArmor && cmd != aEnArmor ) {
if( !sec_nrings || default_keyring ) { /* add default secret rings */ 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); add_secret_keyring(p);
m_free(p); m_free(p);
} }
if( !nrings || default_keyring ) { /* add default ring */ 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); add_keyring(p);
m_free(p); m_free(p);
} }

View File

@ -1,14 +1,14 @@
/* getkey.c - Get a key from the database /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* import.c /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* kbnode.c - keyblock node utility functions /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* keydb.h - Key database /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * 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 --*/ /*-- passphrase.h --*/
void set_passphrase_fd( int fd ); void set_passphrase_fd( int fd );
int get_passphrase_fd(void); int get_passphrase_fd(void);
DEK *get_passphrase_hash( u32 *keyid, char *text ); DEK *get_passphrase_hash( u32 *keyid, char *text, byte *salt );
int make_dek_from_passphrase( DEK *dek, int mode ); int make_dek_from_passphrase( DEK *dek, int mode, byte *salt );
/*-- getkey.c --*/ /*-- getkey.c --*/
void add_keyring( const char *name ); void add_keyring( const char *name );

View File

@ -1,14 +1,14 @@
/* keygen.c - generate a key pair /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
@ -136,7 +136,7 @@ write_selfsig( KBNODE root, KBNODE pub_root, PKT_secret_cert *skc )
static int static int
gen_elg(unsigned nbits, KBNODE pub_root, KBNODE sec_root, DEK *dek, 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 rc;
int i; 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.y = sk.y;
skc->d.elg.x = sk.x; skc->d.elg.x = sk.x;
skc->d.elg.is_protected = 0; 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 ); skc->d.elg.csum = checksum_mpi( skc->d.elg.x );
/* return an unprotected version of the skc */ /* return an unprotected version of the skc */
*ret_skc = copy_secret_cert( NULL, skc ); *ret_skc = copy_secret_cert( NULL, skc );
if( dek ) { if( dek ) {
skc->d.elg.protect_algo = CIPHER_ALGO_BLOWFISH; skc->d.elg.protect.algo = CIPHER_ALGO_BLOWFISH;
randomize_buffer(skc->d.elg.protect.blowfish.iv, 8, 1); 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 ); rc = protect_secret_key( skc, dek );
if( rc ) { if( rc ) {
log_error("protect_secret_key failed: %s\n", g10_errstr(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 #ifdef ENABLE_RSA_KEYGEN
static int static int
gen_rsa(unsigned nbits, KBNODE pub_root, KBNODE sec_root, DEK *dek, 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; int rc;
PACKET *pkt; PACKET *pkt;
@ -267,7 +270,7 @@ gen_rsa(unsigned nbits, KBNODE pub_root, KBNODE sec_root, DEK *dek,
static int static int
gen_dsa(unsigned nbits, KBNODE pub_root, KBNODE sec_root, DEK *dek, 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; return G10ERR_GENERAL;
} }
@ -289,6 +292,7 @@ generate_keypair()
KBNODE sec_root = NULL; KBNODE sec_root = NULL;
PKT_secret_cert *skc = NULL; PKT_secret_cert *skc = NULL;
DEK *dek = NULL; DEK *dek = NULL;
byte *salt;
int rc; int rc;
int algo; int algo;
const char *algo_name; const char *algo_name;
@ -499,9 +503,11 @@ generate_keypair()
tty_printf(_("You need a Passphrase to protect your secret key.\n\n") ); tty_printf(_("You need a Passphrase to protect your secret key.\n\n") );
dek = m_alloc_secure( sizeof *dek ); dek = m_alloc_secure( sizeof *dek );
salt = (byte*)dek + sizeof *dek;
for(;;) { for(;;) {
dek->algo = CIPHER_ALGO_BLOWFISH; 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 ) { if( rc == -1 ) {
m_free(dek); dek = NULL; m_free(dek); dek = NULL;
tty_printf(_( tty_printf(_(
@ -525,8 +531,8 @@ generate_keypair()
/* now check wether we a are allowed to write to the keyrings */ /* now check wether we a are allowed to write to the keyrings */
pub_fname = make_filename(opt.homedir, "pubring.g10", NULL ); pub_fname = make_filename(opt.homedir, "pubring.gpg", NULL );
sec_fname = make_filename(opt.homedir, "secring.g10", NULL ); sec_fname = make_filename(opt.homedir, "secring.gpg", NULL );
if( opt.verbose ) { if( opt.verbose ) {
tty_printf(_("writing public certificate to '%s'\n"), pub_fname ); tty_printf(_("writing public certificate to '%s'\n"), pub_fname );
tty_printf(_("writing secret certificate to '%s'\n"), sec_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") ); "number generator a better chance to gain enough entropy.\n") );
if( algo == PUBKEY_ALGO_ELGAMAL ) 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 #ifdef ENABLE_RSA_KEYGEN
else if( algo == PUBKEY_ALGO_RSA ) 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 #endif
else if( algo == PUBKEY_ALGO_DSA ) 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 else
BUG(); BUG();
if( !rc ) { if( !rc ) {
add_kbnode( pub_root, add_kbnode( pub_root,
make_comment_node("#created by G10 v" VERSION " (" make_comment_node("#created by GNUPG v" VERSION " ("
PRINTABLE_OS_NAME ")")); PRINTABLE_OS_NAME ")"));
add_kbnode( sec_root, add_kbnode( sec_root,
make_comment_node("#created by G10 v" VERSION " (" make_comment_node("#created by GNUPG v" VERSION " ("
PRINTABLE_OS_NAME ")")); PRINTABLE_OS_NAME ")"));
} }
if( !rc ) if( !rc )

View File

@ -1,14 +1,14 @@
/* keyid.c - jeyid and fingerprint handling /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* main.h /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* mainproc.c - handle packets /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
@ -189,7 +189,7 @@ proc_encrypted( CTX c, PACKET *pkt )
/* assume this is conventional encrypted data */ /* assume this is conventional encrypted data */
c->dek = m_alloc_secure( sizeof *c->dek ); c->dek = m_alloc_secure( sizeof *c->dek );
c->dek->algo = opt.def_cipher_algo; 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 ) else if( !c->dek )
result = G10ERR_NO_SECKEY; result = G10ERR_NO_SECKEY;

View File

@ -1,14 +1,14 @@
/* mdfilter.c - filter data and calculate a message digest /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* openfile.c /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
@ -81,7 +81,7 @@ overwrite_filep( const char *fname )
/**************** /****************
* Make an output filename for the inputfile INAME. * Make an output filename for the inputfile INAME.
* Returns an IOBUF * Returns an IOBUF
* Mode 0 = use ".g10" * Mode 0 = use ".gpg"
* 1 = use ".asc" * 1 = use ".asc"
* 2 = use ".sig" * 2 = use ".sig"
*/ */
@ -106,7 +106,7 @@ open_outfile( const char *iname, int mode )
else { else {
buf = m_alloc(strlen(iname)+4+1); buf = m_alloc(strlen(iname)+4+1);
strcpy(stpcpy(buf,iname), mode==1 ? ".asc" : strcpy(stpcpy(buf,iname), mode==1 ? ".asc" :
mode==2 ? ".sig" : ".g10"); mode==2 ? ".sig" : ".gpg");
name = buf; name = buf;
} }
if( !(rc=overwrite_filep( name )) ) { if( !(rc=overwrite_filep( name )) ) {

View File

@ -1,14 +1,14 @@
/* options.h /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* packet.h - packet read/write stuff /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
@ -127,15 +127,16 @@ typedef struct {
MPI x; /* secret exponent */ MPI x; /* secret exponent */
u16 csum; /* checksum */ u16 csum; /* checksum */
byte is_protected; /* The above infos are protected and must */ byte is_protected; /* The above infos are protected and must */
/* be decrypteded before use */ /* be decrypteded before use. */
byte protect_algo; /* cipher used to protect the secret informations*/ struct {
union { /* information for the protection */ byte algo; /* cipher used to protect the secret informations*/
struct { byte s2k;
byte iv[8]; /* initialization vector for CFB mode */ byte hash;
/* when protected, the MPIs above are pointers byte salt[8];
byte count;
byte iv[8]; /* initialization vector for CFB mode */
} protect; /* when protected, the MPIs above are pointers
* to plain storage */ * to plain storage */
} blowfish;
} protect;
} elg; } elg;
struct { struct {
MPI rsa_n; /* public modulus */ MPI rsa_n; /* public modulus */

View File

@ -1,14 +1,14 @@
/* parse-packet.c - read packets /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
@ -591,6 +591,7 @@ parse_certificate( IOBUF inp, int pkttype, unsigned long pktlen,
unsigned long timestamp; unsigned long timestamp;
unsigned short valid_period; unsigned short valid_period;
int is_v4=0; int is_v4=0;
int rc=0;
if( pktlen < 12 ) { 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.p = elg_p;
pkt->pkt.secret_cert->d.elg.g = elg_g; pkt->pkt.secret_cert->d.elg.g = elg_g;
pkt->pkt.secret_cert->d.elg.y = elg_y; pkt->pkt.secret_cert->d.elg.y = elg_y;
cert->d.elg.protect_algo = iobuf_get_noeof(inp); pktlen--; cert->d.elg.protect.algo = iobuf_get_noeof(inp); pktlen--;
if( list_mode ) if( cert->d.elg.protect.algo ) {
printf( "\tprotect algo: %d\n", cert->d.elg.protect_algo);
if( cert->d.elg.protect_algo ) {
cert->d.elg.is_protected = 1; 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-- ) for(i=0; i < 8 && pktlen; i++, pktlen-- )
temp[i] = iobuf_get_noeof(inp); temp[i] = iobuf_get_noeof(inp);
if( list_mode ) { if( list_mode ) {
@ -671,8 +740,7 @@ parse_certificate( IOBUF inp, int pkttype, unsigned long pktlen,
printf(" %02x", temp[i] ); printf(" %02x", temp[i] );
putchar('\n'); putchar('\n');
} }
if( cert->d.elg.protect_algo == CIPHER_ALGO_BLOWFISH ) memcpy(cert->d.elg.protect.iv, temp, 8 );
memcpy(cert->d.elg.protect.blowfish.iv, temp, 8 );
} }
else else
cert->d.elg.is_protected = 0; cert->d.elg.is_protected = 0;
@ -758,7 +826,7 @@ parse_certificate( IOBUF inp, int pkttype, unsigned long pktlen,
leave: leave:
skip_rest(inp, pktlen); skip_rest(inp, pktlen);
return 0; return rc;
} }

View File

@ -1,14 +1,14 @@
/* passphrase.c - Get a passphrase /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
@ -33,7 +33,7 @@
static int pwfd = -1; static int pwfd = -1;
static int hash_passphrase( DEK *dek, char *pw ); static int hash_passphrase( DEK *dek, char *pw, byte *salt );
void void
set_passphrase_fd( int fd ) set_passphrase_fd( int fd )
@ -54,7 +54,7 @@ get_passphrase_fd()
* Returns: m_alloced md5 passphrase hash; caller must free * Returns: m_alloced md5 passphrase hash; caller must free
*/ */
DEK * DEK *
get_passphrase_hash( u32 *keyid, char *text ) get_passphrase_hash( u32 *keyid, char *text, byte *salt )
{ {
char *pw; char *pw;
DEK *dek; DEK *dek;
@ -97,8 +97,8 @@ get_passphrase_hash( u32 *keyid, char *text )
tty_kill_prompt(); tty_kill_prompt();
} }
dek = m_alloc_secure( sizeof *dek ); dek = m_alloc_secure( sizeof *dek );
dek->algo = CIPHER_ALGO_BLOWFISH; dek->algo = CIPHER_ALGO_BLOWFISH; /* fixme: allow others ciphers */
if( hash_passphrase( dek, pw ) ) if( hash_passphrase( dek, pw, salt ) )
log_bug("get_passphrase_hash\n"); log_bug("get_passphrase_hash\n");
m_free(pw); /* is allocated in secure memory, so it will be burned */ m_free(pw); /* is allocated in secure memory, so it will be burned */
return dek; 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. * 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 * Returns: 0 = okay, -1 No passphrase entered, > 0 error
*/ */
int int
make_dek_from_passphrase( DEK *dek, int mode ) make_dek_from_passphrase( DEK *dek, int mode, byte *salt )
{ {
char *pw, *pw2; char *pw, *pw2;
int rc=0; int rc=0;
@ -131,14 +132,14 @@ make_dek_from_passphrase( DEK *dek, int mode )
if( !*pw ) if( !*pw )
rc = -1; rc = -1;
else else
rc = hash_passphrase( dek, pw ); rc = hash_passphrase( dek, pw, salt );
m_free(pw); m_free(pw);
return rc; return rc;
} }
static int static int
hash_passphrase( DEK *dek, char *pw ) hash_passphrase( DEK *dek, char *pw, byte *salt )
{ {
int rc = 0; int rc = 0;
@ -147,6 +148,8 @@ hash_passphrase( DEK *dek, char *pw )
MD_HANDLE md; MD_HANDLE md;
md = md_open(DIGEST_ALGO_RMD160, 1); md = md_open(DIGEST_ALGO_RMD160, 1);
if( salt )
md_write( md, salt, 8 );
md_write( md, pw, strlen(pw) ); md_write( md, pw, strlen(pw) );
md_final( md ); md_final( md );
dek->keylen = 20; dek->keylen = 20;

View File

@ -1,14 +1,14 @@
/* pkclist.c /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* plaintext.c - process an plaintext packet /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* pubkey-enc.c - public key encoded packet handling /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* revoke.c /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* ringedit.c - Function for key ring editing /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
@ -888,12 +888,18 @@ keyring_copy( KBPOS *kbpos, int mode, KBNODE root )
} }
} }
/* rename and make backup file */ /* rename and make backup file */
#if __MINGW32__
remove( bakfname );
#endif
if( rename( rentry->fname, bakfname ) ) { if( rename( rentry->fname, bakfname ) ) {
log_error("%s: rename to %s failed: %s\n", log_error("%s: rename to %s failed: %s\n",
rentry->fname, bakfname, strerror(errno) ); rentry->fname, bakfname, strerror(errno) );
rc = G10ERR_RENAME_FILE; rc = G10ERR_RENAME_FILE;
goto leave; goto leave;
} }
#if __MINGW32__
remove( rentry->fname );
#endif
if( rename( tmpfname, rentry->fname ) ) { if( rename( tmpfname, rentry->fname ) ) {
log_error("%s: rename to %s failed: %s\n", log_error("%s: rename to %s failed: %s\n",
tmpfname, rentry->fname,strerror(errno) ); tmpfname, rentry->fname,strerror(errno) );

View File

@ -1,14 +1,14 @@
/* rsa.c /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* seckey-cert.c - secret key certifucate packet handling /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
@ -72,21 +72,27 @@ check_elg( PKT_secret_cert *cert )
MPI test_x; MPI test_x;
BLOWFISH_context *blowfish_ctx=NULL; 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_NONE: BUG(); break;
case CIPHER_ALGO_BLOWFISH: case CIPHER_ALGO_BLOWFISH:
keyid_from_skc( cert, keyid ); 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_ctx = m_alloc_secure( sizeof *blowfish_ctx );
blowfish_setkey( blowfish_ctx, dek->key, dek->keylen ); blowfish_setkey( blowfish_ctx, dek->key, dek->keylen );
m_free(dek); /* pw is in secure memory, so m_free() burns it */ m_free(dek); /* pw is in secure memory, so m_free() burns it */
blowfish_setiv( blowfish_ctx, NULL ); 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, blowfish_decode_cfb( blowfish_ctx,
cert->d.elg.protect.blowfish.iv, cert->d.elg.protect.iv,
cert->d.elg.protect.blowfish.iv, 8 ); cert->d.elg.protect.iv, 8 );
mpi_set_secure(cert->d.elg.x ); 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 */ * new get_buffer_secure() function */
buffer = mpi_get_buffer( cert->d.elg.x, &nbytes, NULL ); buffer = mpi_get_buffer( cert->d.elg.x, &nbytes, NULL );
csum = checksum_u16( nbytes*8 ); 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 */ /* now let's see wether we have used the right passphrase */
if( csum != cert->d.elg.csum ) { if( csum != cert->d.elg.csum ) {
mpi_free(test_x); 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; return G10ERR_BAD_PASS;
} }
@ -111,7 +117,7 @@ check_elg( PKT_secret_cert *cert )
memset( &skey, 0, sizeof skey ); memset( &skey, 0, sizeof skey );
if( !res ) { if( !res ) {
mpi_free(test_x); 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; return G10ERR_BAD_PASS;
} }
mpi_set(cert->d.elg.x, test_x); 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 */ if( !cert->d.elg.is_protected ) { /* add the protection */
BLOWFISH_context *blowfish_ctx=NULL; 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_NONE: BUG(); break;
case CIPHER_ALGO_BLOWFISH: case CIPHER_ALGO_BLOWFISH:
blowfish_ctx = m_alloc_secure( sizeof *blowfish_ctx ); blowfish_ctx = m_alloc_secure( sizeof *blowfish_ctx );
blowfish_setkey( blowfish_ctx, dek->key, dek->keylen ); blowfish_setkey( blowfish_ctx, dek->key, dek->keylen );
blowfish_setiv( blowfish_ctx, NULL ); blowfish_setiv( blowfish_ctx, NULL );
blowfish_encode_cfb( blowfish_ctx, blowfish_encode_cfb( blowfish_ctx,
cert->d.elg.protect.blowfish.iv, cert->d.elg.protect.iv,
cert->d.elg.protect.blowfish.iv, 8 ); cert->d.elg.protect.iv, 8 );
buffer = mpi_get_buffer( cert->d.elg.x, &nbytes, NULL ); buffer = mpi_get_buffer( cert->d.elg.x, &nbytes, NULL );
blowfish_encode_cfb( blowfish_ctx, buffer, buffer, nbytes ); blowfish_encode_cfb( blowfish_ctx, buffer, buffer, nbytes );
mpi_set_buffer( cert->d.elg.x, buffer, nbytes, 0 ); mpi_set_buffer( cert->d.elg.x, buffer, nbytes, 0 );
@ -296,7 +302,7 @@ int
is_secret_key_protected( PKT_secret_cert *cert ) is_secret_key_protected( PKT_secret_cert *cert )
{ {
if( cert->pubkey_algo == PUBKEY_ALGO_ELGAMAL ) 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 #ifdef HAVE_RSA_CIPHER
else if( cert->pubkey_algo == PUBKEY_ALGO_RSA ) else if( cert->pubkey_algo == PUBKEY_ALGO_RSA )
return cert->d.rsa.is_protected? cert->d.rsa.protect_algo : 0; 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 ) if( cert->pubkey_algo == PUBKEY_ALGO_ELGAMAL )
return protect_elg( cert, dek ); 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 else
return G10ERR_PUBKEY_ALGO; return G10ERR_PUBKEY_ALGO;
} }

View File

@ -1,14 +1,14 @@
/* seskey.c - make sesssion keys etc. /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* sig-check.c - Check a signature /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* sign.c - sign data /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
@ -152,7 +152,7 @@ sign_file( STRLIST filenames, int detached, STRLIST locusr,
if( opt.armor && !outfile ) if( opt.armor && !outfile )
iobuf_push_filter( out, armor_filter, &afx ); 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 ")"); PRINTABLE_OS_NAME ")");
if( opt.compress && !outfile ) if( opt.compress && !outfile )
iobuf_push_filter( out, compress_filter, &zfx ); iobuf_push_filter( out, compress_filter, &zfx );
@ -916,13 +916,15 @@ change_passphrase( const char *username )
if( rc ) if( rc )
tty_printf("Can't edit this key: %s\n", g10_errstr(rc)); tty_printf("Can't edit this key: %s\n", g10_errstr(rc));
else { 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" ); tty_printf( "Enter the new passphrase for this secret key.\n\n" );
for(;;) { for(;;) {
dek->algo = CIPHER_ALGO_BLOWFISH; 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 ) { if( rc == -1 ) {
rc = 0; rc = 0;
tty_printf( "You don't want a passphrase -" tty_printf( "You don't want a passphrase -"
@ -943,8 +945,11 @@ change_passphrase( const char *username )
break; break;
} }
else { /* okay */ else { /* okay */
skc->d.elg.protect_algo = CIPHER_ALGO_BLOWFISH; skc->d.elg.protect.algo = CIPHER_ALGO_BLOWFISH;
randomize_buffer(skc->d.elg.protect.blowfish.iv, 8, 1); 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 ); rc = protect_secret_key( skc, dek );
if( rc ) if( rc )
log_error("protect_secret_key failed: %s\n", g10_errstr(rc) ); log_error("protect_secret_key failed: %s\n", g10_errstr(rc) );

View File

@ -1,14 +1,14 @@
/* skclist.c /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* status.c /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* status.h /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* textfilter.c /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* trustdb.c /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * 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) ); log_fatal("can't create %s: %s\n", fname, strerror(errno) );
fwrite_8( fp, 1 ); fwrite_8( fp, 1 );
fwrite_8( fp, 'g' ); fwrite_8( fp, 'g' );
fwrite_8( fp, '1' ); fwrite_8( fp, 'p' );
fwrite_8( fp, '0' ); fwrite_8( fp, 'g' );
fwrite_8( fp, 1 ); /* version */ fwrite_8( fp, 1 ); /* version */
fwrite_zeros( fp, 3 ); /* reserved */ fwrite_zeros( fp, 3 ); /* reserved */
fwrite_32( fp, 0 ); /* not locked */ fwrite_32( fp, 0 ); /* not locked */
@ -451,7 +451,8 @@ read_record( ulong recnum, TRUSTREC *rec, int expected )
case 0: /* unused record */ case 0: /* unused record */
break; break;
case RECTYPE_VER: /* version record */ 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 ); log_error("%s: not a trustdb file\n", db_name );
rc = G10ERR_TRUSTDB; rc = G10ERR_TRUSTDB;
} }
@ -1510,7 +1511,7 @@ init_trustdb( int level, const char *dbname )
if( !level || level==1 ) { if( !level || level==1 ) {
char *fname = dbname? m_strdup( dbname ) 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( access( fname, R_OK ) ) {
if( errno != ENOENT ) { if( errno != ENOENT ) {
log_error("can't access %s: %s\n", fname, strerror(errno) ); log_error("can't access %s: %s\n", fname, strerror(errno) );
@ -1522,7 +1523,11 @@ init_trustdb( int level, const char *dbname )
assert(p); assert(p);
*p = 0; *p = 0;
if( access( fname, F_OK ) ) { if( access( fname, F_OK ) ) {
#if __MINGW32__
if( mkdir( fname ) )
#else
if( mkdir( fname, S_IRUSR|S_IWUSR|S_IXUSR ) ) if( mkdir( fname, S_IRUSR|S_IWUSR|S_IXUSR ) )
#endif
log_fatal("can't create directory '%s': %s\n", log_fatal("can't create directory '%s': %s\n",
fname, strerror(errno) ); fname, strerror(errno) );
} }
@ -1974,7 +1979,7 @@ int
verify_private_data() verify_private_data()
{ {
int rc = 0; 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( access( sigfile, R_OK ) ) {
if( errno != ENOENT ) { if( errno != ENOENT ) {
@ -2002,8 +2007,8 @@ int
sign_private_data() sign_private_data()
{ {
int rc; int rc;
char *sigfile = make_filename(opt.homedir, "g10.sig", NULL ); char *sigfile = make_filename(opt.homedir, "gnupg.sig", NULL );
char *secring = make_filename(opt.homedir, "secring.g10", NULL ); char *secring = make_filename(opt.homedir, "secring.gpg", NULL );
STRLIST list = NULL; STRLIST list = NULL;
add_to_strlist( &list, db_name ); add_to_strlist( &list, db_name );

View File

@ -1,14 +1,14 @@
/* trustdb.h - Trust database /* 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -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) Mon Feb 16 13:00:27 1998 Werner Koch (wk@isil.d.shuttle.de)
* config.links : Add detection of m68k cpus * config.links : Add detection of m68k cpus

View File

@ -2,16 +2,16 @@
* sum in a third limb vector. * sum in a third limb vector.
* *
* Copyright (C) 1995 Free Software Foundation, Inc. * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,15 +1,15 @@
/* alpha rshift, lshift /* alpha rshift, lshift
* Copyright (C) 1994, 1995 Free Software Foundation, Inc. * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -2,16 +2,16 @@
* sum in a third limb vector. * sum in a third limb vector.
* *
* Copyright (C) 1992, 1994 Free Software Foundation, Inc. * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,15 +1,15 @@
/* hppa rshift, lshift /* hppa rshift, lshift
* Copyright (C) 1992, 1994 Free Software Foundation, Inc. * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,16 +1,16 @@
/* hppa sub_n -- Sub two limb vectors of the same length > 0 and store /* hppa sub_n -- Sub two limb vectors of the same length > 0 and store
* sum in a third limb vector. * sum in a third limb vector.
* Copyright (C) 1992, 1994 Free Software Foundation, Inc. * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,16 +1,16 @@
/* hppa1.1 mul_1 -- Multiply a limb vector with a limb and store /* hppa1.1 mul_1 -- Multiply a limb vector with a limb and store
* the result in a second limb vector. * the result in a second limb vector.
* Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,16 +1,16 @@
/* hppa1.1 addmul_1 -- Multiply a limb vector with a limb and add /* hppa1.1 addmul_1 -- Multiply a limb vector with a limb and add
* the result to a second limb vector. * the result to a second limb vector.
* Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,16 +1,16 @@
/* hppa1.1 submul_1 -- Multiply a limb vector with a limb and add /* hppa1.1 submul_1 -- Multiply a limb vector with a limb and add
* the result to a second limb vector. * the result to a second limb vector.
* Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -2,16 +2,16 @@
* This version runs fast on PA 7000 and later. * This version runs fast on PA 7000 and later.
* *
* Copyright (C) 1993, 1994 Free Software Foundation, Inc. * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -2,16 +2,16 @@
* sum in a third limb vector. * sum in a third limb vector.
* *
* Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc. * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,16 +1,16 @@
/* i80386 mul_1 -- Multiply a limb vector with a limb and store /* i80386 mul_1 -- Multiply a limb vector with a limb and store
* the result in a second limb vector. * 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. * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,16 +1,16 @@
/* i80386 addmul_1 -- Multiply a limb vector with a limb and add /* i80386 addmul_1 -- Multiply a limb vector with a limb and add
* the result to a second limb vector. * 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. * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,16 +1,16 @@
/* i80386 submul_1 -- Multiply a limb vector with a limb and add /* i80386 submul_1 -- Multiply a limb vector with a limb and add
* the result to a second limb vector. * 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. * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

View File

@ -1,15 +1,15 @@
/* i80386 rshift, lshift /* 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. * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.

Some files were not shown because too many files have changed in this diff Show More