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)
* Makefile.am (checks): New.

11
INSTALL
View File

@ -1,8 +1,8 @@
Please read the Basic Installation section somewhere below.
Configure options for G10
=========================
Configure options for GNUPG
===========================
--with-zlib Forces usage of the local zlib sources. Default is
to use the (sahred) library of the system.
@ -37,11 +37,10 @@ Don't forget to delete "config.cache" and run "./config.status --recheck".
Installation
============
G10 is not installed as suid:root; if you want to use it, do it manually
(only g10, not g10maint).
pgp is not installed as suid:root; if you want to do it, do it manually.
You have to create the ~/.g10 directory manually. Your first action after
this should be to create a key pair: "g10 --gen-key".
The ~/.gpg directory will be created if it does not exist. Your first
action should be to create a key pair: "gpg --gen-key".

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

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.
IT MAY HAPPEN THAT SOME DATA FORMATS OR PROGRAMM OPTIONS
@ -8,16 +8,16 @@
On a Linux box (version 2.x.x, alpha or x86 CPU) it should
work reliable. You may create your key on such a machine and
use it. Please verify the tar file; there is a PGP and a G10
use it. Please verify the tar file; there is a PGP and a GNUPG
signature available. My PGP key is well known and published in
the "Global Trust Register for 1998", ISBN 0-9532397-0-5.
I have included my pubring as "g10/pubring.10", which contains
the key used to make G10 signatures:
I have included my pubring as "g10/pubring.asc", which contains
the key used to make GNUPG signatures:
"pub 1312G/FF3EAA0B 1998-02-09 Werner Koch <wk@isil.d.shuttle.de>"
"Key fingerprint = 8489 6CD0 1851 0E33 45DA CD67 036F 11B8 FF3E AA0B"
You may add it to your G10 pubring and use it in the future to
You may add it to your GNUPG pubring and use it in the future to
verify new releases. Because you verified the tar file containing
this file here, you can be sure that the above fingerprint is correct.
@ -27,20 +27,20 @@
See the file COPYING for copyright and warranty information.
Due to the fact that G10 does not use use any patented algorithm,
Due to the fact that GNUPG does not use use any patented algorithm,
it cannot be compatible to old PGP versions, because those use
IDEA (which is worldwide patented) and RSA (which is patented in
the United States until Sep 20, 2000). I'm sorry about this, but
this is the world we have created (e.g. by using proprietary software).
Because the OpenPGP standard is still a draft, G10 is not yet
Because the OpenPGP standard is still a draft, GNUPG is not yet
compatible to it (or PGP 5) - but it will. The data structures
used are compatible with PGP 2.x, so it can parse an list such files
and PGP should be able to parse data created by G10 and complain
and PGP should be able to parse data created by GNUPG and complain
about unsupported algorithms.
The default algorithms used by G10 are ElGamal for public-key
The default algorithms used by GNUPG are ElGamal for public-key
encryption and signing; Blowfish with a 160 bit key for protecting
the secret-key components, conventional and session encryption;
RIPE MD-160 to create message digest. DSA, SHA-1 and CAST are
@ -61,19 +61,16 @@
3) "make install"
4) You end up with a binary "g10" in /usr/local/bin
5) Optional, but suggested: install the program "g10" as suid root.
6) Create a directory ".g10" under your home directory ("mkdir ~/.g10")
4) You end up with a binary "gpg" in /usr/local/bin
5) Optional, but suggested: install the program "gpg" as suid root.
Key Generation
--------------
g10 --gen-key
gpg --gen-key
This asks some questions and then starts key generation. To create
good random numbers for prime number generation, it uses a /dev/random
@ -112,7 +109,7 @@
You should make a revocation certificate in cases someone gets
knowledge of your secret key or you forgot your passphrase:
g10 --gen-revoke your_user_id
gpg --gen-revoke your_user_id
Run this command and store it away; output is always ASCII armored,
so that you can print it and (hopefully never) re-create it if
@ -121,11 +118,11 @@
You can sign a key with this command:
g10 --sign-key Donald
gpg --sign-key Donald
This let you sign the key of "Donald" with your default userid.
g10 --sign-key -u Karl -u Joe Donald
gpg --sign-key -u Karl -u Joe Donald
This let you sign the key of of "Donald" with the userids of "Karl"
and "Joe".
@ -142,16 +139,16 @@
Sign
----
g10 -s file
gpg -s file
This creates a file file.g10 which is compressed and has a signature
This creates a file file.gpg which is compressed and has a signature
attached.
g10 -sa file
gpg -sa file
Same as above, but file.g10 is ascii armored.
Same as above, but file.gpg is ascii armored.
g10 -s -o out file
gpg -s -o out file
Creates a signature of file, but writes the output to the file "out".
@ -159,12 +156,12 @@
Encrypt
-------
g10 -e -r heine file
gpg -e -r heine file
This encrypts files with the public key of "heine" and writes it
to "file.g10"
to "file.gpg"
echo "hallo" | g10 -ea -r heine | mail heine
echo "hallo" | gpg -ea -r heine | mail heine
Ditto, but encrypts "hallo\n" and mails it as ascii armored message.
@ -172,13 +169,13 @@
Sign and Encrypt
----------------
g10 -se -r heine file
gpg -se -r heine file
This encrypts files with the public key of "heine" and writes it
to "file.g10" after signing it with the default user id.
to "file.gpg" after signing it with the default user id.
g10 -se -r heine -u Suttner file
gpg -se -r heine -u Suttner file
Ditto, but sign the file with the user id "Suttner"
@ -187,17 +184,17 @@
------------------
To export your complete keyring(s) do this:
g10 --export
gpg --export
To export only some user ids do this:
g10 --export userids
gpg --export userids
Use "-a" or "--armor" to create ASCII armored output.
Importing keys is done with the option, you guessed it, "--import":
g10 --import [filenames]
gpg --import [filenames]
New keys are appended to the default keyring and already existing
keys are merged. Keys without a self-signature are ignored.
@ -243,7 +240,7 @@
"#34"
This can be used by a MUA to specify an exact key after selecting
a key from G10 (by the use of a special option or an extra utility)
a key from GNUPG (by the use of a special option or an extra utility)
* Or by the usual substring:
@ -258,19 +255,19 @@
Batch mode
----------
If you use the option "--batch", G10 runs in non-interactive mode and
If you use the option "--batch", GNUPG runs in non-interactive mode and
never prompts for input data. This even does not allow to enter
passphrase; until we have a better solution (something like ssh-agent),
you can use the option "--passhrase-fd n", which works like PGPs
PGPPASSFD.
Batch mode also causes G10 to terminate as soon as a BAD signature is
Batch mode also causes GNUPG to terminate as soon as a BAD signature is
detected.
Exit status
-----------
G10 returns with an exit status of 1 if in batch mode and a bad signature
GNUPG returns with an exit status of 1 if in batch mode and a bad signature
has been detected or 2 or higher for all other errors. You should parse
stderr to get detailed informations about the errors.
@ -278,26 +275,26 @@
Esoteric commands
-----------------
g10 --list-packets datafile
gpg --list-packets datafile
Use this to list the contents of a data file. If the file is encrypted
you are asked for the passphrase, so that G10 is able to look at the
you are asked for the passphrase, so that GNUPG is able to look at the
inner structure of a encrypted packet.
g10maint --quick-random
gpgm --quick-random
Do not use the stroing random generator but a faster one. This can be
used to generate keys for tests; those are marked as insecure.
g10maint --list-trustdb
gpgm --list-trustdb
List the contents of the trustdb in a human readable format
g10maint --list-trustdb <usernames>
gpgm --list-trustdb <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
depth. If depth is negative, duplicate introducers are not listed,
@ -306,25 +303,25 @@
using a negative number). This option may create new entries in the
trustdb.
g10maint --print-mds filenames
gpgm --print-mds filenames
List all available message digest values for the fiven filenames
g10maint --gen-prime n
gpgm --gen-prime n
Generate and print a simple prime number of size n
g10maint --gen-prime n q
gpgm --gen-prime n q
Generate a prime number suitable for ElGamal signatures of size n with
a q as largest primefactor of n-1.
g10maint --gen-prime n q 1
gpgm --gen-prime n q 1
Ditto, but calculate a generator too.
For more options/commands see the file g10/OPTIONS, or use "g10 --help"
For more options/commands see the file g10/OPTIONS, or use "gpg --help"
Debug Flags
@ -354,12 +351,12 @@
but for now I stick to my own formatting rules.
The primary FTP site is "ftp://ftp.guug.de/pub/gcrypt/"
The primary WWW page is "http://www.d.shuttle.de/isil/crypt/g10.html"
The primary WWW page is "http://www.d.shuttle.de/isil/crypt/gnupg.html"
If you like, send your keys to <g10-keys@isil.d.shuttle.de>; use
"g10 --export --armor | mail g10-keys@isil.d.shuttle.de" to do this.
If you like, send your keys to <gnupg-keys@isil.d.shuttle.de>; use
"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>.

