mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
Updated to match the switch to the NSIS installer.
This commit is contained in:
parent
b663f3f8d3
commit
334e3e96d2
3
NEWS
3
NEWS
@ -23,6 +23,9 @@ Noteworthy changes in version 1.4.1
|
||||
available, missing secret key stubs will be created on the fly.
|
||||
Details of the key are listed too.
|
||||
|
||||
* The implicit packet dumping in double verbose mode is now send
|
||||
to stderr and not to stdout.
|
||||
|
||||
* [W32] The algorithm for the default home directory changed:
|
||||
First we look at the environment variable GNUPGHOME, if this one
|
||||
is not set, we check whether the registry entry
|
||||
|
1
THANKS
1
THANKS
@ -34,6 +34,7 @@ Dan Winship danw@helixcode.com
|
||||
Daniel Eisenbud eisenbud@cs.swarthmore.edu
|
||||
Daniel Koening dan@mail.isis.de
|
||||
Daniel Resare daniel@resare.com
|
||||
Dany Nativel dany@natzo.com
|
||||
Dave Dykstra dwd@bell-labs.com
|
||||
David C Niemi niemi@tuxers.net
|
||||
David Champion dgc@uchicago.edu
|
||||
|
@ -1,3 +1,7 @@
|
||||
2005-02-03 Werner Koch <wk@g10code.com>
|
||||
|
||||
* README.W32: Updated to match the switch to the NSIS installer.
|
||||
|
||||
2005-01-27 Werner Koch <wk@g10code.com>
|
||||
|
||||
* faq.raw: Updated to the version from 1.2.7.
|
||||
|
217
doc/README.W32
217
doc/README.W32
@ -1,5 +1,7 @@
|
||||
This is a binary version of GnuPG for MS-Windows 95, 98, WNT, W2000
|
||||
and XP.
|
||||
README.W32 -*- text -*-
|
||||
|
||||
This is a binary package with GnuPG for MS-Windows 95, 98, WNT, W2000
|
||||
and XP. See the file README for generic instructions and usage hints.
|
||||
|
||||
A FAQ comes with this package and a probably more recent one can be
|
||||
found online at http://www.gnupg.org/faq.html. See
|
||||
@ -7,85 +9,178 @@ http://www.gnupg.org/docs-mls.html for a list of mailing lists. In
|
||||
particular the list gnupg-users@gnupg.org might be useful to answer
|
||||
questions - but please read the FAQ first.
|
||||
|
||||
Note: Due to the use of the NSIS installer, the information below are
|
||||
mostly out of date.
|
||||
|
||||
Installation instructions:
|
||||
--------------------------
|
||||
1. Unpack the ZIP archive (alright, you already did this).
|
||||
2. Copy "gpg.exe", "gpgv.exe" and "gpgkeys_ldap.exe" to a place
|
||||
where you usually store your binaries.
|
||||
3. Create a directory "c:\gnupg" (or any other as you like)
|
||||
4. If you did not use the default directory "c:\gnupg", you
|
||||
should enter a string with the directory into the Registry
|
||||
under the key:
|
||||
HKEY_CURRENT_USER -> Software -> GNU -> GnuPG
|
||||
(you probably need to create the keys GNU and GnuPG) and insert a
|
||||
new string under the name "HomeDir" with the value of the default
|
||||
directory you want to use. Please use forward slashes and not the
|
||||
backslashes when setting filenames for GnuPG into the Registry.
|
||||
5. Enter "gpg" and see what happens
|
||||
6. Read the file README and the online HOWTOs
|
||||
Installation directory:
|
||||
=======================
|
||||
|
||||
The installation directory of GnuPG is stored in the Registry under
|
||||
the key HKEY_LCOAL_MACHINE\Software\GNU\GnuPG with the name "Install
|
||||
Directory". The installer does not change the PATH environment
|
||||
variable to include this directory. You might want to do this
|
||||
manually.
|
||||
|
||||
Below the Installation directory, you will find directories named
|
||||
"Doc", "gnupg.nls" and "Src". The latter will be used for distributed
|
||||
patched, if any, and to store the source file if they have been
|
||||
included in this package. The source files usually require further
|
||||
unpacking using a the TAR utility.
|
||||
|
||||
|
||||
Internationalization support:
|
||||
-----------------------------
|
||||
1
|
||||
=============================
|
||||
|
||||
Store the locale id (like "de") into the registry under the key
|
||||
HKEY_CURRENT_USER\Software\GNU\GnuPG with the name "Lang".
|
||||
Store the locale id (like "de") into the Registry under the key
|
||||
HKEY_CURRENT_USER\Software\GNU\GnuPG with the name "Lang". This must
|
||||
match one of the installed languages files in the directory named
|
||||
"gnupg.nls" below the installation directory. Note, that the ".mo"
|
||||
extension is not part of the lcoale id.
|
||||
|
||||
|
||||
How to build it from the source:
|
||||
--------------------------------
|
||||
This version has been build with the Mingw32/CPD kit using the latest
|
||||
stable version of GnuPG.
|
||||
Home directory:
|
||||
===============
|
||||
|
||||
First get the source: It has to be available at the same location you
|
||||
found this binary package - if not you should have received a written
|
||||
offer to get the source delivered to you See the file COPYING (section
|
||||
3) for details.
|
||||
GnuPG makes use of a per user home directory to store its keys as well
|
||||
as configuration files. The default home directory is a directory
|
||||
named "gnupg" below the application data directory of the user. This
|
||||
directory will be created if it does not exist. Being only a default,
|
||||
it may be changed by setting the name of the home directory into the
|
||||
Registry under the key HKEY_CURRENT_USER\Software\GNU\GnuPG using the
|
||||
name "HomeDir". If an environment varaibale "GNUPGHOME" exists, this
|
||||
even overrides the registry setting. The command line option
|
||||
"--homedir" may be used to override all other settings of the home
|
||||
directory.
|
||||
|
||||
If you got this package from its canonical place (ftp.gnupg.org), the
|
||||
source is available at:
|
||||
|
||||
ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-1.2.n.tar.gz
|
||||
Reporting bugs:
|
||||
===============
|
||||
|
||||
or for development snapshots
|
||||
Please check the documentation first before asking or reporting a
|
||||
bugs. In particular check the archives of the mailing lists (see
|
||||
www.gnupg.org) and the bug tracking system at http://bugs.gnupg.org
|
||||
(login is "guest" password is "guest") whether the problem is already
|
||||
known. Asking on the gnupg-users mailing list is also strongly
|
||||
encouraged; if you are not subscribed it may some time until a posting
|
||||
is approved (this is an anti-spam measure). Bug reporting addresses
|
||||
are listed in the file AUTHORS.
|
||||
|
||||
ftp://ftp.gnupg.org/gcrypt/alpha/gnupg/gnupg-1.x.n.tar.gz
|
||||
If you want to report a bug or have other problems, always give
|
||||
detailed description of the problem, the version of GnuPG you used,
|
||||
the version of the OS, whether it is the official version from
|
||||
gnupg.org or how you built it. Don't edit error messages - replacing
|
||||
sensitive information like user IDs, fingerprints and keyids is okay.
|
||||
If possible, switch to English messages by changing the "Lang" entry
|
||||
to empty (see under Internationalization support).
|
||||
|
||||
this is the same source as for the Unix version. If your binary
|
||||
version of GnuPG is called something like gnupg-w32-1.0.4-1.zip, you
|
||||
should find a patch file named gnupg-w32-1.0.4-1.0.4-1.diff.gz at the
|
||||
same location, which has to be applied to the stock gpg source file.
|
||||
Instructions are at the top of this file.
|
||||
|
||||
To build it, you need the MingW32/CPD kit, which is available at
|
||||
How to build GnuPG from the source:
|
||||
===================================
|
||||
|
||||
ftp://ftp.gnupg.org/people/werner/cpd/mingw32-cpd-0.3.2.tar.gz
|
||||
ftp://ftp.gnupg.org/people/werner/cpd/gcc-core-2.95.2.tar.gz
|
||||
ftp://ftp.gnupg.org/people/werner/cpd/binutils-2.9.1.tar.gz
|
||||
Until recently all official GnuPG versions have been build using the
|
||||
Mingw32/CPD kit as available at
|
||||
ftp://ftp.gnupg.org/people/werner/cpd/mingw32-cqpd-0.3.2.tar.gz .
|
||||
However, for maintenance reasons we switched to Debian's mingw32 cross
|
||||
compiler package and that is now the recommended way of building GnuPG
|
||||
for W32 platforms. It might be possible to build it nativly on a W32
|
||||
platform but this is not supported. Please don't file any bug reports
|
||||
if it does not build with any other system than the recommended one.
|
||||
|
||||
gcc and binutils are stock GNU source which are available
|
||||
at every GNU mirror.
|
||||
According to the conditions of the GNU General Public License you
|
||||
either got the source files with this package, a written offer to send
|
||||
you the source on demand or the source is available at the same site
|
||||
you downloaded the binary package. If you downloaded the package from
|
||||
the official GnuPG site or one of its mirrors, the corresponding
|
||||
source tarball is available in the sibling directory named gnupg. The
|
||||
source used to build all versions is always the same and the version
|
||||
numbers should match. If the version number of the binary package has
|
||||
a letter suffix, you will find a patch file installed in the "Src"
|
||||
directory with the changes relative to the generic version.
|
||||
|
||||
After you have installed this environment you should be able to do this:
|
||||
The source is distributed as a BZIP2 or GZIP compressed tar archive.
|
||||
See the instructions in file README on how to check the integrity of
|
||||
that file. Wir a properly setup build environment, you unpack the
|
||||
tarball change to the created directory and run
|
||||
|
||||
$ scripts/autogen.sh --build-w32
|
||||
$ ./autogen.sh --build-w32
|
||||
$ make
|
||||
$ mingw32 strip g10/gpg.exe
|
||||
$ cp g10/gpg.exe /some_windows_drive/
|
||||
$ cp g10/gpg*.exe /some_windows_drive/
|
||||
|
||||
And everything hopefully works. If there is a make problem in the
|
||||
"po" directory you can eiterignore it or do a "touch po/all". To
|
||||
build the distribtion ZIP file, you have to create a directory
|
||||
"dist-w32" and run "scripts/mk-w32-dist" right after a successul make
|
||||
run.
|
||||
Building a version with the installer is a bit more complex and
|
||||
basically works by creating a top directory, unpacking in that top
|
||||
directory, switching to the gnupg-1.x.y directory, running
|
||||
"./autogen.sh --build-w32" and "make", switching back to the top
|
||||
directory, running a "mkdir dist-w32; mkdir iconv", copying the
|
||||
required iconv files (iconv.dll, README.iconv, COPYING.LIB) into the
|
||||
iconv directory, running gnupg-1.x.y/scripts/mk-w32-dist and voila,
|
||||
the installer package will be available in the dist-w32 directory.
|
||||
|
||||
Don't forget that MS-Windows ist just a temporary workaround until
|
||||
you can switch to a GNU system ;-)
|
||||
|
||||
Be the source always with you.
|
||||
Copying:
|
||||
========
|
||||
|
||||
Werner
|
||||
GnuPG is
|
||||
|
||||
Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||
2005 Free Software Foundation, Inc.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
|
||||
See the files AUTHORS and THANKS for credits, further legal
|
||||
information and bug reporting addresses pertaining to GnuPG.
|
||||
|
||||
For copying conditions of the GNU LIBICONV library see the file
|
||||
README.iconv.
|
||||
|
||||
The installer software used to create the official binary packages for
|
||||
W32 is NSIS (http://nsis.sourceforge.net/):
|
||||
|
||||
Copyright (C) 1999-2005 Nullsoft, Inc.
|
||||
|
||||
This license applies to everything in the NSIS package, except where
|
||||
otherwise noted.
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must
|
||||
not claim that you wrote the original software. If you use this
|
||||
software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and must
|
||||
not be misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
The user interface used with the installer is
|
||||
|
||||
Copyright (C) 2002-2005 Joost Verburg
|
||||
|
||||
[It is distributed along with NSIS and the same conditions as stated
|
||||
above apply]
|
||||
|
||||
|
||||
The term "W32" is used to describe the API used by current Microsoft
|
||||
Windows versions. We don't use the Microsft terminology here; in
|
||||
hacker terminology, calling something a "win" is a form of praise.
|
||||
Keep in mind that Windows ist just a temporary workaround until you
|
||||
can switch to a complete Free Software system. Be the source always
|
||||
with you.
|
||||
|
@ -18,6 +18,10 @@
|
||||
|
||||
2005-01-27 Werner Koch <wk@g10code.com>
|
||||
|
||||
* parse-packet.c (listfp): New.
|
||||
(set_packet_list_mode): Intialize it to stdout or stderr depending
|
||||
on a global option. Made all printing in list mode use LISTFP.
|
||||
|
||||
* keygen.c (generate_subkeypair): Detect primary key on-card and
|
||||
ask for the passphrase. Return an error if the primary key is a
|
||||
plain stub.
|
||||
|
@ -1151,7 +1151,7 @@ do_proc_packets( CTX c, IOBUF a )
|
||||
if( rc ) {
|
||||
free_packet(pkt);
|
||||
/* stop processing when an invalid packet has been encountered
|
||||
* but don't do so when we are doing a --list-packet. */
|
||||
* but don't do so when we are doing a --list-packets. */
|
||||
if( rc == G10ERR_INVALID_PACKET && opt.list_packets != 2 )
|
||||
break;
|
||||
continue;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* parse-packet.c - read packets
|
||||
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003,
|
||||
* 2004 Free Software Foundation, Inc.
|
||||
* 2004, 2005 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
@ -37,8 +37,9 @@
|
||||
#include "main.h"
|
||||
#include "i18n.h"
|
||||
|
||||
static int mpi_print_mode = 0;
|
||||
static int list_mode = 0;
|
||||
static int mpi_print_mode;
|
||||
static int list_mode;
|
||||
static FILE *listfp;
|
||||
|
||||
static int parse( IOBUF inp, PACKET *pkt, int onlykeypkts,
|
||||
off_t *retpos, int *skip, IOBUF out, int do_skip
|
||||
@ -105,6 +106,23 @@ set_packet_list_mode( int mode )
|
||||
int old = list_mode;
|
||||
list_mode = mode;
|
||||
mpi_print_mode = DBG_MPI;
|
||||
/* We use stdout print only if invoked by the --list-packets
|
||||
command but switch to stderr in all otehr cases. This breaks
|
||||
the previous behaviour but that seems to be more of a bug than
|
||||
intentional. I don't believe that any application makes use of
|
||||
this long standing annoying way of printing to stdout except
|
||||
when doing a --list-packets. If this assumption fails, it will
|
||||
be easy to add an option for the listing stream. Note that we
|
||||
initialize it only once; mainly because some code may switch
|
||||
the option value later back to 1 and we want to have all output
|
||||
to the same stream.
|
||||
|
||||
Using stderr is not actually very clean because it bypasses the
|
||||
logging code but it is a special thing anyay. I am not sure
|
||||
whether using log_stream() would be better. Perhaps we should
|
||||
enable the list mdoe only with a special option. */
|
||||
if (!listfp)
|
||||
listfp = opt.list_packets == 2 ? stdout : stderr;
|
||||
return old;
|
||||
}
|
||||
|
||||
@ -523,14 +541,14 @@ dump_hex_line( int c, int *i )
|
||||
{
|
||||
if( *i && !(*i%8) ) {
|
||||
if( *i && !(*i%24) )
|
||||
printf("\n%4d:", *i );
|
||||
fprintf (listfp, "\n%4d:", *i );
|
||||
else
|
||||
putchar(' ');
|
||||
putc (' ', listfp);
|
||||
}
|
||||
if( c == -1 )
|
||||
printf(" EOF" );
|
||||
fprintf (listfp, " EOF" );
|
||||
else
|
||||
printf(" %02x", c );
|
||||
fprintf (listfp, " %02x", c );
|
||||
++*i;
|
||||
}
|
||||
|
||||
@ -573,13 +591,14 @@ skip_packet( IOBUF inp, int pkttype, unsigned long pktlen, int partial )
|
||||
{
|
||||
if( list_mode ) {
|
||||
if( pkttype == PKT_MARKER )
|
||||
fputs(":marker packet:\n", stdout );
|
||||
fputs(":marker packet:\n", listfp );
|
||||
else
|
||||
printf(":unknown packet: type %2d, length %lu\n", pkttype, pktlen);
|
||||
fprintf (listfp, ":unknown packet: type %2d, length %lu\n",
|
||||
pkttype, pktlen);
|
||||
if( pkttype ) {
|
||||
int c, i=0 ;
|
||||
if( pkttype != PKT_MARKER )
|
||||
fputs("dump:", stdout );
|
||||
fputs("dump:", listfp );
|
||||
if( partial ) {
|
||||
while( (c=iobuf_get(inp)) != -1 )
|
||||
dump_hex_line(c, &i);
|
||||
@ -588,7 +607,7 @@ skip_packet( IOBUF inp, int pkttype, unsigned long pktlen, int partial )
|
||||
for( ; pktlen; pktlen-- )
|
||||
dump_hex_line(iobuf_get(inp), &i);
|
||||
}
|
||||
putchar('\n');
|
||||
putc ('\n', listfp);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -691,18 +710,18 @@ parse_symkeyenc( IOBUF inp, int pkttype, unsigned long pktlen, PACKET *packet )
|
||||
assert( !pktlen );
|
||||
|
||||
if( list_mode ) {
|
||||
printf(":symkey enc packet: version %d, cipher %d, s2k %d, hash %d",
|
||||
fprintf (listfp, ":symkey enc packet: version %d, cipher %d, s2k %d, hash %d",
|
||||
version, cipher_algo, s2kmode, hash_algo);
|
||||
if(seskeylen)
|
||||
printf(", seskey %d bits",(seskeylen-1)*8);
|
||||
printf("\n");
|
||||
fprintf (listfp, ", seskey %d bits",(seskeylen-1)*8);
|
||||
fprintf (listfp, "\n");
|
||||
if( s2kmode == 1 || s2kmode == 3 ) {
|
||||
printf("\tsalt ");
|
||||
fprintf (listfp, "\tsalt ");
|
||||
for(i=0; i < 8; i++ )
|
||||
printf("%02x", k->s2k.salt[i]);
|
||||
fprintf (listfp, "%02x", k->s2k.salt[i]);
|
||||
if( s2kmode == 3 )
|
||||
printf(", count %lu", (ulong)k->s2k.count );
|
||||
printf("\n");
|
||||
fprintf (listfp, ", count %lu", (ulong)k->s2k.count );
|
||||
fprintf (listfp, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -736,13 +755,13 @@ parse_pubkeyenc( IOBUF inp, int pkttype, unsigned long pktlen, PACKET *packet )
|
||||
k->pubkey_algo = iobuf_get_noeof(inp); pktlen--;
|
||||
k->throw_keyid = 0; /* only used as flag for build_packet */
|
||||
if( list_mode )
|
||||
printf(":pubkey enc packet: version %d, algo %d, keyid %08lX%08lX\n",
|
||||
fprintf (listfp, ":pubkey enc packet: version %d, algo %d, keyid %08lX%08lX\n",
|
||||
k->version, k->pubkey_algo, (ulong)k->keyid[0], (ulong)k->keyid[1]);
|
||||
|
||||
ndata = pubkey_get_nenc(k->pubkey_algo);
|
||||
if( !ndata ) {
|
||||
if( list_mode )
|
||||
printf("\tunsupported algorithm %d\n", k->pubkey_algo );
|
||||
fprintf (listfp, "\tunsupported algorithm %d\n", k->pubkey_algo );
|
||||
unknown_pubkey_warning( k->pubkey_algo );
|
||||
k->data[0] = NULL; /* no need to store the encrypted data */
|
||||
}
|
||||
@ -751,9 +770,9 @@ parse_pubkeyenc( IOBUF inp, int pkttype, unsigned long pktlen, PACKET *packet )
|
||||
n = pktlen;
|
||||
k->data[i] = mpi_read(inp, &n, 0); pktlen -=n;
|
||||
if( list_mode ) {
|
||||
printf("\tdata: ");
|
||||
mpi_print(stdout, k->data[i], mpi_print_mode );
|
||||
putchar('\n');
|
||||
fprintf (listfp, "\tdata: ");
|
||||
mpi_print(listfp, k->data[i], mpi_print_mode );
|
||||
putc ('\n', listfp);
|
||||
}
|
||||
if (!k->data[i])
|
||||
rc = G10ERR_INVALID_PACKET;
|
||||
@ -777,82 +796,83 @@ dump_sig_subpkt( int hashed, int type, int critical,
|
||||
* detect the ARRs - we print our old message here when it is a faked
|
||||
* ARR and add an additional notice */
|
||||
if ( type == SIGSUBPKT_ARR && !hashed ) {
|
||||
printf("\tsubpkt %d len %u (additional recipient request)\n"
|
||||
"WARNING: PGP versions > 5.0 and < 6.5.8 will automagically "
|
||||
"encrypt to this key and thereby reveal the plaintext to "
|
||||
"the owner of this ARR key. Detailed info follows:\n",
|
||||
type, (unsigned)length );
|
||||
fprintf (listfp,
|
||||
"\tsubpkt %d len %u (additional recipient request)\n"
|
||||
"WARNING: PGP versions > 5.0 and < 6.5.8 will automagically "
|
||||
"encrypt to this key and thereby reveal the plaintext to "
|
||||
"the owner of this ARR key. Detailed info follows:\n",
|
||||
type, (unsigned)length );
|
||||
}
|
||||
|
||||
buffer++;
|
||||
length--;
|
||||
|
||||
printf("\t%s%ssubpkt %d len %u (", /*)*/
|
||||
fprintf (listfp, "\t%s%ssubpkt %d len %u (", /*)*/
|
||||
critical ? "critical ":"",
|
||||
hashed ? "hashed ":"", type, (unsigned)length );
|
||||
if( length > buflen ) {
|
||||
printf("too short: buffer is only %u)\n", (unsigned)buflen );
|
||||
fprintf (listfp, "too short: buffer is only %u)\n", (unsigned)buflen );
|
||||
return;
|
||||
}
|
||||
switch( type ) {
|
||||
case SIGSUBPKT_SIG_CREATED:
|
||||
if( length >= 4 )
|
||||
printf("sig created %s", strtimestamp( buffer_to_u32(buffer) ) );
|
||||
fprintf (listfp, "sig created %s", strtimestamp( buffer_to_u32(buffer) ) );
|
||||
break;
|
||||
case SIGSUBPKT_SIG_EXPIRE:
|
||||
if( length >= 4 )
|
||||
printf("sig expires after %s",
|
||||
fprintf (listfp, "sig expires after %s",
|
||||
strtimevalue( buffer_to_u32(buffer) ) );
|
||||
break;
|
||||
case SIGSUBPKT_EXPORTABLE:
|
||||
if( length )
|
||||
printf("%sexportable", *buffer? "":"not ");
|
||||
fprintf (listfp, "%sexportable", *buffer? "":"not ");
|
||||
break;
|
||||
case SIGSUBPKT_TRUST:
|
||||
if(length!=2)
|
||||
p="[invalid trust subpacket]";
|
||||
else
|
||||
printf("trust signature of depth %d, value %d",buffer[0],buffer[1]);
|
||||
fprintf (listfp, "trust signature of depth %d, value %d",buffer[0],buffer[1]);
|
||||
break;
|
||||
case SIGSUBPKT_REGEXP:
|
||||
if(!length)
|
||||
p="[invalid regexp subpacket]";
|
||||
else
|
||||
printf("regular expression: \"%s\"",buffer);
|
||||
fprintf (listfp, "regular expression: \"%s\"",buffer);
|
||||
break;
|
||||
case SIGSUBPKT_REVOCABLE:
|
||||
if( length )
|
||||
printf("%srevocable", *buffer? "":"not ");
|
||||
fprintf (listfp, "%srevocable", *buffer? "":"not ");
|
||||
break;
|
||||
case SIGSUBPKT_KEY_EXPIRE:
|
||||
if( length >= 4 )
|
||||
printf("key expires after %s",
|
||||
fprintf (listfp, "key expires after %s",
|
||||
strtimevalue( buffer_to_u32(buffer) ) );
|
||||
break;
|
||||
case SIGSUBPKT_PREF_SYM:
|
||||
fputs("pref-sym-algos:", stdout );
|
||||
fputs("pref-sym-algos:", listfp );
|
||||
for( i=0; i < length; i++ )
|
||||
printf(" %d", buffer[i] );
|
||||
fprintf (listfp, " %d", buffer[i] );
|
||||
break;
|
||||
case SIGSUBPKT_REV_KEY:
|
||||
fputs("revocation key: ", stdout );
|
||||
fputs("revocation key: ", listfp );
|
||||
if( length < 22 )
|
||||
p = "[too short]";
|
||||
else {
|
||||
printf("c=%02x a=%d f=", buffer[0], buffer[1] );
|
||||
fprintf (listfp, "c=%02x a=%d f=", buffer[0], buffer[1] );
|
||||
for( i=2; i < length; i++ )
|
||||
printf("%02X", buffer[i] );
|
||||
fprintf (listfp, "%02X", buffer[i] );
|
||||
}
|
||||
break;
|
||||
case SIGSUBPKT_ISSUER:
|
||||
if( length >= 8 )
|
||||
printf("issuer key ID %08lX%08lX",
|
||||
fprintf (listfp, "issuer key ID %08lX%08lX",
|
||||
(ulong)buffer_to_u32(buffer),
|
||||
(ulong)buffer_to_u32(buffer+4) );
|
||||
break;
|
||||
case SIGSUBPKT_NOTATION:
|
||||
{
|
||||
fputs("notation: ", stdout );
|
||||
fputs("notation: ", listfp );
|
||||
if( length < 8 )
|
||||
p = "[too short]";
|
||||
else {
|
||||
@ -865,11 +885,11 @@ dump_sig_subpkt( int hashed, int type, int critical,
|
||||
if( 8+n1+n2 != length )
|
||||
p = "[error]";
|
||||
else {
|
||||
print_string( stdout, s, n1, ')' );
|
||||
putc( '=', stdout );
|
||||
print_string( listfp, s, n1, ')' );
|
||||
putc( '=', listfp );
|
||||
|
||||
if( *buffer & 0x80 )
|
||||
print_string( stdout, s+n1, n2, ')' );
|
||||
print_string( listfp, s+n1, n2, ')' );
|
||||
else
|
||||
p = "[not human readable]";
|
||||
}
|
||||
@ -877,67 +897,67 @@ dump_sig_subpkt( int hashed, int type, int critical,
|
||||
}
|
||||
break;
|
||||
case SIGSUBPKT_PREF_HASH:
|
||||
fputs("pref-hash-algos:", stdout );
|
||||
fputs("pref-hash-algos:", listfp );
|
||||
for( i=0; i < length; i++ )
|
||||
printf(" %d", buffer[i] );
|
||||
fprintf (listfp, " %d", buffer[i] );
|
||||
break;
|
||||
case SIGSUBPKT_PREF_COMPR:
|
||||
fputs("pref-zip-algos:", stdout );
|
||||
fputs("pref-zip-algos:", listfp );
|
||||
for( i=0; i < length; i++ )
|
||||
printf(" %d", buffer[i] );
|
||||
fprintf (listfp, " %d", buffer[i] );
|
||||
break;
|
||||
case SIGSUBPKT_KS_FLAGS:
|
||||
fputs("key server preferences:",stdout);
|
||||
fputs("key server preferences:",listfp);
|
||||
for(i=0;i<length;i++)
|
||||
printf(" %02X", buffer[i]);
|
||||
fprintf (listfp, " %02X", buffer[i]);
|
||||
break;
|
||||
case SIGSUBPKT_PREF_KS:
|
||||
fputs("preferred key server: ", stdout );
|
||||
print_string( stdout, buffer, length, ')' );
|
||||
fputs("preferred key server: ", listfp );
|
||||
print_string( listfp, buffer, length, ')' );
|
||||
break;
|
||||
case SIGSUBPKT_PRIMARY_UID:
|
||||
p = "primary user ID";
|
||||
break;
|
||||
case SIGSUBPKT_POLICY:
|
||||
fputs("policy: ", stdout );
|
||||
print_string( stdout, buffer, length, ')' );
|
||||
fputs("policy: ", listfp );
|
||||
print_string( listfp, buffer, length, ')' );
|
||||
break;
|
||||
case SIGSUBPKT_KEY_FLAGS:
|
||||
fputs ( "key flags:", stdout );
|
||||
fputs ( "key flags:", listfp );
|
||||
for( i=0; i < length; i++ )
|
||||
printf(" %02X", buffer[i] );
|
||||
fprintf (listfp, " %02X", buffer[i] );
|
||||
break;
|
||||
case SIGSUBPKT_SIGNERS_UID:
|
||||
p = "signer's user ID";
|
||||
break;
|
||||
case SIGSUBPKT_REVOC_REASON:
|
||||
if( length ) {
|
||||
printf("revocation reason 0x%02x (", *buffer );
|
||||
print_string( stdout, buffer+1, length-1, ')' );
|
||||
fprintf (listfp, "revocation reason 0x%02x (", *buffer );
|
||||
print_string( listfp, buffer+1, length-1, ')' );
|
||||
p = ")";
|
||||
}
|
||||
break;
|
||||
case SIGSUBPKT_ARR:
|
||||
fputs("Big Brother's key (ignored): ", stdout );
|
||||
fputs("Big Brother's key (ignored): ", listfp );
|
||||
if( length < 22 )
|
||||
p = "[too short]";
|
||||
else {
|
||||
printf("c=%02x a=%d f=", buffer[0], buffer[1] );
|
||||
fprintf (listfp, "c=%02x a=%d f=", buffer[0], buffer[1] );
|
||||
for( i=2; i < length; i++ )
|
||||
printf("%02X", buffer[i] );
|
||||
fprintf (listfp, "%02X", buffer[i] );
|
||||
}
|
||||
break;
|
||||
case SIGSUBPKT_FEATURES:
|
||||
fputs ( "features:", stdout );
|
||||
fputs ( "features:", listfp );
|
||||
for( i=0; i < length; i++ )
|
||||
printf(" %02x", buffer[i] );
|
||||
fprintf (listfp, " %02x", buffer[i] );
|
||||
break;
|
||||
case SIGSUBPKT_SIGNATURE:
|
||||
fputs("signature: ",stdout);
|
||||
fputs("signature: ",listfp);
|
||||
if(length<17)
|
||||
p="[too short]";
|
||||
else
|
||||
printf("v%d, class 0x%02X, algo %d, digest algo %d",
|
||||
fprintf (listfp, "v%d, class 0x%02X, algo %d, digest algo %d",
|
||||
buffer[0],
|
||||
buffer[0]==3?buffer[2]:buffer[1],
|
||||
buffer[0]==3?buffer[15]:buffer[2],
|
||||
@ -951,7 +971,7 @@ dump_sig_subpkt( int hashed, int type, int critical,
|
||||
break;
|
||||
}
|
||||
|
||||
printf("%s)\n", p? p: "");
|
||||
fprintf (listfp, "%s)\n", p? p: "");
|
||||
}
|
||||
|
||||
/****************
|
||||
@ -1369,7 +1389,7 @@ parse_signature( IOBUF inp, int pkttype, unsigned long pktlen,
|
||||
}
|
||||
|
||||
if( list_mode ) {
|
||||
printf(":signature packet: algo %d, keyid %08lX%08lX\n"
|
||||
fprintf (listfp, ":signature packet: algo %d, keyid %08lX%08lX\n"
|
||||
"\tversion %d, created %lu, md5len %d, sigclass %02x\n"
|
||||
"\tdigest algo %d, begin of digest %02x %02x\n",
|
||||
sig->pubkey_algo,
|
||||
@ -1386,7 +1406,7 @@ parse_signature( IOBUF inp, int pkttype, unsigned long pktlen,
|
||||
ndata = pubkey_get_nsig(sig->pubkey_algo);
|
||||
if( !ndata ) {
|
||||
if( list_mode )
|
||||
printf("\tunknown algorithm %d\n", sig->pubkey_algo );
|
||||
fprintf (listfp, "\tunknown algorithm %d\n", sig->pubkey_algo );
|
||||
unknown_pubkey_warning( sig->pubkey_algo );
|
||||
/* we store the plain material in data[0], so that we are able
|
||||
* to write it back with build_packet() */
|
||||
@ -1399,9 +1419,9 @@ parse_signature( IOBUF inp, int pkttype, unsigned long pktlen,
|
||||
sig->data[i] = mpi_read(inp, &n, 0 );
|
||||
pktlen -=n;
|
||||
if( list_mode ) {
|
||||
printf("\tdata: ");
|
||||
mpi_print(stdout, sig->data[i], mpi_print_mode );
|
||||
putchar('\n');
|
||||
fprintf (listfp, "\tdata: ");
|
||||
mpi_print(listfp, sig->data[i], mpi_print_mode );
|
||||
putc ('\n', listfp);
|
||||
}
|
||||
if (!sig->data[i])
|
||||
rc = G10ERR_INVALID_PACKET;
|
||||
@ -1439,7 +1459,7 @@ parse_onepass_sig( IOBUF inp, int pkttype, unsigned long pktlen,
|
||||
ops->keyid[1] = read_32(inp); pktlen -= 4;
|
||||
ops->last = iobuf_get_noeof(inp); pktlen--;
|
||||
if( list_mode )
|
||||
printf(":onepass_sig packet: keyid %08lX%08lX\n"
|
||||
fprintf (listfp, ":onepass_sig packet: keyid %08lX%08lX\n"
|
||||
"\tversion %d, sigclass %02x, digest %d, pubkey %d, last=%d\n",
|
||||
(ulong)ops->keyid[0], (ulong)ops->keyid[1],
|
||||
version, ops->sig_class,
|
||||
@ -1515,16 +1535,16 @@ parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
|
||||
/* early versions of G10 use old PGP comments packets;
|
||||
* luckily all those comments are started by a hash */
|
||||
if( list_mode ) {
|
||||
printf(":rfc1991 comment packet: \"" );
|
||||
fprintf (listfp, ":rfc1991 comment packet: \"" );
|
||||
for( ; pktlen; pktlen-- ) {
|
||||
int c;
|
||||
c = iobuf_get_noeof(inp);
|
||||
if( c >= ' ' && c <= 'z' )
|
||||
putchar(c);
|
||||
putc (c, listfp);
|
||||
else
|
||||
printf("\\x%02x", c );
|
||||
fprintf (listfp, "\\x%02x", c );
|
||||
}
|
||||
printf("\"\n");
|
||||
fprintf (listfp, "\"\n");
|
||||
}
|
||||
iobuf_skip_rest(inp, pktlen, 0);
|
||||
return 0;
|
||||
@ -1560,7 +1580,7 @@ parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
|
||||
}
|
||||
algorithm = iobuf_get_noeof(inp); pktlen--;
|
||||
if( list_mode )
|
||||
printf(":%s key packet:\n"
|
||||
fprintf (listfp, ":%s key packet:\n"
|
||||
"\tversion %d, algo %d, created %lu, expires %lu\n",
|
||||
pkttype == PKT_PUBLIC_KEY? "public" :
|
||||
pkttype == PKT_SECRET_KEY? "secret" :
|
||||
@ -1602,7 +1622,7 @@ parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
|
||||
npkey = pubkey_get_npkey( algorithm );
|
||||
if( !npkey ) {
|
||||
if( list_mode )
|
||||
printf("\tunknown algorithm %d\n", algorithm );
|
||||
fprintf (listfp, "\tunknown algorithm %d\n", algorithm );
|
||||
unknown_pubkey_warning( algorithm );
|
||||
}
|
||||
|
||||
@ -1622,9 +1642,9 @@ parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
|
||||
for(i=0; i < npkey; i++ ) {
|
||||
n = pktlen; sk->skey[i] = mpi_read(inp, &n, 0 ); pktlen -=n;
|
||||
if( list_mode ) {
|
||||
printf( "\tskey[%d]: ", i);
|
||||
mpi_print(stdout, sk->skey[i], mpi_print_mode );
|
||||
putchar('\n');
|
||||
fprintf (listfp, "\tskey[%d]: ", i);
|
||||
mpi_print(listfp, sk->skey[i], mpi_print_mode );
|
||||
putc ('\n', listfp);
|
||||
}
|
||||
if (!sk->skey[i])
|
||||
rc = G10ERR_INVALID_PACKET;
|
||||
@ -1654,7 +1674,7 @@ parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
|
||||
temp[i] = iobuf_get_noeof(inp);
|
||||
if( i < 4 || memcmp( temp, "GNU", 3 ) ) {
|
||||
if( list_mode )
|
||||
printf( "\tunknown S2K %d\n",
|
||||
fprintf (listfp, "\tunknown S2K %d\n",
|
||||
sk->protect.s2k.mode );
|
||||
rc = G10ERR_INVALID_PACKET;
|
||||
goto leave;
|
||||
@ -1675,19 +1695,21 @@ parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
|
||||
break;
|
||||
}
|
||||
switch( sk->protect.s2k.mode ) {
|
||||
case 0: if( list_mode ) printf( "\tsimple S2K" );
|
||||
case 0: if( list_mode ) fprintf (listfp, "\tsimple S2K" );
|
||||
break;
|
||||
case 1: if( list_mode ) printf( "\tsalted S2K" );
|
||||
case 1: if( list_mode ) fprintf (listfp, "\tsalted S2K" );
|
||||
break;
|
||||
case 3: if( list_mode ) printf( "\titer+salt S2K" );
|
||||
case 3: if( list_mode ) fprintf (listfp, "\titer+salt S2K" );
|
||||
break;
|
||||
case 1001: if( list_mode ) printf( "\tgnu-dummy S2K" );
|
||||
case 1001: if( list_mode ) fprintf (listfp,
|
||||
"\tgnu-dummy S2K" );
|
||||
break;
|
||||
case 1002: if (list_mode) printf("\tgnu-divert-to-card S2K");
|
||||
case 1002: if (list_mode) fprintf (listfp,
|
||||
"\tgnu-divert-to-card S2K");
|
||||
break;
|
||||
default:
|
||||
if( list_mode )
|
||||
printf( "\tunknown %sS2K %d\n",
|
||||
fprintf (listfp, "\tunknown %sS2K %d\n",
|
||||
sk->protect.s2k.mode < 1000? "":"GNU ",
|
||||
sk->protect.s2k.mode );
|
||||
rc = G10ERR_INVALID_PACKET;
|
||||
@ -1695,18 +1717,18 @@ parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
|
||||
}
|
||||
|
||||
if( list_mode ) {
|
||||
printf(", algo: %d,%s hash: %d",
|
||||
fprintf (listfp, ", algo: %d,%s hash: %d",
|
||||
sk->protect.algo,
|
||||
sk->protect.sha1chk?" SHA1 protection,"
|
||||
:" simple checksum,",
|
||||
sk->protect.s2k.hash_algo );
|
||||
if( sk->protect.s2k.mode == 1
|
||||
|| sk->protect.s2k.mode == 3 ) {
|
||||
printf(", salt: ");
|
||||
fprintf (listfp, ", salt: ");
|
||||
for(i=0; i < 8; i++ )
|
||||
printf("%02x", sk->protect.s2k.salt[i]);
|
||||
fprintf (listfp, "%02x", sk->protect.s2k.salt[i]);
|
||||
}
|
||||
putchar('\n');
|
||||
putc ('\n', listfp);
|
||||
}
|
||||
|
||||
if( sk->protect.s2k.mode == 3 ) {
|
||||
@ -1717,7 +1739,7 @@ parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
|
||||
sk->protect.s2k.count = iobuf_get(inp);
|
||||
pktlen--;
|
||||
if( list_mode )
|
||||
printf("\tprotect count: %lu\n",
|
||||
fprintf (listfp, "\tprotect count: %lu\n",
|
||||
(ulong)sk->protect.s2k.count);
|
||||
}
|
||||
else if( sk->protect.s2k.mode == 1002 ) {
|
||||
@ -1741,7 +1763,7 @@ parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
|
||||
sk->protect.s2k.mode = 0;
|
||||
sk->protect.s2k.hash_algo = DIGEST_ALGO_MD5;
|
||||
if( list_mode )
|
||||
printf( "\tprotect algo: %d (hash algo: %d)\n",
|
||||
fprintf (listfp, "\tprotect algo: %d (hash algo: %d)\n",
|
||||
sk->protect.algo, sk->protect.s2k.hash_algo );
|
||||
}
|
||||
/* It is really ugly that we don't know the size
|
||||
@ -1772,11 +1794,12 @@ parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
|
||||
for(i=0; i < sk->protect.ivlen && pktlen; i++, pktlen-- )
|
||||
temp[i] = iobuf_get_noeof(inp);
|
||||
if( list_mode ) {
|
||||
printf( sk->protect.s2k.mode == 1002? "\tserial-number: "
|
||||
: "\tprotect IV: ");
|
||||
fprintf (listfp,
|
||||
sk->protect.s2k.mode == 1002? "\tserial-number: "
|
||||
: "\tprotect IV: ");
|
||||
for(i=0; i < sk->protect.ivlen; i++ )
|
||||
printf(" %02x", temp[i] );
|
||||
putchar('\n');
|
||||
fprintf (listfp, " %02x", temp[i] );
|
||||
putc ('\n', listfp);
|
||||
}
|
||||
memcpy(sk->protect.iv, temp, sk->protect.ivlen );
|
||||
}
|
||||
@ -1800,7 +1823,7 @@ parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
|
||||
read_rest(inp, pktlen, 0),pktlen);
|
||||
pktlen = 0;
|
||||
if( list_mode ) {
|
||||
printf("\tencrypted stuff follows\n");
|
||||
fprintf (listfp, "\tencrypted stuff follows\n");
|
||||
}
|
||||
}
|
||||
else { /* v3 method: the mpi length is not encrypted */
|
||||
@ -1808,16 +1831,16 @@ parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
|
||||
if ( sk->is_protected ) {
|
||||
sk->skey[i] = read_protected_v3_mpi (inp, &pktlen);
|
||||
if( list_mode )
|
||||
printf( "\tskey[%d]: [encrypted]\n", i);
|
||||
fprintf (listfp, "\tskey[%d]: [encrypted]\n", i);
|
||||
}
|
||||
else {
|
||||
n = pktlen;
|
||||
sk->skey[i] = mpi_read(inp, &n, 0 );
|
||||
pktlen -=n;
|
||||
if( list_mode ) {
|
||||
printf( "\tskey[%d]: ", i);
|
||||
mpi_print(stdout, sk->skey[i], mpi_print_mode );
|
||||
putchar('\n');
|
||||
fprintf (listfp, "\tskey[%d]: ", i);
|
||||
mpi_print(listfp, sk->skey[i], mpi_print_mode );
|
||||
putc ('\n', listfp);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1829,7 +1852,7 @@ parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
|
||||
|
||||
sk->csum = read_16(inp); pktlen -= 2;
|
||||
if( list_mode ) {
|
||||
printf("\tchecksum: %04hx\n", sk->csum);
|
||||
fprintf (listfp, "\tchecksum: %04hx\n", sk->csum);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1846,9 +1869,9 @@ parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
|
||||
for(i=0; i < npkey; i++ ) {
|
||||
n = pktlen; pk->pkey[i] = mpi_read(inp, &n, 0 ); pktlen -=n;
|
||||
if( list_mode ) {
|
||||
printf( "\tpkey[%d]: ", i);
|
||||
mpi_print(stdout, pk->pkey[i], mpi_print_mode );
|
||||
putchar('\n');
|
||||
fprintf (listfp, "\tpkey[%d]: ", i);
|
||||
mpi_print(listfp, pk->pkey[i], mpi_print_mode );
|
||||
putc ('\n', listfp);
|
||||
}
|
||||
if (!pk->pkey[i])
|
||||
rc = G10ERR_INVALID_PACKET;
|
||||
@ -1959,15 +1982,15 @@ parse_user_id( IOBUF inp, int pkttype, unsigned long pktlen, PACKET *packet )
|
||||
|
||||
if( list_mode ) {
|
||||
int n = packet->pkt.user_id->len;
|
||||
printf(":user ID packet: \"");
|
||||
fprintf (listfp, ":user ID packet: \"");
|
||||
/* fixme: Hey why don't we replace this with print_string?? */
|
||||
for(p=packet->pkt.user_id->name; n; p++, n-- ) {
|
||||
if( *p >= ' ' && *p <= 'z' )
|
||||
putchar(*p);
|
||||
putc (*p, listfp);
|
||||
else
|
||||
printf("\\x%02x", *p );
|
||||
fprintf (listfp, "\\x%02x", *p );
|
||||
}
|
||||
printf("\"\n");
|
||||
fprintf (listfp, "\"\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -2030,7 +2053,7 @@ parse_attribute( IOBUF inp, int pkttype, unsigned long pktlen, PACKET *packet )
|
||||
make_attribute_uidname(packet->pkt.user_id, EXTRA_UID_NAME_SPACE);
|
||||
|
||||
if( list_mode ) {
|
||||
printf(":attribute packet: %s\n", packet->pkt.user_id->name );
|
||||
fprintf (listfp, ":attribute packet: %s\n", packet->pkt.user_id->name );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -2049,15 +2072,15 @@ parse_comment( IOBUF inp, int pkttype, unsigned long pktlen, PACKET *packet )
|
||||
|
||||
if( list_mode ) {
|
||||
int n = packet->pkt.comment->len;
|
||||
printf(":%scomment packet: \"", pkttype == PKT_OLD_COMMENT?
|
||||
fprintf (listfp, ":%scomment packet: \"", pkttype == PKT_OLD_COMMENT?
|
||||
"OpenPGP draft " : "" );
|
||||
for(p=packet->pkt.comment->data; n; p++, n-- ) {
|
||||
if( *p >= ' ' && *p <= 'z' )
|
||||
putchar(*p);
|
||||
putc (*p, listfp);
|
||||
else
|
||||
printf("\\x%02x", *p );
|
||||
fprintf (listfp, "\\x%02x", *p );
|
||||
}
|
||||
printf("\"\n");
|
||||
fprintf (listfp, "\"\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -2084,14 +2107,14 @@ parse_trust( IOBUF inp, int pkttype, unsigned long pktlen, PACKET *pkt )
|
||||
pkt->pkt.ring_trust->sigcache = c;
|
||||
}
|
||||
if( list_mode )
|
||||
printf(":trust packet: flag=%02x sigcache=%02x\n",
|
||||
fprintf (listfp, ":trust packet: flag=%02x sigcache=%02x\n",
|
||||
pkt->pkt.ring_trust->trustval,
|
||||
pkt->pkt.ring_trust->sigcache);
|
||||
}
|
||||
else
|
||||
{
|
||||
if( list_mode )
|
||||
printf(":trust packet: empty\n");
|
||||
fprintf (listfp, ":trust packet: empty\n");
|
||||
}
|
||||
iobuf_skip_rest (inp, pktlen, 0);
|
||||
}
|
||||
@ -2136,21 +2159,21 @@ parse_plaintext( IOBUF inp, int pkttype, unsigned long pktlen,
|
||||
pktlen = 0;
|
||||
|
||||
if( list_mode ) {
|
||||
printf(":literal data packet:\n"
|
||||
fprintf (listfp, ":literal data packet:\n"
|
||||
"\tmode %c (%X), created %lu, name=\"",
|
||||
mode >= ' ' && mode <'z'? mode : '?', mode,
|
||||
(ulong)pt->timestamp );
|
||||
for(p=pt->name,i=0; i < namelen; p++, i++ ) {
|
||||
if( *p >= ' ' && *p <= 'z' )
|
||||
putchar(*p);
|
||||
putc (*p, listfp);
|
||||
else
|
||||
printf("\\x%02x", *p );
|
||||
fprintf (listfp, "\\x%02x", *p );
|
||||
}
|
||||
printf("\",\n\traw data: ");
|
||||
fprintf (listfp, "\",\n\traw data: ");
|
||||
if(partial)
|
||||
printf("unknown length\n");
|
||||
fprintf (listfp, "unknown length\n");
|
||||
else
|
||||
printf("%lu bytes\n", (ulong)pt->len );
|
||||
fprintf (listfp, "%lu bytes\n", (ulong)pt->len );
|
||||
}
|
||||
|
||||
leave:
|
||||
@ -2174,7 +2197,7 @@ parse_compressed( IOBUF inp, int pkttype, unsigned long pktlen,
|
||||
zd->new_ctb = new_ctb;
|
||||
zd->buf = inp;
|
||||
if( list_mode )
|
||||
printf(":compressed packet: algo=%d\n", zd->algorithm);
|
||||
fprintf (listfp, ":compressed packet: algo=%d\n", zd->algorithm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2223,11 +2246,12 @@ parse_encrypted( IOBUF inp, int pkttype, unsigned long pktlen,
|
||||
}
|
||||
if( list_mode ) {
|
||||
if( orig_pktlen )
|
||||
printf(":encrypted data packet:\n\tlength: %lu\n", orig_pktlen);
|
||||
fprintf (listfp, ":encrypted data packet:\n\tlength: %lu\n",
|
||||
orig_pktlen);
|
||||
else
|
||||
printf(":encrypted data packet:\n\tlength: unknown\n");
|
||||
fprintf (listfp, ":encrypted data packet:\n\tlength: unknown\n");
|
||||
if( ed->mdc_method )
|
||||
printf("\tmdc_method: %d\n", ed->mdc_method );
|
||||
fprintf (listfp, "\tmdc_method: %d\n", ed->mdc_method );
|
||||
}
|
||||
|
||||
ed->buf = inp;
|
||||
@ -2247,7 +2271,7 @@ parse_mdc( IOBUF inp, int pkttype, unsigned long pktlen,
|
||||
|
||||
mdc = pkt->pkt.mdc= m_alloc(sizeof *pkt->pkt.mdc );
|
||||
if( list_mode )
|
||||
printf(":mdc packet: length=%lu\n", pktlen);
|
||||
fprintf (listfp, ":mdc packet: length=%lu\n", pktlen);
|
||||
if( !new_ctb || pktlen != 20 ) {
|
||||
log_error("mdc_packet with invalid encoding\n");
|
||||
rc = G10ERR_INVALID_PACKET;
|
||||
@ -2283,7 +2307,7 @@ parse_gpg_control( IOBUF inp, int pkttype,
|
||||
int i;
|
||||
|
||||
if ( list_mode )
|
||||
printf(":packet 63: length %lu ", pktlen);
|
||||
fprintf (listfp, ":packet 63: length %lu ", pktlen);
|
||||
|
||||
sesmark = get_session_marker ( &sesmarklen );
|
||||
if ( pktlen < sesmarklen+1 ) /* 1 is for the control bytes */
|
||||
@ -2310,7 +2334,7 @@ parse_gpg_control( IOBUF inp, int pkttype,
|
||||
int c;
|
||||
|
||||
i=0;
|
||||
printf("- private (rest length %lu)\n", pktlen);
|
||||
fprintf (listfp, "- private (rest length %lu)\n", pktlen);
|
||||
if( partial ) {
|
||||
while( (c=iobuf_get(inp)) != -1 )
|
||||
dump_hex_line(c, &i);
|
||||
@ -2319,7 +2343,7 @@ parse_gpg_control( IOBUF inp, int pkttype,
|
||||
for( ; pktlen; pktlen-- )
|
||||
dump_hex_line(iobuf_get(inp), &i);
|
||||
}
|
||||
putchar('\n');
|
||||
putc ('\n', listfp);
|
||||
}
|
||||
iobuf_skip_rest(inp,pktlen, 0);
|
||||
return G10ERR_INVALID_PACKET;
|
||||
|
Loading…
x
Reference in New Issue
Block a user