2
TODO
View File

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

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
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -2,7 +2,7 @@
TESTS = checkit
TEST_FILES = pubring.asc secring.asc plain-1 plain-2 plain-3o.asc \
TEST_FILES = pubring.asc secring.asc gnupg.asc plain-1 plain-2 plain-3o.asc \
plain-1.asc plain-2.asc plain-3.asc
EXTRA_DIST = $(TESTS) $(TEST_FILES)

View File

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

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)
* md.c, md.h : New debugging support

View File

@ -1,18 +1,18 @@
/* blowfish.c - Blowfish encryption
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* For a description of the algorithm, see:
* Bruce Schneier: Applied Cryptography. John Wiley & Sons, 1996.
* ISBN 0-471-11709-9. Pages 336 ff.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* blowfish.h
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* cast5.c - CAST5 cipher (RFC2144)
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* cast5.h
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* dsa.c - DSA signature scheme
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* dsa.h - DSA signature scheme
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,18 +1,18 @@
/* elgamal.c - ElGamal Public Key encryption
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* For a description of the algorithm, see:
* Bruce Schneier: Applied Cryptography. John Wiley & Sons, 1996.
* ISBN 0-471-11709-9. Pages 476 ff.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* elgamal.h
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,18 +1,18 @@
/* gost.c - GOST encryption
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* The description of GOST (and the used S-boxes) are taken from:
* Bruce Schneier: Applied Cryptography. John Wiley & Sons, 1996.
* ISBN 0-471-11709-9. .
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* gost.h
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* md.c - message digest dispatcher
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* md.h - digest functions
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,51 +1,25 @@
/* md5.c - MD5 Message-Digest Algorithm
* Copyright (c) 1994 by Werner Koch (dd9jn)
* Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc.
*
* This is a hacked version from WkLib
* according to the definition of MD5 in RFC 1321 from April 1992.
* NOTE: This is *not* the same file as the one from glibc.
*
* This file is part of WkLib.
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2, or (at your option) any
* later version.
*
* WkLib is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* WkLib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
***********************************************************************
** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. **
** **
** License to copy and use this software is granted provided that **
** it is identified as the "RSA Data Security, Inc. MD5 Message- **
** Digest Algorithm" in all material mentioning or referencing this **
** software or this function. **
** **
** License is also granted to make and use derivative works **
** provided that such works are identified as "derived from the RSA **
** Data Security, Inc. MD5 Message-Digest Algorithm" in all **
** material mentioning or referencing the derived work. **
** **
** RSA Data Security, Inc. makes no representations concerning **
** either the merchantability of this software or the suitability **
** of this software for any particular purpose. It is provided "as **
** is" without express or implied warranty of any kind. **
** **
** These notices must be retained in any copies of any part of this **
** documentation and/or software. **
***********************************************************************
*
* History:
* 16.01.95 wk now uses generic base-64 support
* 24.01.95 wk changed back to original base-64 coding, because
* the generic base-64 support was changed to go conform
* with RFC1113 !
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. */
/* modified for GNUPG by <werner.koch@guug.de> */
/* Test values:
* "" D4 1D 8C D9 8F 00 B2 04 E9 80 09 98 EC F8 42 7E
@ -64,128 +38,245 @@
#include "memory.h"
#if __WATCOMC__ && defined(M_I86)
/* 16-Bit Compiler breaks Code in Function Transform() */
/* (at least when compiling for windows) */
#ifndef __SW_OD
#error must be compiled without optimizations
#endif
#endif
static void Transform(u32 *buf,u32 *in);
static byte PADDING[64] = {
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* F, G, H and I are basic MD5 functions */
#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
#define G(x, y, z) (((x) & (z)) | ((y) & (~z)))
#define H(x, y, z) ((x) ^ (y) ^ (z))
#define I(x, y, z) ((y) ^ ((x) | (~z)))
/* ROTATE_LEFT rotates x left n bits */
#if defined(__GNUC__) && defined(__i386__)
static inline u32
ROTATE_LEFT(u32 x, int n)
{
__asm__("roll %%cl,%0"
:"=r" (x)
:"0" (x),"c" (n));
return x;
}
#ifdef BIG_ENDIAN_HOST
#define SWAP(n) \
(((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
#else
#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
#define SWAP(n) (n)
#endif
/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4 */
/* Rotation is separate from addition to prevent recomputation */
#define FF(a, b, c, d, x, s, ac) \
{(a) += F ((b), (c), (d)) + (x) + (u32)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
#define GG(a, b, c, d, x, s, ac) \
{(a) += G ((b), (c), (d)) + (x) + (u32)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
#define HH(a, b, c, d, x, s, ac) \
{(a) += H ((b), (c), (d)) + (x) + (u32)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
#define II(a, b, c, d, x, s, ac) \
{(a) += I ((b), (c), (d)) + (x) + (u32)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
/* This array contains the bytes used to pad the buffer to the next
64-byte boundary. (RFC 1321, 3.1: Step 1) */
static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ };
void
md5_init( MD5_CONTEXT *mdContext)
md5_init( MD5_CONTEXT *ctx )
{
mdContext->i[0] = mdContext->i[1] = (u32)0;
/* Load magic initialization constants.
*/
mdContext->buf[0] = (u32)0x67452301L;
mdContext->buf[1] = (u32)0xefcdab89L;
mdContext->buf[2] = (u32)0x98badcfeL;
mdContext->buf[3] = (u32)0x10325476L;
mdContext->count = 0;
ctx->A = 0x67452301;
ctx->B = 0xefcdab89;
ctx->C = 0x98badcfe;
ctx->D = 0x10325476;
ctx->total[0] = ctx->total[1] = 0;
ctx->buflen = 0;
}
/* The routine Update updates the message-digest context to
/* These are the four functions used in the four steps of the MD5 algorithm
and defined in the RFC 1321. The first function is a little bit optimized
(as found in Colin Plumbs public domain implementation). */
/* #define FF(b, c, d) ((b & c) | (~b & d)) */
#define FF(b, c, d) (d ^ (b & (c ^ d)))
#define FG(b, c, d) FF (d, b, c)
#define FH(b, c, d) (b ^ c ^ d)
#define FI(b, c, d) (c ^ (b | ~d))
/****************
* transform n*64 bytes
*/
static void
transform( MD5_CONTEXT *ctx, const void *buffer, size_t len )
{
u32 correct_words[16];
const u32 *words = buffer;
size_t nwords = len / sizeof(u32);
const u32 *endp = words + nwords;
u32 A = ctx->A;
u32 B = ctx->B;
u32 C = ctx->C;
u32 D = ctx->D;
/* First increment the byte count. RFC 1321 specifies the possible
length of the file up to 2^64 bits. Here we only compute the
number of bytes. Do a double word increment. */
ctx->total[0] += len;
if( ctx->total[0] < len )
++ctx->total[1];
/* Process all bytes in the buffer with 64 bytes in each round of
the loop. */
while(words < endp) {
u32 *cwp = correct_words;
u32 A_save = A;
u32 B_save = B;
u32 C_save = C;
u32 D_save = D;
/* First round: using the given function, the context and a constant
the next context is computed. Because the algorithms processing
unit is a 32-bit word and it is determined to work on words in
little endian byte order we perhaps have to change the byte order
before the computation. To reduce the work for the next steps
we store the swapped words in the array CORRECT_WORDS. */
#define OP(a, b, c, d, s, T) \
do \
{ \
a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \
++words; \
CYCLIC (a, s); \
a += b; \
} \
while (0)
/* It is unfortunate that C does not provide an operator for
cyclic rotation. Hope the C compiler is smart enough. */
#define CYCLIC(w, s) (w = (w << s) | (w >> (32 - s)))
/* Before we start, one word to the strange constants.
They are defined in RFC 1321 as
T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64
*/
/* Round 1. */
OP (A, B, C, D, 7, 0xd76aa478);
OP (D, A, B, C, 12, 0xe8c7b756);
OP (C, D, A, B, 17, 0x242070db);
OP (B, C, D, A, 22, 0xc1bdceee);
OP (A, B, C, D, 7, 0xf57c0faf);
OP (D, A, B, C, 12, 0x4787c62a);
OP (C, D, A, B, 17, 0xa8304613);
OP (B, C, D, A, 22, 0xfd469501);
OP (A, B, C, D, 7, 0x698098d8);
OP (D, A, B, C, 12, 0x8b44f7af);
OP (C, D, A, B, 17, 0xffff5bb1);
OP (B, C, D, A, 22, 0x895cd7be);
OP (A, B, C, D, 7, 0x6b901122);
OP (D, A, B, C, 12, 0xfd987193);
OP (C, D, A, B, 17, 0xa679438e);
OP (B, C, D, A, 22, 0x49b40821);
/* For the second to fourth round we have the possibly swapped words
in CORRECT_WORDS. Redefine the macro to take an additional first
argument specifying the function to use. */
#undef OP
#define OP(f, a, b, c, d, k, s, T) \
do \
{ \
a += f (b, c, d) + correct_words[k] + T; \
CYCLIC (a, s); \
a += b; \
} \
while (0)
/* Round 2. */
OP (FG, A, B, C, D, 1, 5, 0xf61e2562);
OP (FG, D, A, B, C, 6, 9, 0xc040b340);
OP (FG, C, D, A, B, 11, 14, 0x265e5a51);
OP (FG, B, C, D, A, 0, 20, 0xe9b6c7aa);
OP (FG, A, B, C, D, 5, 5, 0xd62f105d);
OP (FG, D, A, B, C, 10, 9, 0x02441453);
OP (FG, C, D, A, B, 15, 14, 0xd8a1e681);
OP (FG, B, C, D, A, 4, 20, 0xe7d3fbc8);
OP (FG, A, B, C, D, 9, 5, 0x21e1cde6);
OP (FG, D, A, B, C, 14, 9, 0xc33707d6);
OP (FG, C, D, A, B, 3, 14, 0xf4d50d87);
OP (FG, B, C, D, A, 8, 20, 0x455a14ed);
OP (FG, A, B, C, D, 13, 5, 0xa9e3e905);
OP (FG, D, A, B, C, 2, 9, 0xfcefa3f8);
OP (FG, C, D, A, B, 7, 14, 0x676f02d9);
OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a);
/* Round 3. */
OP (FH, A, B, C, D, 5, 4, 0xfffa3942);
OP (FH, D, A, B, C, 8, 11, 0x8771f681);
OP (FH, C, D, A, B, 11, 16, 0x6d9d6122);
OP (FH, B, C, D, A, 14, 23, 0xfde5380c);
OP (FH, A, B, C, D, 1, 4, 0xa4beea44);
OP (FH, D, A, B, C, 4, 11, 0x4bdecfa9);
OP (FH, C, D, A, B, 7, 16, 0xf6bb4b60);
OP (FH, B, C, D, A, 10, 23, 0xbebfbc70);
OP (FH, A, B, C, D, 13, 4, 0x289b7ec6);
OP (FH, D, A, B, C, 0, 11, 0xeaa127fa);
OP (FH, C, D, A, B, 3, 16, 0xd4ef3085);
OP (FH, B, C, D, A, 6, 23, 0x04881d05);
OP (FH, A, B, C, D, 9, 4, 0xd9d4d039);
OP (FH, D, A, B, C, 12, 11, 0xe6db99e5);
OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8);
OP (FH, B, C, D, A, 2, 23, 0xc4ac5665);
/* Round 4. */
OP (FI, A, B, C, D, 0, 6, 0xf4292244);
OP (FI, D, A, B, C, 7, 10, 0x432aff97);
OP (FI, C, D, A, B, 14, 15, 0xab9423a7);
OP (FI, B, C, D, A, 5, 21, 0xfc93a039);
OP (FI, A, B, C, D, 12, 6, 0x655b59c3);
OP (FI, D, A, B, C, 3, 10, 0x8f0ccc92);
OP (FI, C, D, A, B, 10, 15, 0xffeff47d);
OP (FI, B, C, D, A, 1, 21, 0x85845dd1);
OP (FI, A, B, C, D, 8, 6, 0x6fa87e4f);
OP (FI, D, A, B, C, 15, 10, 0xfe2ce6e0);
OP (FI, C, D, A, B, 6, 15, 0xa3014314);
OP (FI, B, C, D, A, 13, 21, 0x4e0811a1);
OP (FI, A, B, C, D, 4, 6, 0xf7537e82);
OP (FI, D, A, B, C, 11, 10, 0xbd3af235);
OP (FI, C, D, A, B, 2, 15, 0x2ad7d2bb);
OP (FI, B, C, D, A, 9, 21, 0xeb86d391);
/* Add the starting values of the context. */
A += A_save;
B += B_save;
C += C_save;
D += D_save;
}
/* Put checksum in context given as argument. */
ctx->A = A;
ctx->B = B;
ctx->C = C;
ctx->D = D;
}
/* The routine updates the message-digest context to
* account for the presence of each of the characters inBuf[0..inLen-1]
* in the message whose digest is being computed.
*/
void
md5_write( MD5_CONTEXT *mdContext, byte *inBuf, size_t inLen)
md5_write( MD5_CONTEXT *ctx, const void *buffer, size_t len)
{
register int i, ii;
int mdi;
u32 in[16];
/* When we already have some bits in our internal buffer concatenate
both inputs first. */
if (ctx->buflen != 0)
{
size_t left_over = ctx->buflen;
size_t add = 128 - left_over > len ? len : 128 - left_over;
if(mdContext->count) { /* flush the buffer */
i = mdContext->count;
mdContext->count = 0;
md5_write( mdContext, mdContext->digest, i);
}
if( !inBuf )
return;
memcpy (&ctx->buffer[left_over], buffer, add);
ctx->buflen += add;
/* compute number of bytes mod 64 */
mdi = (int)((mdContext->i[0] >> 3) & 0x3F);
if (left_over + add > 64)
{
transform(ctx, ctx->buffer, (left_over + add) & ~63);
/* The regions in the following copy operation cannot overlap. */
memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63],
(left_over + add) & 63);
ctx->buflen = (left_over + add) & 63;
}
/* update number of bits */
if((mdContext->i[0] + ((u32)inLen << 3)) < mdContext->i[0])
mdContext->i[1]++;
mdContext->i[0] += ((u32)inLen << 3);
mdContext->i[1] += ((u32)inLen >> 29);
buffer = (const char *) buffer + add;
len -= add;
}
while(inLen--) {
/* add new character to buffer, increment mdi */
mdContext->in[mdi++] = *inBuf++;
/* Process available complete blocks. */
if (len > 64)
{
transform( ctx, buffer, len & ~63);
buffer = (const char *) buffer + (len & ~63);
len &= 63;
}
/* transform if necessary */
if( mdi == 0x40 ) {
for(i = 0, ii = 0; i < 16; i++, ii += 4)
in[i] = (((u32)mdContext->in[ii+3]) << 24) |
(((u32)mdContext->in[ii+2]) << 16) |
(((u32)mdContext->in[ii+1]) << 8) |
((u32)mdContext->in[ii]);
Transform(mdContext->buf, in);
mdi = 0;
}
}
/* Move remaining bytes in internal buffer. */
if (len > 0)
{
memcpy (ctx->buffer, buffer, len);
ctx->buflen = len;
}
}
@ -197,145 +288,33 @@ md5_write( MD5_CONTEXT *mdContext, byte *inBuf, size_t inLen)
*/
void
md5_final( MD5_CONTEXT *mdContext )
md5_final( MD5_CONTEXT *ctx )
{
u32 in[16];
int mdi;
unsigned int i, ii;
unsigned int padLen;
/* Take yet unprocessed bytes into account. */
u32 bytes = ctx->buflen;
size_t pad;
if(mdContext->count) /* flush buffer */
md5_write(mdContext, NULL, 0 );
/* save number of bits */
in[14] = mdContext->i[0];
in[15] = mdContext->i[1];
/* Now count remaining bytes. */
ctx->total[0] += bytes;
if( ctx->total[0] < bytes )
++ctx->total[1];
/* compute number of bytes mod 64 */
mdi = (int)((mdContext->i[0] >> 3) & 0x3F);
pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes;
memcpy (&ctx->buffer[bytes], fillbuf, pad);
/* pad out to 56 mod 64 */
padLen = (mdi < 56) ? (56 - mdi) : (120 - mdi);
md5_write(mdContext, PADDING, padLen);
/* Put the 64-bit file length in *bits* at the end of the buffer. */
*(u32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3);
*(u32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) |
(ctx->total[0] >> 29));
/* append length in bits and transform */
for(i = 0, ii = 0; i < 14; i++, ii += 4)
in[i] = (((u32)mdContext->in[ii+3]) << 24) |
(((u32)mdContext->in[ii+2]) << 16) |
(((u32)mdContext->in[ii+1]) << 8) |
((u32)mdContext->in[ii]);
Transform(mdContext->buf, in);
/* Process last bytes. */
transform( ctx, ctx->buffer, bytes + pad + 8);
/* store buffer in digest */
for(i = 0, ii = 0; i < 4; i++, ii += 4) {
mdContext->digest[ii] = (byte)(mdContext->buf[i] & 0xFF);
mdContext->digest[ii+1] = (byte)((mdContext->buf[i] >> 8) & 0xFF);
mdContext->digest[ii+2] = (byte)((mdContext->buf[i] >> 16) & 0xFF);
mdContext->digest[ii+3] = (byte)((mdContext->buf[i] >> 24) & 0xFF);
}
}
/* Basic MD5 step. Transforms buf based on in. Note that if the Mysterious
* Constants are arranged backwards in little-endian order and decrypted with
* the DES they produce OCCULT MESSAGES!
*/
static void
Transform(register u32 *buf,register u32 *in)
{
register u32 a = buf[0], b = buf[1], c = buf[2], d = buf[3];
/* Round 1 */
#define S11 7
#define S12 12
#define S13 17
#define S14 22
FF ( a, b, c, d, in[ 0], S11, 0xD76AA478L); /* 1 */
FF ( d, a, b, c, in[ 1], S12, 0xE8C7B756L); /* 2 */
FF ( c, d, a, b, in[ 2], S13, 0x242070DBL); /* 3 */
FF ( b, c, d, a, in[ 3], S14, 0xC1BDCEEEL); /* 4 */
FF ( a, b, c, d, in[ 4], S11, 0xF57C0FAFL); /* 5 */
FF ( d, a, b, c, in[ 5], S12, 0x4787C62AL); /* 6 */
FF ( c, d, a, b, in[ 6], S13, 0xA8304613L); /* 7 */
FF ( b, c, d, a, in[ 7], S14, 0xFD469501L); /* 8 */
FF ( a, b, c, d, in[ 8], S11, 0x698098D8L); /* 9 */
FF ( d, a, b, c, in[ 9], S12, 0x8B44F7AFL); /* 10 */
FF ( c, d, a, b, in[10], S13, 0xFFFF5BB1L); /* 11 */
FF ( b, c, d, a, in[11], S14, 0x895CD7BEL); /* 12 */
FF ( a, b, c, d, in[12], S11, 0x6B901122L); /* 13 */
FF ( d, a, b, c, in[13], S12, 0xFD987193L); /* 14 */
FF ( c, d, a, b, in[14], S13, 0xA679438EL); /* 15 */
FF ( b, c, d, a, in[15], S14, 0x49B40821L); /* 16 */
/* Round 2 */
#define S21 5
#define S22 9
#define S23 14
#define S24 20
GG ( a, b, c, d, in[ 1], S21, 0xF61E2562L); /* 17 */
GG ( d, a, b, c, in[ 6], S22, 0xC040B340L); /* 18 */
GG ( c, d, a, b, in[11], S23, 0x265E5A51L); /* 19 */
GG ( b, c, d, a, in[ 0], S24, 0xE9B6C7AAL); /* 20 */
GG ( a, b, c, d, in[ 5], S21, 0xD62F105DL); /* 21 */
GG ( d, a, b, c, in[10], S22, 0x02441453L); /* 22 */
GG ( c, d, a, b, in[15], S23, 0xD8A1E681L); /* 23 */
GG ( b, c, d, a, in[ 4], S24, 0xE7D3FBC8L); /* 24 */
GG ( a, b, c, d, in[ 9], S21, 0x21E1CDE6L); /* 25 */
GG ( d, a, b, c, in[14], S22, 0xC33707D6L); /* 26 */
GG ( c, d, a, b, in[ 3], S23, 0xF4D50D87L); /* 27 */
GG ( b, c, d, a, in[ 8], S24, 0x455A14EDL); /* 28 */
GG ( a, b, c, d, in[13], S21, 0xA9E3E905L); /* 29 */
GG ( d, a, b, c, in[ 2], S22, 0xFCEFA3F8L); /* 30 */
GG ( c, d, a, b, in[ 7], S23, 0x676F02D9L); /* 31 */
GG ( b, c, d, a, in[12], S24, 0x8D2A4C8AL); /* 32 */
/* Round 3 */
#define S31 4
#define S32 11
#define S33 16
#define S34 23
HH ( a, b, c, d, in[ 5], S31, 0xFFFA3942L); /* 33 */
HH ( d, a, b, c, in[ 8], S32, 0x8771F681L); /* 34 */
HH ( c, d, a, b, in[11], S33, 0x6D9D6122L); /* 35 */
HH ( b, c, d, a, in[14], S34, 0xFDE5380CL); /* 36 */
HH ( a, b, c, d, in[ 1], S31, 0xA4BEEA44L); /* 37 */
HH ( d, a, b, c, in[ 4], S32, 0x4BDECFA9L); /* 38 */
HH ( c, d, a, b, in[ 7], S33, 0xF6BB4B60L); /* 39 */
HH ( b, c, d, a, in[10], S34, 0xBEBFBC70L); /* 40 */
HH ( a, b, c, d, in[13], S31, 0x289B7EC6L); /* 41 */
HH ( d, a, b, c, in[ 0], S32, 0xEAA127FAL); /* 42 */
HH ( c, d, a, b, in[ 3], S33, 0xD4EF3085L); /* 43 */
HH ( b, c, d, a, in[ 6], S34, 0x04881D05L); /* 44 */
HH ( a, b, c, d, in[ 9], S31, 0xD9D4D039L); /* 45 */
HH ( d, a, b, c, in[12], S32, 0xE6DB99E5L); /* 46 */
HH ( c, d, a, b, in[15], S33, 0x1FA27CF8L); /* 47 */
HH ( b, c, d, a, in[ 2], S34, 0xC4AC5665L); /* 48 */
/* Round 4 */
#define S41 6
#define S42 10
#define S43 15
#define S44 21
II ( a, b, c, d, in[ 0], S41, 0xF4292244L); /* 49 */
II ( d, a, b, c, in[ 7], S42, 0x432AFF97L); /* 50 */
II ( c, d, a, b, in[14], S43, 0xAB9423A7L); /* 51 */
II ( b, c, d, a, in[ 5], S44, 0xFC93A039L); /* 52 */
II ( a, b, c, d, in[12], S41, 0x655B59C3L); /* 53 */
II ( d, a, b, c, in[ 3], S42, 0x8F0CCC92L); /* 54 */
II ( c, d, a, b, in[10], S43, 0xFFEFF47DL); /* 55 */
II ( b, c, d, a, in[ 1], S44, 0x85845DD1L); /* 56 */
II ( a, b, c, d, in[ 8], S41, 0x6FA87E4FL); /* 57 */
II ( d, a, b, c, in[15], S42, 0xFE2CE6E0L); /* 58 */
II ( c, d, a, b, in[ 6], S43, 0xA3014314L); /* 59 */
II ( b, c, d, a, in[13], S44, 0x4E0811A1L); /* 60 */
II ( a, b, c, d, in[ 4], S41, 0xF7537E82L); /* 61 */
II ( d, a, b, c, in[11], S42, 0xBD3AF235L); /* 62 */
II ( c, d, a, b, in[ 2], S43, 0x2AD7D2BBL); /* 63 */
II ( b, c, d, a, in[ 9], S44, 0xEB86D391L); /* 64 */
buf[0] += a;
buf[1] += b;
buf[2] += c;
buf[3] += d;
/* Store the result in buffer */
((u32 *)ctx->buffer)[0] = SWAP (ctx->A);
((u32 *)ctx->buffer)[1] = SWAP (ctx->B);
((u32 *)ctx->buffer)[2] = SWAP (ctx->C);
((u32 *)ctx->buffer)[3] = SWAP (ctx->D);
}

View File

@ -1,14 +1,14 @@
/* md5.h - message digest 5
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
@ -23,17 +23,16 @@
#include "types.h"
typedef struct {
u32 i[2]; /* number of _bits_ handled mod 2^64 */
u32 buf[4]; /* scratch buffer */
int count;
byte in[64]; /* input buffer */
byte digest[16+8+1]; /* actual digest after Final call */
u32 A,B,C,D; /* chaining variables */
u32 total[2];
u32 buflen;
char buffer[128];
} MD5_CONTEXT;
void md5_init( MD5_CONTEXT *c );
void md5_write( MD5_CONTEXT *hd, byte *inbuf, size_t inlen);
void md5_final( MD5_CONTEXT *hd);
#define md5_read(h) ( (h)->digest )
void md5_init( MD5_CONTEXT *ctx );
void md5_write( MD5_CONTEXT *ctx, const void *buffer, size_t len);
void md5_final( MD5_CONTEXT *ctx);
#define md5_read(h) ( (h)->buffer )
#endif /*G10_MD5_H*/

View File

@ -1,14 +1,14 @@
/* misc.c - utility functions
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* primegen.c - prime number generator
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* random.c - random number generator
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
@ -53,11 +53,10 @@ quick_random_gen( int onoff )
int last = quick_test;
if( onoff != -1 )
quick_test = onoff;
#ifdef HAVE_DEV_RANDOM
return last;
#else
return 1; /* insecure RNG */
#ifndef HAVE_DEV_RANDOM
last = 1; /* insecure RNG */
#endif
return last;
}

View File

@ -1,14 +1,14 @@
/* rmd.h - RIPE-MD hash functions
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* rmd160.c - RIPE-MD160
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* rmd160test.c - ripe md 160 test program
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,16 +1,16 @@
/* sha1.c - SHA1 hash function
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* Please see below for more legal informations!
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* sha1.h - SHA1 hash function
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* smallprime.c - List of small primes
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,15 +1,15 @@
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* acconfig.h - used by autoheader to make config.h.in
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

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

View File

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

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)
* Makefile.am (OMIT_DEPENDENCIES): New.

View File

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

View File

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

View File

@ -1,14 +1,14 @@
/* armor.c - Armor filter
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
@ -942,7 +942,7 @@ armor_filter( void *opaque, int control,
iobuf_writestr(a, "-----");
iobuf_writestr(a, head_strings[afx->what] );
iobuf_writestr(a, "-----\n");
iobuf_writestr(a, "Version: G10 v" VERSION " ("
iobuf_writestr(a, "Version: GNUPG v" VERSION " ("
PRINTABLE_OS_NAME ")\n");
iobuf_writestr(a, "Comment: This is an alpha version!\n");
if( afx->hdrlines )

View File

@ -1,14 +1,14 @@
/* build-packet.c - assemble packets and write them
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
@ -211,7 +211,7 @@ hash_public_cert( MD_HANDLE md, PKT_public_cert *pkc )
int rc = 0;
int c;
IOBUF a = iobuf_temp();
#if 1
#if 0
FILE *fp = fopen("dump.pkc", "a");
int i=0;
@ -225,7 +225,7 @@ hash_public_cert( MD_HANDLE md, PKT_public_cert *pkc )
if( (rc = build_packet( a, &pkt )) )
log_fatal("build public_cert for hashing failed: %s\n", g10_errstr(rc));
while( (c=iobuf_get(a)) != -1 ) {
#if 1
#if 0
fprintf( fp," %02x", c );
if( (++i == 24) ) {
putc('\n', fp);
@ -234,7 +234,7 @@ hash_public_cert( MD_HANDLE md, PKT_public_cert *pkc )
#endif
md_putc( md, c );
}
#if 1
#if 0
putc('\n', fp);
fclose(fp);
#endif
@ -260,9 +260,16 @@ do_secret_cert( IOBUF out, int ctb, PKT_secret_cert *skc )
mpi_write(a, skc->d.elg.g );
mpi_write(a, skc->d.elg.y );
if( skc->d.elg.is_protected ) {
assert( skc->d.elg.protect_algo == CIPHER_ALGO_BLOWFISH );
iobuf_put(a, skc->d.elg.protect_algo );
iobuf_write(a, skc->d.elg.protect.blowfish.iv, 8 );
iobuf_put(a, 0xff );
iobuf_put(a, skc->d.elg.protect.algo );
iobuf_put(a, skc->d.elg.protect.s2k );
iobuf_put(a, skc->d.elg.protect.hash );
if( skc->d.elg.protect.s2k == 1
|| skc->d.elg.protect.s2k == 3 )
iobuf_write(a, skc->d.elg.protect.salt, 8 );
if( skc->d.elg.protect.s2k == 3 )
iobuf_put(a, skc->d.elg.protect.count );
iobuf_write(a, skc->d.elg.protect.iv, 8 );
}
else
iobuf_put(a, 0 );

View File

@ -1,14 +1,14 @@
/* cipher.c - En-/De-ciphering filter
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* comment.c - write comment stuff
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* compress.c - compress filter
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* elg.c
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* encode.c - encode data
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
@ -89,7 +89,7 @@ encode_simple( const char *filename, int mode )
if( mode ) {
cfx.dek = m_alloc_secure( sizeof *cfx.dek );
cfx.dek->algo = opt.def_cipher_algo;
if( (rc = make_dek_from_passphrase( cfx.dek , 2 )) ) {
if( (rc = make_dek_from_passphrase( cfx.dek , 2, NULL )) ) {
m_free(cfx.dek);
iobuf_close(inp);
log_error("error creating passphrase: %s\n", g10_errstr(rc) );
@ -106,7 +106,7 @@ encode_simple( const char *filename, int mode )
if( opt.armor )
iobuf_push_filter( out, armor_filter, &afx );
write_comment( out, "#created by G10 v" VERSION " ("
write_comment( out, "#created by GNUPG v" VERSION " ("
PRINTABLE_OS_NAME ")");
if( opt.compress )
@ -193,7 +193,7 @@ encode_crypt( const char *filename, STRLIST remusr )
if( opt.armor )
iobuf_push_filter( out, armor_filter, &afx );
write_comment( out, "#created by G10 v" VERSION " ("
write_comment( out, "#created by GNUPG v" VERSION " ("
PRINTABLE_OS_NAME ")");
if( opt.compress )

View File

@ -1,14 +1,14 @@
/* encr-data.c - process an encrypted data packet
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* export.c
* Copyright (c) 1998 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* filter.h
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* free-packet.c - cleanup stuff for packets
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

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

View File

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

View File

@ -1,14 +1,14 @@
/* getkey.c - Get a key from the database
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* import.c
* Copyright (c) 1998 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* kbnode.c - keyblock node utility functions
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* keydb.h - Key database
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
@ -95,8 +95,8 @@ int build_skc_list( STRLIST locusr, SKC_LIST *ret_skc_list, int unlock );
/*-- passphrase.h --*/
void set_passphrase_fd( int fd );
int get_passphrase_fd(void);
DEK *get_passphrase_hash( u32 *keyid, char *text );
int make_dek_from_passphrase( DEK *dek, int mode );
DEK *get_passphrase_hash( u32 *keyid, char *text, byte *salt );
int make_dek_from_passphrase( DEK *dek, int mode, byte *salt );
/*-- getkey.c --*/
void add_keyring( const char *name );

View File

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

View File

@ -1,14 +1,14 @@
/* keyid.c - jeyid and fingerprint handling
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* main.h
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* mainproc.c - handle packets
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
@ -189,7 +189,7 @@ proc_encrypted( CTX c, PACKET *pkt )
/* assume this is conventional encrypted data */
c->dek = m_alloc_secure( sizeof *c->dek );
c->dek->algo = opt.def_cipher_algo;
result = make_dek_from_passphrase( c->dek, 0 );
result = make_dek_from_passphrase( c->dek, 0, NULL );
}
else if( !c->dek )
result = G10ERR_NO_SECKEY;

View File

@ -1,14 +1,14 @@
/* mdfilter.c - filter data and calculate a message digest
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* openfile.c
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
@ -81,7 +81,7 @@ overwrite_filep( const char *fname )
/****************
* Make an output filename for the inputfile INAME.
* Returns an IOBUF
* Mode 0 = use ".g10"
* Mode 0 = use ".gpg"
* 1 = use ".asc"
* 2 = use ".sig"
*/
@ -106,7 +106,7 @@ open_outfile( const char *iname, int mode )
else {
buf = m_alloc(strlen(iname)+4+1);
strcpy(stpcpy(buf,iname), mode==1 ? ".asc" :
mode==2 ? ".sig" : ".g10");
mode==2 ? ".sig" : ".gpg");
name = buf;
}
if( !(rc=overwrite_filep( name )) ) {

View File

@ -1,14 +1,14 @@
/* options.h
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* packet.h - packet read/write stuff
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
@ -127,15 +127,16 @@ typedef struct {
MPI x; /* secret exponent */
u16 csum; /* checksum */
byte is_protected; /* The above infos are protected and must */
/* be decrypteded before use */
byte protect_algo; /* cipher used to protect the secret informations*/
union { /* information for the protection */
struct {
byte iv[8]; /* initialization vector for CFB mode */
/* when protected, the MPIs above are pointers
/* be decrypteded before use. */
struct {
byte algo; /* cipher used to protect the secret informations*/
byte s2k;
byte hash;
byte salt[8];
byte count;
byte iv[8]; /* initialization vector for CFB mode */
} protect; /* when protected, the MPIs above are pointers
* to plain storage */
} blowfish;
} protect;
} elg;
struct {
MPI rsa_n; /* public modulus */

View File

@ -1,14 +1,14 @@
/* parse-packet.c - read packets
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
@ -591,6 +591,7 @@ parse_certificate( IOBUF inp, int pkttype, unsigned long pktlen,
unsigned long timestamp;
unsigned short valid_period;
int is_v4=0;
int rc=0;
if( pktlen < 12 ) {
@ -658,11 +659,79 @@ parse_certificate( IOBUF inp, int pkttype, unsigned long pktlen,
pkt->pkt.secret_cert->d.elg.p = elg_p;
pkt->pkt.secret_cert->d.elg.g = elg_g;
pkt->pkt.secret_cert->d.elg.y = elg_y;
cert->d.elg.protect_algo = iobuf_get_noeof(inp); pktlen--;
if( list_mode )
printf( "\tprotect algo: %d\n", cert->d.elg.protect_algo);
if( cert->d.elg.protect_algo ) {
cert->d.elg.protect.algo = iobuf_get_noeof(inp); pktlen--;
if( cert->d.elg.protect.algo ) {
cert->d.elg.is_protected = 1;
cert->d.elg.protect.count = 0;
if( cert->d.elg.protect.algo == 255 ) {
if( pktlen < 3 ) {
rc = G10ERR_INVALID_PACKET;
goto leave;
}
cert->d.elg.protect.algo = iobuf_get_noeof(inp); pktlen--;
cert->d.elg.protect.s2k = iobuf_get_noeof(inp); pktlen--;
cert->d.elg.protect.hash = iobuf_get_noeof(inp); pktlen--;
switch( cert->d.elg.protect.s2k ) {
case 1:
case 3:
for(i=0; i < 8 && pktlen; i++, pktlen-- )
temp[i] = iobuf_get_noeof(inp);
memcpy(cert->d.elg.protect.salt, temp, 8 );
break;
}
switch( cert->d.elg.protect.s2k ) {
case 0: if( list_mode ) printf( "\tsimple S2K" );
break;
case 1: if( list_mode ) printf( "\tsalted S2K" );
break;
case 3: if( list_mode ) printf( "\titer+salt S2K" );
break;
default:
if( list_mode )
printf( "\tunknown S2K %d\n",
cert->d.elg.protect.s2k );
rc = G10ERR_INVALID_PACKET;
goto leave;
}
if( list_mode ) {
printf(", algo: %d, hash: %d",
cert->d.elg.protect.algo,
cert->d.elg.protect.hash );
if( cert->d.elg.protect.s2k == 1
|| cert->d.elg.protect.s2k == 3 ) {
printf(", salt: ");
for(i=0; i < 8; i++ )
printf("%02x", cert->d.elg.protect.salt[i]);
}
putchar('\n');
}
if( cert->d.elg.protect.s2k == 3 ) {
if( !pktlen ) {
rc = G10ERR_INVALID_PACKET;
goto leave;
}
cert->d.elg.protect.count = iobuf_get_noeof(inp);
pktlen--;
}
}
else {
if( list_mode )
printf( "\tprotect algo: %d\n",
cert->d.elg.protect.algo);
/* old version, we don't have a S2K, so we fake one */
cert->d.elg.protect.s2k = 0;
/* We need this kludge to cope with old GNUPG versions */
cert->d.elg.protect.hash =
cert->d.elg.protect.algo == CIPHER_ALGO_BLOWFISH?
DIGEST_ALGO_RMD160 : DIGEST_ALGO_MD5;
}
if( pktlen < 8 ) {
rc = G10ERR_INVALID_PACKET;
goto leave;
}
for(i=0; i < 8 && pktlen; i++, pktlen-- )
temp[i] = iobuf_get_noeof(inp);
if( list_mode ) {
@ -671,8 +740,7 @@ parse_certificate( IOBUF inp, int pkttype, unsigned long pktlen,
printf(" %02x", temp[i] );
putchar('\n');
}
if( cert->d.elg.protect_algo == CIPHER_ALGO_BLOWFISH )
memcpy(cert->d.elg.protect.blowfish.iv, temp, 8 );
memcpy(cert->d.elg.protect.iv, temp, 8 );
}
else
cert->d.elg.is_protected = 0;
@ -758,7 +826,7 @@ parse_certificate( IOBUF inp, int pkttype, unsigned long pktlen,
leave:
skip_rest(inp, pktlen);
return 0;
return rc;
}

View File

@ -1,14 +1,14 @@
/* passphrase.c - Get a passphrase
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
@ -33,7 +33,7 @@
static int pwfd = -1;
static int hash_passphrase( DEK *dek, char *pw );
static int hash_passphrase( DEK *dek, char *pw, byte *salt );
void
set_passphrase_fd( int fd )
@ -54,7 +54,7 @@ get_passphrase_fd()
* Returns: m_alloced md5 passphrase hash; caller must free
*/
DEK *
get_passphrase_hash( u32 *keyid, char *text )
get_passphrase_hash( u32 *keyid, char *text, byte *salt )
{
char *pw;
DEK *dek;
@ -97,8 +97,8 @@ get_passphrase_hash( u32 *keyid, char *text )
tty_kill_prompt();
}
dek = m_alloc_secure( sizeof *dek );
dek->algo = CIPHER_ALGO_BLOWFISH;
if( hash_passphrase( dek, pw ) )
dek->algo = CIPHER_ALGO_BLOWFISH; /* fixme: allow others ciphers */
if( hash_passphrase( dek, pw, salt ) )
log_bug("get_passphrase_hash\n");
m_free(pw); /* is allocated in secure memory, so it will be burned */
return dek;
@ -107,11 +107,12 @@ get_passphrase_hash( u32 *keyid, char *text )
/****************
* This function is used to construct a DEK from a user input.
* It uses the default CIPHER
* It uses the default CIPHER. If salt is != NULL, include these
* 8 bytes in the hash.
* Returns: 0 = okay, -1 No passphrase entered, > 0 error
*/
int
make_dek_from_passphrase( DEK *dek, int mode )
make_dek_from_passphrase( DEK *dek, int mode, byte *salt )
{
char *pw, *pw2;
int rc=0;
@ -131,14 +132,14 @@ make_dek_from_passphrase( DEK *dek, int mode )
if( !*pw )
rc = -1;
else
rc = hash_passphrase( dek, pw );
rc = hash_passphrase( dek, pw, salt );
m_free(pw);
return rc;
}
static int
hash_passphrase( DEK *dek, char *pw )
hash_passphrase( DEK *dek, char *pw, byte *salt )
{
int rc = 0;
@ -147,6 +148,8 @@ hash_passphrase( DEK *dek, char *pw )
MD_HANDLE md;
md = md_open(DIGEST_ALGO_RMD160, 1);
if( salt )
md_write( md, salt, 8 );
md_write( md, pw, strlen(pw) );
md_final( md );
dek->keylen = 20;

View File

@ -1,14 +1,14 @@
/* pkclist.c
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* plaintext.c - process an plaintext packet
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* pubkey-enc.c - public key encoded packet handling
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* revoke.c
* Copyright (c) 1998 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* ringedit.c - Function for key ring editing
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
@ -888,12 +888,18 @@ keyring_copy( KBPOS *kbpos, int mode, KBNODE root )
}
}
/* rename and make backup file */
#if __MINGW32__
remove( bakfname );
#endif
if( rename( rentry->fname, bakfname ) ) {
log_error("%s: rename to %s failed: %s\n",
rentry->fname, bakfname, strerror(errno) );
rc = G10ERR_RENAME_FILE;
goto leave;
}
#if __MINGW32__
remove( rentry->fname );
#endif
if( rename( tmpfname, rentry->fname ) ) {
log_error("%s: rename to %s failed: %s\n",
tmpfname, rentry->fname,strerror(errno) );

View File

@ -1,14 +1,14 @@
/* rsa.c
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* seckey-cert.c - secret key certifucate packet handling
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
@ -72,21 +72,27 @@ check_elg( PKT_secret_cert *cert )
MPI test_x;
BLOWFISH_context *blowfish_ctx=NULL;
switch( cert->d.elg.protect_algo ) {
switch( cert->d.elg.protect.algo ) {
case CIPHER_ALGO_NONE: BUG(); break;
case CIPHER_ALGO_BLOWFISH:
keyid_from_skc( cert, keyid );
dek = get_passphrase_hash( keyid, NULL );
if( cert->d.elg.protect.s2k == 1
|| cert->d.elg.protect.s2k == 3 )
dek = get_passphrase_hash( keyid, NULL,
cert->d.elg.protect.salt );
else
dek = get_passphrase_hash( keyid, NULL, NULL );
blowfish_ctx = m_alloc_secure( sizeof *blowfish_ctx );
blowfish_setkey( blowfish_ctx, dek->key, dek->keylen );
m_free(dek); /* pw is in secure memory, so m_free() burns it */
blowfish_setiv( blowfish_ctx, NULL );
memcpy(save_iv, cert->d.elg.protect.blowfish.iv, 8 );
memcpy(save_iv, cert->d.elg.protect.iv, 8 );
blowfish_decode_cfb( blowfish_ctx,
cert->d.elg.protect.blowfish.iv,
cert->d.elg.protect.blowfish.iv, 8 );
cert->d.elg.protect.iv,
cert->d.elg.protect.iv, 8 );
mpi_set_secure(cert->d.elg.x );
/*fixme: maybe it is better to set the buger secure with a
/*fixme: maybe it is better to set the buffer secure with a
* new get_buffer_secure() function */
buffer = mpi_get_buffer( cert->d.elg.x, &nbytes, NULL );
csum = checksum_u16( nbytes*8 );
@ -99,7 +105,7 @@ check_elg( PKT_secret_cert *cert )
/* now let's see wether we have used the right passphrase */
if( csum != cert->d.elg.csum ) {
mpi_free(test_x);
memcpy( cert->d.elg.protect.blowfish.iv, save_iv, 8 );
memcpy( cert->d.elg.protect.iv, save_iv, 8 );
return G10ERR_BAD_PASS;
}
@ -111,7 +117,7 @@ check_elg( PKT_secret_cert *cert )
memset( &skey, 0, sizeof skey );
if( !res ) {
mpi_free(test_x);
memcpy( cert->d.elg.protect.blowfish.iv, save_iv, 8 );
memcpy( cert->d.elg.protect.iv, save_iv, 8 );
return G10ERR_BAD_PASS;
}
mpi_set(cert->d.elg.x, test_x);
@ -144,15 +150,15 @@ protect_elg( PKT_secret_cert *cert, DEK *dek )
if( !cert->d.elg.is_protected ) { /* add the protection */
BLOWFISH_context *blowfish_ctx=NULL;
switch( cert->d.elg.protect_algo ) {
switch( cert->d.elg.protect.algo ) {
case CIPHER_ALGO_NONE: BUG(); break;
case CIPHER_ALGO_BLOWFISH:
blowfish_ctx = m_alloc_secure( sizeof *blowfish_ctx );
blowfish_setkey( blowfish_ctx, dek->key, dek->keylen );
blowfish_setiv( blowfish_ctx, NULL );
blowfish_encode_cfb( blowfish_ctx,
cert->d.elg.protect.blowfish.iv,
cert->d.elg.protect.blowfish.iv, 8 );
cert->d.elg.protect.iv,
cert->d.elg.protect.iv, 8 );
buffer = mpi_get_buffer( cert->d.elg.x, &nbytes, NULL );
blowfish_encode_cfb( blowfish_ctx, buffer, buffer, nbytes );
mpi_set_buffer( cert->d.elg.x, buffer, nbytes, 0 );
@ -296,7 +302,7 @@ int
is_secret_key_protected( PKT_secret_cert *cert )
{
if( cert->pubkey_algo == PUBKEY_ALGO_ELGAMAL )
return cert->d.elg.is_protected? cert->d.elg.protect_algo : 0;
return cert->d.elg.is_protected? cert->d.elg.protect.algo : 0;
#ifdef HAVE_RSA_CIPHER
else if( cert->pubkey_algo == PUBKEY_ALGO_RSA )
return cert->d.rsa.is_protected? cert->d.rsa.protect_algo : 0;
@ -317,10 +323,6 @@ protect_secret_key( PKT_secret_cert *cert, DEK *dek )
if( cert->pubkey_algo == PUBKEY_ALGO_ELGAMAL )
return protect_elg( cert, dek );
#if 0 /* noy yet implemented */
else if( cert->pubkey_algo == PUBKEY_ALGO_RSA )
return protect_rsa( cert, dek );
#endif
else
return G10ERR_PUBKEY_ALGO;
}

View File

@ -1,14 +1,14 @@
/* seskey.c - make sesssion keys etc.
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* sig-check.c - Check a signature
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* sign.c - sign data
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
@ -152,7 +152,7 @@ sign_file( STRLIST filenames, int detached, STRLIST locusr,
if( opt.armor && !outfile )
iobuf_push_filter( out, armor_filter, &afx );
write_comment( out, "#created by G10 v" VERSION " ("
write_comment( out, "#created by GNUPG v" VERSION " ("
PRINTABLE_OS_NAME ")");
if( opt.compress && !outfile )
iobuf_push_filter( out, compress_filter, &zfx );
@ -916,13 +916,15 @@ change_passphrase( const char *username )
if( rc )
tty_printf("Can't edit this key: %s\n", g10_errstr(rc));
else {
DEK *dek = m_alloc_secure( sizeof *dek );
DEK *dek = m_alloc_secure( sizeof *dek + 8 );
byte *salt = (byte*)dek + sizeof( *dek );
tty_printf( "Enter the new passphrase for this secret key.\n\n" );
for(;;) {
dek->algo = CIPHER_ALGO_BLOWFISH;
rc = make_dek_from_passphrase( dek , 2 );
randomize_buffer(salt, 8, 1);
rc = make_dek_from_passphrase( dek , 2, salt );
if( rc == -1 ) {
rc = 0;
tty_printf( "You don't want a passphrase -"
@ -943,8 +945,11 @@ change_passphrase( const char *username )
break;
}
else { /* okay */
skc->d.elg.protect_algo = CIPHER_ALGO_BLOWFISH;
randomize_buffer(skc->d.elg.protect.blowfish.iv, 8, 1);
skc->d.elg.protect.algo = CIPHER_ALGO_BLOWFISH;
skc->d.elg.protect.s2k = 1;
skc->d.elg.protect.hash = DIGEST_ALGO_RMD160;
memcpy(skc->d.elg.protect.salt, salt, 8);
randomize_buffer(skc->d.elg.protect.iv, 8, 1);
rc = protect_secret_key( skc, dek );
if( rc )
log_error("protect_secret_key failed: %s\n", g10_errstr(rc) );

View File

@ -1,14 +1,14 @@
/* skclist.c
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* status.c
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* status.h
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,14 +1,14 @@
/* textfilter.c
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

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

View File

@ -1,14 +1,14 @@
/* trustdb.h - Trust database
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

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)
* config.links : Add detection of m68k cpus

View File

@ -2,16 +2,16 @@
* sum in a third limb vector.
*
* Copyright (C) 1995 Free Software Foundation, Inc.
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,15 +1,15 @@
/* alpha rshift, lshift
* Copyright (C) 1994, 1995 Free Software Foundation, Inc.
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -2,16 +2,16 @@
* sum in a third limb vector.
*
* Copyright (C) 1992, 1994 Free Software Foundation, Inc.
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,15 +1,15 @@
/* hppa rshift, lshift
* Copyright (C) 1992, 1994 Free Software Foundation, Inc.
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,16 +1,16 @@
/* hppa sub_n -- Sub two limb vectors of the same length > 0 and store
* sum in a third limb vector.
* Copyright (C) 1992, 1994 Free Software Foundation, Inc.
* Copyright (c) 1998 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,16 +1,16 @@
/* hppa1.1 mul_1 -- Multiply a limb vector with a limb and store
* the result in a second limb vector.
* Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
* Copyright (c) 1998 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,16 +1,16 @@
/* hppa1.1 addmul_1 -- Multiply a limb vector with a limb and add
* the result to a second limb vector.
* Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,16 +1,16 @@
/* hppa1.1 submul_1 -- Multiply a limb vector with a limb and add
* the result to a second limb vector.
* Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -2,16 +2,16 @@
* This version runs fast on PA 7000 and later.
*
* Copyright (C) 1993, 1994 Free Software Foundation, Inc.
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -2,16 +2,16 @@
* sum in a third limb vector.
*
* Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,16 +1,16 @@
/* i80386 mul_1 -- Multiply a limb vector with a limb and store
* the result in a second limb vector.
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
* Copyright (C) 1992, 1994 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,16 +1,16 @@
/* i80386 addmul_1 -- Multiply a limb vector with a limb and add
* the result to a second limb vector.
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
* Copyright (C) 1992, 1994 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,16 +1,16 @@
/* i80386 submul_1 -- Multiply a limb vector with a limb and add
* the result to a second limb vector.
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
* Copyright (C) 1992, 1994 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

View File

@ -1,15 +1,15 @@
/* i80386 rshift, lshift
* Copyright (c) 1997 by Werner Koch (dd9jn)
* Copyright (C) 1998 Free Software Foundation, Inc.
* Copyright (C) 1992, 1994 Free Software Foundation, Inc.
*
* This file is part of G10.
* This file is part of GNUPG.
*
* G10 is free software; you can redistribute it and/or modify
* GNUPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* G10 is distributed in the hope that it will be useful,
* GNUPG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.

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