1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-08 23:37:47 +02:00

migration to autoconf 2.52 and bugfixes

This commit is contained in:
Werner Koch 2001-07-26 09:37:47 +00:00
parent de6826d74f
commit 6732700743
38 changed files with 449 additions and 184 deletions

View File

@ -44,7 +44,7 @@ R
(g10/compress.c, g10/encr-data.c,
g10/free-packet.c, g10/mdfilter.c, g10/plaintext.c, util/iobuf.c)
Tedi Heriyanto <tedi-h@usa.net> Translations [id]
Tedi Heriyanto <tedi_h@gmx.net> Translations [id]
Thiago Jung Bauermann <jungmann@cwb.matrix.com.br> Translations [pt_BR]

View File

@ -1,3 +1,22 @@
2001-07-26 Werner Koch <wk@gnupg.org>
* configure.ac: Finally got it running with the new autoconf. Had
to define PACKAGE and VERSION and to add -I.. to each Makefile.am.
2001-07-09 Werner Koch <wk@gnupg.org>
Migrated to autoconf 2.50.
* acinclude.m4: Removed the temporary LFS macros and GNUPG_LINK_FILES.
* acconfig.h: Removed
* configure.in: Replaced by...
* configure.ac: and modified for use with autoconf 2.50, use a
literal string for the version number. Replaced GNUPG_LINK_FILES
with AC_CONFIG_LINKS and moved some informational messages to the end.
* VERSION: Removed.
* Makefile.am (DISTCLEANFILES): gettext is better now; no more
need to remove the libintl.h symlink.
(dist-hook): Create VERSION file.
2001-06-08 Werner Koch <wk@gnupg.org>
* configure.in (DYNLINK_MOD_CFLAGS): Use -shared with dec-osf.

View File

@ -26,10 +26,11 @@ endif
SUBDIRS = intl zlib util mpi cipher tools g10 po doc ${checks}
EXTRA_DIST = VERSION PROJECTS BUGS
# gettext never gets it right, so we take here care of deleting the
# symlink.
DISTCLEANFILES = g10defs.h intl/libintl.h
DISTCLEANFILES = g10defs.h
# Add all the files listed in "distfiles" files to the distribution,
# apply version numbers to some files and create a VERSION file which
# we need for the Prereq: patch file trick.
dist-hook:
@set -e; \
for file in `cd $(top_srcdir); find . -type f -name distfiles`; do \
@ -43,6 +44,4 @@ dist-hook:
sed -e 's/@pkg_version@/$(VERSION)/g' \
$(top_srcdir)/scripts/gnupg.spec.in \
> $(distdir)/scripts/gnupg.spec
echo "$(VERSION)" > $(distdir)/VERSION

2
NEWS
View File

@ -1,6 +1,8 @@
* New tool gpgsplit to split OpenPGP data formats into packets.
* New option --preserve-permissions.
Noteworthy changes in version 1.0.6 (2001-05-29)
------------------------------------------------

17
TODO
View File

@ -1,12 +1,21 @@
* replace all isfoo() by ascii_usfoo() ?
* Put a note into readme.w32 that there is a man page and a options
file; write the registry stuff in regedit format.
* Ignore subkeys created in the future.
* Allow "gpg -cs"
* Show more info does not work from edit->trust
* keyedit_menu: We first look for a secret key and then for a public
key. This is bad we must match the keys. Better check all places were
we match keys. build_sig_packet: implement update for sig-creation.
* set default charset from nl_langinfo.
* check all mpi_read() for error returns.
* --preserve-perms so that permissions set on a secring don't get changed.
* Check that no secret temporary results are stored in the result parameter
of the mpi functions. We have already done this for mpi-mul.c
@ -61,7 +70,7 @@
appropriate so that a key listing does not get clobbered.
* "Michael T. Babcock" <mbabcock@fibrespeed.net> suggested to write
an even log so that other software can display a key history or
an event log so that other software can display a key history or
alike with GnuPG results. This should be connected to the keyrings.
* Using --list-only to check for recipients while decrypting may

View File

@ -39,7 +39,7 @@ AC_DEFUN(GNUPG_CHECK_TYPEDEF,
], gnupg_cv_typedef_$1=yes, gnupg_cv_typedef_$1=no )])
AC_MSG_RESULT($gnupg_cv_typedef_$1)
if test "$gnupg_cv_typedef_$1" = yes; then
AC_DEFINE($2)
AC_DEFINE($2,1,[Defined if a `]$1[' is typedef'd])
fi
])
@ -106,26 +106,6 @@ AC_DEFUN(GNUPG_CHECK_DOCBOOK_TO_TEXI,
])
dnl GNUPG_LINK_FILES( SRC, DEST )
dnl same as AC_LINK_FILES, but collect the files to link in
dnl some special variables and do the link
dnl when GNUPG_DO_LINK_FILES is called
dnl This is a workaround for AC_LINK_FILES, because it does not work
dnl correct when using a caching scheme
dnl
define(GNUPG_LINK_FILES,
[ if test "x$wk_link_files_src" = "x"; then
wk_link_files_src="$1"
wk_link_files_dst="$2"
else
wk_link_files_src="$wk_link_files_src $1"
wk_link_files_dst="$wk_link_files_dst $2"
fi
])
define(GNUPG_DO_LINK_FILES,
[ AC_LINK_FILES( $wk_link_files_src, $wk_link_files_dst )
])
dnl GNUPG_CHECK_ENDIAN
dnl define either LITTLE_ENDIAN_HOST or BIG_ENDIAN_HOST
@ -167,9 +147,11 @@ define(GNUPG_CHECK_ENDIAN,
])
AC_MSG_RESULT([$gnupg_cv_c_endian])
if test "$gnupg_cv_c_endian" = little; then
AC_DEFINE(LITTLE_ENDIAN_HOST)
AC_DEFINE(LITTLE_ENDIAN_HOST,1,
[Defined if the host has little endian byte ordering])
else
AC_DEFINE(BIG_ENDIAN_HOST)
AC_DEFINE(BIG_ENDIAN_HOST,1,
[Defined if the host has big endian byte ordering])
fi
])
@ -337,7 +319,8 @@ define(GNUPG_CHECK_IPC,
gnupg_cv_ipc_rmid_deferred_release="assume-no")
)
if test "$gnupg_cv_ipc_rmid_deferred_release" = "yes"; then
AC_DEFINE(IPC_RMID_DEFERRED_RELEASE)
AC_DEFINE(IPC_RMID_DEFERRED_RELEASE,1,
[Defined if we can do a deferred shm release])
AC_MSG_RESULT(yes)
else
if test "$gnupg_cv_ipc_rmid_deferred_release" = "no"; then
@ -360,7 +343,8 @@ define(GNUPG_CHECK_IPC,
)
)
if test "$gnupg_cv_ipc_have_shm_lock" = "yes"; then
AC_DEFINE(IPC_HAVE_SHM_LOCK)
AC_DEFINE(IPC_HAVE_SHM_LOCK,1,
[Defined if a SysV shared memory supports the LOCK flag])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
@ -408,7 +392,8 @@ define(GNUPG_CHECK_MLOCK,
gnupg_cv_mlock_is_in_sys_mman=yes,
gnupg_cv_mlock_is_in_sys_mman=no)])
if test "$gnupg_cv_mlock_is_in_sys_mman" = "yes"; then
AC_DEFINE(HAVE_MLOCK)
AC_DEFINE(HAVE_MLOCK,1,
[Defined if the system supports an mlock() call])
fi
fi
fi
@ -448,7 +433,8 @@ define(GNUPG_CHECK_MLOCK,
)
)
if test "$gnupg_cv_have_broken_mlock" = "yes"; then
AC_DEFINE(HAVE_BROKEN_MLOCK)
AC_DEFINE(HAVE_BROKEN_MLOCK,1,
[Defined if the mlock() call does not work])
AC_MSG_RESULT(yes)
else
if test "$gnupg_cv_have_broken_mlock" = "no"; then
@ -725,7 +711,7 @@ fi
AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
if test x$ac_cv_sys_symbol_underscore = xyes; then
AC_DEFINE(WITH_SYMBOL_UNDERSCORE,1,
[define if compiled symbols have a leading underscore])
[Defined if compiled symbols have a leading underscore])
fi
])
@ -748,86 +734,8 @@ AC_CACHE_CHECK([if mkdir takes one argument], gnupg_cv_mkdir_takes_one_arg,
#endif], [mkdir ("foo", 0);],
gnupg_cv_mkdir_takes_one_arg=no, gnupg_cv_mkdir_takes_one_arg=yes)])
if test $gnupg_cv_mkdir_takes_one_arg = yes ; then
AC_DEFINE(MKDIR_TAKES_ONE_ARG)
AC_DEFINE(MKDIR_TAKES_ONE_ARG,1,
[Defined if mkdir() does not take permission flags])
fi
])
dnl AC_SYS_LARGEFILE is stolen from tar.
dnl This can be removed once the official successor to autoconf 2.13 is out.
#serial 12
dnl By default, many hosts won't let programs access large files;
dnl one must use special compiler options to get large-file access to work.
dnl For more details about this brain damage please see:
dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
dnl Written by Paul Eggert <eggert@twinsun.com>.
dnl Internal subroutine of AC_SYS_LARGEFILE.
dnl AC_SYS_LARGEFILE_TEST_INCLUDES
AC_DEFUN(AC_SYS_LARGEFILE_TEST_INCLUDES,
[[#include <sys/types.h>
int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
]])
dnl Internal subroutine of AC_SYS_LARGEFILE.
dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR,
dnl COMMENT, INCLUDES,FUNCTION-BODY)
AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE,
[AC_CACHE_CHECK([for $1 value needed for large files], $3,
[$3=no
AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES
$5
,
[$6],
,
[AC_TRY_COMPILE([#define $1 $2]
AC_SYS_LARGEFILE_TEST_INCLUDES
$5
,
[$6],
[$3=$2])])])
if test "[$]$3" != no; then
AC_DEFINE_UNQUOTED([$1], [$]$3, [$4])
fi])
AC_DEFUN(AC_SYS_LARGEFILE,
[AC_ARG_ENABLE(largefile,
[ --disable-largefile omit support for large files])
if test "$enable_largefile" != no; then
AC_CACHE_CHECK([for special C compiler options needed for large files],
ac_cv_sys_largefile_CC,
[ac_cv_sys_largefile_CC=no
if test "$GCC" != yes; then
# IRIX 6.2 and later do not support large files by default,
# so use the C compiler's -n32 option if that helps.
AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, , ,
[ac_save_CC="$CC"
CC="$CC -n32"
AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, ,
ac_cv_sys_largefile_CC=' -n32')
CC="$ac_save_CC"])
fi])
if test "$ac_cv_sys_largefile_CC" != no; then
CC="$CC$ac_cv_sys_largefile_CC"
fi
AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
ac_cv_sys_file_offset_bits,
[Number of bits in a file offset, on hosts where this is settable.])
AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1,
ac_cv_sys_largefile_source,
[Define to make ftello visible on some hosts (e.g. HP-UX 10.20).],
[#include <stdio.h>], [return !ftello;])
AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1,
ac_cv_sys_large_files,
[Define for large files, on AIX-style hosts.])
AC_SYS_LARGEFILE_MACRO_VALUE(_XOPEN_SOURCE, 500,
ac_cv_sys_xopen_source,
[Define to make ftello visible on some hosts (e.g. glibc 2.1.3).],
[#include <stdio.h>], [return !ftello;])
fi
])

View File

@ -1,3 +1,9 @@
2001-07-18 Werner Koch <wk@gnupg.org>
* rndlinux.c (gather_random): casted a size_t arg to int so that
the format string is correct. Casting is okay here and avoids
translation changes.
2001-06-12 Werner Koch <wk@gnupg.org>
* rndw32.c (slow_gatherer_windowsNT): Ditto. Not really needed here but anyway.

View File

@ -19,7 +19,7 @@
## Process this file with automake to produce Makefile.in
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/intl
INCLUDES = -I.. -I$(top_srcdir)/include -I$(top_srcdir)/intl
noinst_LIBRARIES = libcipher.a

View File

@ -141,7 +141,7 @@ gather_random( void (*add)(const void*, size_t, int), int requester,
#endif
_("\n"
"Not enough random bytes available. Please do some other work to give\n"
"the OS a chance to collect more entropy! (Need %d more bytes)\n"), length );
"the OS a chance to collect more entropy! (Need %d more bytes)\n"), (int)length );
warn = 1;
continue;
}

View File

@ -1488,6 +1488,14 @@ refer to the file descriptor n and not to a file with that name.
Experimental use only.
</para></listitem></varlistentry>
<varlistentry>
<term>--preserve-permissions</term>
<listitem><para>
Don't change the permissions of a secret keyring back to user
read/write only. Use this option only if you really know what you are doing.
</para></listitem></varlistentry>
</variablelist>
</refsect1>

View File

@ -1,3 +1,41 @@
2001-07-26 Werner Koch <wk@gnupg.org>
* parse-packet.c (parse_photo_id): Reset all variables.
* getkey.c (merge_selfsigs_main): Removed checks on PHOTO_ID
because this is handled identically to a user ID.
2001-07-06 Werner Koch <wk@gnupg.org>
* cipher.c (write_header): Don't use MDC with --rfc1991. Suggested
by disastry@saiknes.lv.
2001-07-05 Werner Koch <wk@gnupg.org>
* g10.c, options.h: New option --preserve-permissions.
* ringedit.c (add_keyblock_resource): Use it here
(keyring_copy): and here.
* trustdb.c (verify_own_keys): Be more silent on --quiet.
Suggested by Thomas Roessler.
* sig-check.c (check_key_signature2): Ditto.
* mainproc.c (proc_encrypted, proc_tree): Ditto
* getkey.c (lookup): Ditto.
2001-07-04 Werner Koch <wk@gnupg.org>
* ringedit.c (add_keyblock_resource): Restore filename in case of error.
2001-06-25 Werner Koch <wk@gnupg.org>
* kbnode.c (dump_kbnode): Print the signature timestamp.
* keyedit.c (keyedit_menu): New menu point "primary".
(change_primary_uid_cb): New.
(menu_set_primary_uid): New.
* sign.c (update_keysig_packet): New.
* build-packet.c (build_sig_subpkt): Put the primary UID flag into
the hashed area. Allow update of some more packets.
2001-06-15 Werner Koch <wk@gnupg.org>
* getkey.c (merge_selfsigs): Exit gracefully when a secret key is

View File

@ -18,7 +18,7 @@
## Process this file with automake to produce Makefile.in
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/intl
INCLUDES = -I.. -I$(top_srcdir)/include -I$(top_srcdir)/intl
EXTRA_DIST = OPTIONS pubring.asc options.skel
OMIT_DEPENDENCIES = zlib.h zconf.h
LDFLAGS = @LDFLAGS@ @DYNLINK_LDFLAGS@

View File

@ -748,7 +748,14 @@ build_sig_subpkt( PKT_signature *sig, sigsubpkttype_t type,
else if( (data = find_subpkt( sig->unhashed_data, type, &hlen, &dlen )))
found = 2;
if (found==2 && type == SIGSUBPKT_PRIV_VERIFY_CACHE) {
if (found==1 && (type == SIGSUBPKT_SIG_CREATED) ) {
unused = delete_sig_subpkt (sig->hashed_data, type);
assert (unused);
found = 0;
}
else if (found==2 && ( type == SIGSUBPKT_PRIV_VERIFY_CACHE
|| type == SIGSUBPKT_ISSUER
) ) {
unused = delete_sig_subpkt (sig->unhashed_data, type);
assert (unused);
found = 0;
@ -773,6 +780,7 @@ build_sig_subpkt( PKT_signature *sig, sigsubpkttype_t type,
case SIGSUBPKT_NOTATION:
case SIGSUBPKT_POLICY:
case SIGSUBPKT_REVOC_REASON:
case SIGSUBPKT_PRIMARY_UID:
hashed = 1; break;
default: hashed = 0; break;
}
@ -842,6 +850,7 @@ build_sig_subpkt( PKT_signature *sig, sigsubpkttype_t type,
/****************
* Put all the required stuff from SIG into subpackets of sig.
* Hmmm, should we delete those subpackets which are in a wrong area?
*/
void
build_sig_subpkt_from_sig( PKT_signature *sig )

View File

@ -54,7 +54,7 @@ write_header( cipher_filter_context_t *cfx, IOBUF a )
log_fatal("unsupported blocksize %u\n", blocksize );
if( blocksize != 8 )
use_mdc = 1; /* enable it for all modern ciphers */
if( opt.rfc2440 )
if( opt.rfc2440 || opt.rfc1991 )
use_mdc = 0; /* override - rfc2440 does not know about MDC */
memset( &ed, 0, sizeof ed );

View File

@ -206,6 +206,7 @@ enum cmd_and_opt_values { aNull = 0,
oFixedListMode,
oNoSigCache,
oNoSigCreateCheck,
oPreservePermissions,
oEmu3DESS2KBug, /* will be removed in 1.1 */
oEmuMDEncodeBug,
aTest };
@ -404,6 +405,7 @@ static ARGPARSE_OPTS opts[] = {
{ oEnableSpecialFilenames, "enable-special-filenames", 0, "@" },
{ oNoExpensiveTrustChecks, "no-expensive-trust-checks", 0, "@" },
{ aDeleteSecretAndPublicKey, "delete-secret-and-public-key",256, "@" },
{ oPreservePermissions, "preserve-permissions", 0, "@"},
{ oEmu3DESS2KBug, "emulate-3des-s2k-bug", 0, "@"},
{ oEmuMDEncodeBug, "emulate-md-encode-bug", 0, "@"},
{0} };
@ -986,6 +988,7 @@ main( int argc, char **argv )
iobuf_enable_special_filenames (1);
break;
case oNoExpensiveTrustChecks: opt.no_expensive_trust_checks=1; break;
case oPreservePermissions: opt.preserve_permissions=1; break;
default : pargs.err = configfp? 1:2; break;
}

View File

@ -1554,8 +1554,7 @@ merge_selfsigs_main( KBNODE keyblock, int *r_revoked )
sigdate = 0; /* helper to find the latest signature in one user ID */
uiddate = 0; /* and over of all user IDs */
for(k=keyblock; k && k->pkt->pkttype != PKT_PUBLIC_SUBKEY; k = k->next ) {
if ( k->pkt->pkttype == PKT_USER_ID
|| k->pkt->pkttype == PKT_PHOTO_ID ) {
if ( k->pkt->pkttype == PKT_USER_ID ) {
if ( uidnode && signode )
fixup_uidnode ( uidnode, signode, keytimestamp );
uidnode = k;
@ -1610,8 +1609,7 @@ merge_selfsigs_main( KBNODE keyblock, int *r_revoked )
uiddate = 0; /* helper to find the latest user ID */
for(k=keyblock; k && k->pkt->pkttype != PKT_PUBLIC_SUBKEY;
k = k->next ) {
if ( k->pkt->pkttype == PKT_USER_ID
|| k->pkt->pkttype == PKT_PHOTO_ID ) {
if ( k->pkt->pkttype == PKT_USER_ID ) {
PKT_user_id *uid = k->pkt->pkt.user_id;
if ( uid->help_key_usage && uid->created > uiddate ) {
key_usage = uid->help_key_usage;
@ -1637,8 +1635,7 @@ merge_selfsigs_main( KBNODE keyblock, int *r_revoked )
uiddate = 0;
for(k=keyblock; k && k->pkt->pkttype != PKT_PUBLIC_SUBKEY;
k = k->next ) {
if ( k->pkt->pkttype == PKT_USER_ID
|| k->pkt->pkttype == PKT_PHOTO_ID ) {
if ( k->pkt->pkttype == PKT_USER_ID ) {
PKT_user_id *uid = k->pkt->pkt.user_id;
if ( uid->help_key_expire && uid->created > uiddate ) {
key_expire = uid->help_key_expire;
@ -1658,8 +1655,7 @@ merge_selfsigs_main( KBNODE keyblock, int *r_revoked )
uiddate = uiddate2 = 0;
uidnode = uidnode2 = NULL;
for(k=keyblock; k && k->pkt->pkttype != PKT_PUBLIC_SUBKEY; k = k->next ) {
if ( k->pkt->pkttype == PKT_USER_ID
|| k->pkt->pkttype == PKT_PHOTO_ID ) {
if ( k->pkt->pkttype == PKT_USER_ID ) {
PKT_user_id *uid = k->pkt->pkt.user_id;
if ( uid->is_primary && uid->created > uiddate ) {
uiddate = uid->created;
@ -1674,8 +1670,7 @@ merge_selfsigs_main( KBNODE keyblock, int *r_revoked )
if ( uidnode ) {
for(k=keyblock; k && k->pkt->pkttype != PKT_PUBLIC_SUBKEY;
k = k->next ) {
if ( k->pkt->pkttype == PKT_USER_ID
|| k->pkt->pkttype == PKT_PHOTO_ID ) {
if ( k->pkt->pkttype == PKT_USER_ID ) {
PKT_user_id *uid = k->pkt->pkt.user_id;
if ( k != uidnode )
uid->is_primary = 0;
@ -2245,8 +2240,9 @@ lookup( GETKEY_CTX ctx, KBNODE *ret_keyblock, int secmode )
keyid_from_sk( k->pkt->pkt.secret_key, aki );
k = get_pubkeyblock( aki );
if( !k ) {
log_info(_("key %08lX: secret key without public key "
"- skipped\n"), (ulong)aki[1] );
if (!opt.quiet)
log_info(_("key %08lX: secret key without public key "
"- skipped\n"), (ulong)aki[1] );
goto skip;
}
secblock = ctx->keyblock;

View File

@ -164,9 +164,10 @@ find_prev_kbnode( KBNODE root, KBNODE node, int pkttype )
{
KBNODE n1;
for(n1=NULL ; root && root != node; root = root->next )
if( !pkttype || root->pkt->pkttype == pkttype )
n1 = root;
for (n1=NULL; root && root != node; root = root->next ) {
if (!pkttype ||root->pkt->pkttype == pkttype)
n1 = root;
}
return n1;
}
@ -184,7 +185,7 @@ find_next_kbnode( KBNODE node, int pkttype )
for( node=node->next ; node; node = node->next ) {
if( !pkttype )
return node;
else if( pkttype == PKT_USER_ID
else if( pkttype == PKT_USER_ID
&& ( node->pkt->pkttype == PKT_PUBLIC_KEY
|| node->pkt->pkttype == PKT_SECRET_KEY ) )
return NULL;
@ -367,9 +368,10 @@ dump_kbnode( KBNODE node )
fputs("\"\n", stderr);
}
else if( node->pkt->pkttype == PKT_SIGNATURE ) {
fprintf(stderr, " class=%02x keyid=%08lX\n",
fprintf(stderr, " class=%02x keyid=%08lX ts=%lu\n",
node->pkt->pkt.signature->sig_class,
(ulong)node->pkt->pkt.signature->keyid[1] );
(ulong)node->pkt->pkt.signature->keyid[1],
(ulong)node->pkt->pkt.signature->timestamp);
}
else if( node->pkt->pkttype == PKT_GPG_CONTROL ) {
fprintf(stderr, " ctrl=%d len=%u\n",

View File

@ -50,6 +50,7 @@ static void menu_deluid( KBNODE pub_keyblock, KBNODE sec_keyblock );
static int menu_delsig( KBNODE pub_keyblock );
static void menu_delkey( KBNODE pub_keyblock, KBNODE sec_keyblock );
static int menu_expire( KBNODE pub_keyblock, KBNODE sec_keyblock );
static int menu_set_primary_uid( KBNODE pub_keyblock, KBNODE sec_keyblock );
static int menu_select_uid( KBNODE keyblock, int idx );
static int menu_select_key( KBNODE keyblock, int idx );
static int count_uids( KBNODE keyblock );
@ -107,7 +108,7 @@ get_keyblock_byname( KBNODE *keyblock, KBPOS *kbpos, const char *username )
/****************
* Print information about a signature, chek it and return true
* Print information about a signature, check it and return true
* if the signature is okay. NODE must be a signature packet.
*/
static int
@ -566,7 +567,7 @@ keyedit_menu( const char *username, STRLIST locusr, STRLIST commands,
{
enum cmdids { cmdNONE = 0,
cmdQUIT, cmdHELP, cmdFPR, cmdLIST, cmdSELUID, cmdCHECK, cmdSIGN,
cmdLSIGN, cmdREVSIG, cmdREVKEY, cmdDELSIG,
cmdLSIGN, cmdREVSIG, cmdREVKEY, cmdDELSIG, cmdPRIMARY,
cmdDEBUG, cmdSAVE, cmdADDUID, cmdDELUID, cmdADDKEY, cmdDELKEY,
cmdTOGGLE, cmdSELKEY, cmdPASSWD, cmdTRUST, cmdPREF, cmdEXPIRE,
cmdENABLEKEY, cmdDISABLEKEY, cmdSHOWPREF,
@ -600,6 +601,7 @@ keyedit_menu( const char *username, STRLIST locusr, STRLIST commands,
{ N_("delkey") , cmdDELKEY , 0,1,0, N_("delete a secondary key") },
{ N_("delsig") , cmdDELSIG , 0,1,0, N_("delete signatures") },
{ N_("expire") , cmdEXPIRE , 1,1,0, N_("change the expire date") },
{ N_("primary") , cmdPRIMARY , 1,1,0, N_("flag user ID as primary")},
{ N_("toggle") , cmdTOGGLE , 1,0,0, N_("toggle between secret "
"and public key listing") },
{ N_("t" ) , cmdTOGGLE , 1,0,0, NULL },
@ -914,6 +916,14 @@ keyedit_menu( const char *username, STRLIST locusr, STRLIST commands,
}
break;
case cmdPRIMARY:
if( menu_set_primary_uid ( keyblock, sec_keyblock ) ) {
merge_keys_and_selfsig( keyblock );
modified = 1;
redisplay = 1;
}
break;
case cmdPASSWD:
if( change_passphrase( sec_keyblock ) )
sec_modified = 1;
@ -1630,6 +1640,126 @@ menu_expire( KBNODE pub_keyblock, KBNODE sec_keyblock )
}
static int
change_primary_uid_cb ( PKT_signature *sig, void *opaque )
{
byte buf[1];
/* first clear all primary uid flags so that we are sure none are
* lingering around */
delete_sig_subpkt (sig->hashed_data, SIGSUBPKT_PRIMARY_UID);
delete_sig_subpkt (sig->unhashed_data, SIGSUBPKT_PRIMARY_UID);
/* if opaque is set,we want to set the primary id */
if (opaque) {
buf[0] = 1;
build_sig_subpkt (sig, SIGSUBPKT_PRIMARY_UID, buf, 1 );
}
return 0;
}
/*
* Set the primary uid flag for the selected UID. We will also reset
* all other primary uid flags. For this to work with have to update
* all the signature timestamps. If we would do this with the current
* time, we lose quite a lot of information, so we use a a kludge to
* do this: Just increment the timestamp by one second which is
* sufficient to updated a signature during import.
*/
static int
menu_set_primary_uid ( KBNODE pub_keyblock, KBNODE sec_keyblock )
{
PKT_secret_key *sk; /* copy of the main sk */
PKT_public_key *main_pk;
PKT_user_id *uid;
KBNODE node;
u32 keyid[2];
int selected;
int modified = 0;
if ( count_selected_uids (pub_keyblock) != 1 ) {
tty_printf(_("Please select exactly one user ID.\n"));
return 0;
}
node = find_kbnode( sec_keyblock, PKT_SECRET_KEY );
sk = copy_secret_key( NULL, node->pkt->pkt.secret_key);
/* Now we can actually change the self signature(s) */
main_pk = NULL;
uid = NULL;
selected = 0;
for ( node=pub_keyblock; node; node = node->next ) {
if ( node->pkt->pkttype == PKT_PUBLIC_SUBKEY )
break; /* ready */
if ( node->pkt->pkttype == PKT_PUBLIC_KEY ) {
main_pk = node->pkt->pkt.public_key;
keyid_from_pk( main_pk, keyid );
}
else if ( node->pkt->pkttype == PKT_USER_ID ) {
uid = node->pkt->pkt.user_id;
selected = node->flag & NODFLG_SELUID;
}
else if ( main_pk && uid && node->pkt->pkttype == PKT_SIGNATURE ) {
PKT_signature *sig = node->pkt->pkt.signature;
if ( keyid[0] == sig->keyid[0] && keyid[1] == sig->keyid[1]
&& (uid && (sig->sig_class&~3) == 0x10)
&& sig->version >= 4 ) {
/* this is a selfsignature which is to be replaced
* we can just ignore v3 signatures because they are
* not able to carry the primary ID flag */
/* FIXME: We must make sure that we only have one
self-signature per user ID here (not counting
revocations) */
PKT_signature *newsig;
PACKET *newpkt;
const byte *p;
int action;
/* see whether this signature has the primary UID flag */
p = parse_sig_subpkt (sig->hashed_data,
SIGSUBPKT_PRIMARY_UID, NULL );
if ( !p )
p = parse_sig_subpkt (sig->unhashed_data,
SIGSUBPKT_PRIMARY_UID, NULL );
if ( p && *p ) /* yes */
action = selected? 0 : -1;
else /* no */
action = selected? 1 : 0;
if (action) {
int rc = update_keysig_packet (&newsig, sig,
main_pk, uid,
sk,
change_primary_uid_cb,
action > 0? "x":NULL );
if( rc ) {
log_error ("update_keysig_packet failed: %s\n",
g10_errstr(rc));
free_secret_key( sk );
return 0;
}
/* replace the packet */
newpkt = m_alloc_clear( sizeof *newpkt );
newpkt->pkttype = PKT_SIGNATURE;
newpkt->pkt.signature = newsig;
free_packet( node->pkt );
m_free( node->pkt );
node->pkt = newpkt;
modified = 1;
}
}
}
}
free_secret_key( sk );
return modified;
}
/****************
* Select one user id or remove all selection if index is 0.
* Returns: True if the selection changed;

View File

@ -667,7 +667,6 @@ reorder_keyblock (KBNODE keyblock)
primary = primary2 = node;
for (node=node->next; node; primary2=node, node = node->next ) {
if( node->pkt->pkttype == PKT_USER_ID
|| node->pkt->pkttype == PKT_PHOTO_ID
|| node->pkt->pkttype == PKT_PUBLIC_SUBKEY
|| node->pkt->pkttype == PKT_SECRET_SUBKEY ) {
break;

View File

@ -398,8 +398,10 @@ proc_encrypted( CTX c, PACKET *pkt )
{
int result = 0;
print_pkenc_list( c->pkenc_list, 1 );
print_pkenc_list( c->pkenc_list, 0 );
if (!opt.quiet) {
print_pkenc_list ( c->pkenc_list, 1 );
print_pkenc_list ( c->pkenc_list, 0 );
}
write_status( STATUS_BEGIN_DECRYPTION );
@ -1272,7 +1274,7 @@ check_sig_and_print( CTX c, KBNODE node )
write_status_text( rc? STATUS_BADSIG : STATUS_GOODSIG, us );
m_free(us);
/* find an print the primary user ID */
/* find and print the primary user ID */
for( un=keyblock; un; un = un->next ) {
if( un->pkt->pkttype != PKT_USER_ID )
continue;
@ -1507,7 +1509,7 @@ proc_tree( CTX c, KBNODE node )
}
else if ( c->pipemode.op == 'B' )
; /* this is a detached signature trough the pipemode handler */
else
else if (!opt.quiet)
log_info(_("old style (PGP 2.x) signature\n"));
for( n1 = node; n1; (n1 = find_next_kbnode(n1, PKT_SIGNATURE )) )

View File

@ -103,6 +103,7 @@ struct {
int no_expensive_trust_checks;
int no_sig_cache;
int no_sig_create_check;
int preserve_permissions;
} opt;

View File

@ -405,6 +405,13 @@ int make_keysig_packet( PKT_signature **ret_sig, PKT_public_key *pk,
int sigclass, int digest_algo,
int (*mksubpkt)(PKT_signature *, void *),
void *opaque );
int update_keysig_packet( PKT_signature **ret_sig,
PKT_signature *orig_sig,
PKT_public_key *pk,
PKT_user_id *uid,
PKT_secret_key *sk,
int (*mksubpkt)(PKT_signature *, void *),
void *opaque );
/*-- keygen.c --*/
PKT_user_id *generate_user_id(void);

View File

@ -423,7 +423,7 @@ parse( IOBUF inp, PACKET *pkt, int reqtype, off_t *retpos,
rc = parse_user_id(inp, pkttype, pktlen, pkt );
break;
case PKT_PHOTO_ID:
pkt->pkttype = pkttype = PKT_USER_ID; /* must fix it */
pkt->pkttype = pkttype = PKT_USER_ID; /* we store it in the userID */
rc = parse_photo_id(inp, pkttype, pktlen, pkt);
break;
case PKT_OLD_COMMENT:
@ -1625,6 +1625,11 @@ parse_photo_id( IOBUF inp, int pkttype, unsigned long pktlen, PACKET *packet )
packet->pkt.user_id = m_alloc(sizeof *packet->pkt.user_id + 30);
sprintf( packet->pkt.user_id->name, "[image of size %lu]", pktlen );
packet->pkt.user_id->len = strlen(packet->pkt.user_id->name);
packet->pkt.user_id->is_primary = 0;
packet->pkt.user_id->is_revoked = 0;
packet->pkt.user_id->created = 0;
packet->pkt.user_id->help_key_usage = 0;
packet->pkt.user_id->help_key_expire = 0;
packet->pkt.user_id->photo = m_alloc(sizeof *packet->pkt.user_id + pktlen);
packet->pkt.user_id->photolen = pktlen;

View File

@ -292,6 +292,7 @@ add_keyblock_resource( const char *url, int force, int secret )
*/
try_make_homedir( filename );
rc = G10ERR_OPEN_FILE;
*last_slash_in_filename = '/';
goto leave;
}
@ -306,7 +307,7 @@ add_keyblock_resource( const char *url, int force, int secret )
}
else {
#ifndef HAVE_DOSISH_SYSTEM
if( secret ) {
if( secret && !opt.preserve_permissions ) {
if( chmod( filename, S_IRUSR | S_IWUSR ) ) {
log_error("%s: chmod failed: %s\n",
filename, strerror(errno) );
@ -1519,7 +1520,7 @@ keyring_copy( KBPOS *kbpos, int mode, KBNODE root )
}
/* if the new file is a secring, restrict the permissions */
#ifndef HAVE_DOSISH_SYSTEM
if( rentry->secret ) {
if( rentry->secret && !opt.preserve_permissions ) {
if( chmod( tmpfname, S_IRUSR | S_IWUSR ) ) {
log_error("%s: chmod failed: %s\n",
tmpfname, strerror(errno) );

View File

@ -546,7 +546,8 @@ check_key_signature2( KBNODE root, KBNODE node, int *is_selfsig,
md_close(md);
}
else {
log_info ("no subkey for subkey revocation packet\n");
if (!opt.quiet)
log_info ("no subkey for subkey revocation packet\n");
rc = G10ERR_SIG_CLASS;
}
}

View File

@ -24,6 +24,7 @@
#include <string.h>
#include <errno.h>
#include <assert.h>
#include <unistd.h> /* need sleep() */
#include "options.h"
#include "packet.h"
@ -905,3 +906,108 @@ make_keysig_packet( PKT_signature **ret_sig, PKT_public_key *pk,
}
/****************
* Create a new signature packet based on an existing one.
* Only user ID signatureare supportted for now.
* TODO: Merge this with make_keysig_packet.
*/
int
update_keysig_packet( PKT_signature **ret_sig,
PKT_signature *orig_sig,
PKT_public_key *pk,
PKT_user_id *uid,
PKT_secret_key *sk,
int (*mksubpkt)(PKT_signature *, void *),
void *opaque
)
{
PKT_signature *sig;
int rc=0;
MD_HANDLE md;
if (!orig_sig || !pk || !uid || !sk)
return G10ERR_GENERAL;
if (orig_sig->sig_class < 0x10 || orig_sig->sig_class > 0x13 )
return G10ERR_GENERAL;
md = md_open( orig_sig->digest_algo, 0 );
/* hash the public key certificate and the user id */
hash_public_key( md, pk );
if( orig_sig->version >= 4 ) {
byte buf[5];
buf[0] = 0xb4; /* indicates a userid packet */
buf[1] = uid->len >> 24; /* always use 4 length bytes */
buf[2] = uid->len >> 16;
buf[3] = uid->len >> 8;
buf[4] = uid->len;
md_write( md, buf, 5 );
}
md_write( md, uid->name, uid->len );
/* create a new signature packet */
sig = copy_signature (NULL, orig_sig);
if ( sig->version >= 4 && mksubpkt)
rc = (*mksubpkt)(sig, opaque);
/* we increasethe timestamp by one second so that a future import
of this key will replace the existing one. We make sure that
we don't produce a timestamp in the future */
sig->timestamp++;
while (sig->timestamp >= make_timestamp())
sleep (1);
/* put the updated timestamp back into the data */
if( sig->version >= 4 )
build_sig_subpkt_from_sig( sig );
if (!rc) {
if (sig->version >= 4)
md_putc (md, sig->version);
md_putc (md, sig->sig_class);
if (sig->version < 4) {
u32 a = sig->timestamp;
md_putc( md, (a >> 24) & 0xff );
md_putc( md, (a >> 16) & 0xff );
md_putc( md, (a >> 8) & 0xff );
md_putc( md, a & 0xff );
}
else {
byte buf[6];
size_t n;
md_putc( md, sig->pubkey_algo );
md_putc( md, sig->digest_algo );
if( sig->hashed_data ) {
n = (sig->hashed_data[0] << 8) | sig->hashed_data[1];
md_write( md, sig->hashed_data, n+2 );
n += 6;
}
else {
md_putc( md, 0 ); /* always hash the length of the subpacket*/
md_putc( md, 0 );
n = 6;
}
/* add some magic */
buf[0] = sig->version;
buf[1] = 0xff;
buf[2] = n >> 24; /* hmmm, n is only 16 bit, so this is always 0 */
buf[3] = n >> 16;
buf[4] = n >> 8;
buf[5] = n;
md_write( md, buf, 6 );
}
md_final(md);
rc = complete_sig( sig, sk, md );
}
md_close (md);
if( rc )
free_seckey_enc (sig);
else
*ret_sig = sig;
return rc;
}

View File

@ -328,7 +328,7 @@ list_records( ulong lid )
/****************
* Dump the complte trustdb or only the entries of one key.
* Dump the entire trustdb or only the entries of one key.
*/
void
list_trustdb( const char *username )

View File

@ -574,8 +574,9 @@ verify_own_keys(void)
memset( pk, 0, sizeof *pk );
rc = get_pubkey( pk, keyid );
if( rc ) {
log_info(_("key %08lX: secret key without public key - skipped\n"),
(ulong)keyid[1] );
if (!opt.quiet)
log_info(_("key %08lX: secret key without public key "
"- skipped\n"), (ulong)keyid[1] );
goto skip;
}
have_pk=1;

View File

@ -1,3 +1,8 @@
2001-07-09 Werner Koch <wk@gnupg.org>
* config.links: Changed the way the list of files to be
symlinked is returned.
2001-05-27 Werner Koch <wk@gnupg.org>
* hppa/, hppa1.1/, pa7100/ : Use .label command instead of labels

View File

@ -19,7 +19,7 @@
## Process this file with automake to produce Makefile.in
INCLUDES = -I$(top_srcdir)/include
INCLUDES = -I.. -I$(top_srcdir)/include
CFLAGS = @CFLAGS@ @MPI_OPT_FLAGS@
ASFLAGS = @MPI_SFLAGS@

View File

@ -18,7 +18,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
# sourced by ../configure to get the list of files to link
# this should set $mpi_ln_src and mpi_ln_dst.
# this should set $mpi_ln_list.
# Note: this is called from the above directory.
@ -274,8 +274,7 @@ mpi_ln_modules="${mpi_extra_modules} mpih-add1 mpih-mul1 mpih-mul2 mpih-mul3 \
mpih-lshift mpih-rshift mpih-sub1"
mpi_ln_objects=
mpi_ln_src=
mpi_ln_dst=
mpi_ln_list=
# try to get file to link from the assembler subdirectory and
# if this fails get it from the generic subdirectory.
@ -285,12 +284,10 @@ for fn in $mpi_ln_modules ; do
for dir in $path ; do
rm -f $srcdir/mpi/$fn.[Sc]
if test -f $srcdir/mpi/$dir/$fn.S ; then
mpi_ln_src="$mpi_ln_src mpi/$dir/$fn.S"
mpi_ln_dst="$mpi_ln_dst mpi/$fn.S"
mpi_ln_list="$mpi_ln_list mpi/$fn.S:mpi/$dir/$fn.S"
break;
elif test -f $srcdir/mpi/$dir/$fn.c ; then
mpi_ln_src="$mpi_ln_src mpi/$dir/$fn.c"
mpi_ln_dst="$mpi_ln_dst mpi/$fn.c"
mpi_ln_list="$mpi_ln_list mpi/$fn.c:mpi/$dir/$fn.c"
break;
fi
done
@ -299,10 +296,9 @@ done
# Same thing for the file which defines the limb size
path="$path generic"
for dir in $path ; do
rm -f $srcdir/mpi/mpi-asm-defs.h
if test -f $srcdir/mpi/$dir/mpi-asm-defs.h ; then
mpi_ln_src="$mpi_ln_src mpi/$dir/mpi-asm-defs.h"
mpi_ln_dst="$mpi_ln_dst mpi/mpi-asm-defs.h"
break;
fi
rm -f $srcdir/mpi/mpi-asm-defs.h
if test -f $srcdir/mpi/$dir/mpi-asm-defs.h ; then
mpi_ln_list="$mpi_ln_list mpi/mpi-asm-defs.h:mpi/$dir/mpi-asm-defs.h"
break;
fi
done

View File

@ -1,3 +1,11 @@
2001-07-26 gettextize <bug-gnu-utils@gnu.org>
* Makefile.in.in: Upgrade to gettext-0.10.38.
2001-07-05 Werner Koch <wk@gnupg.org>
* id.po: Updated
2001-05-28 Werner Koch <wk@gnupg.org>
* ru.po: Removed - too many format string bugs.

View File

@ -1,13 +1,13 @@
# GNU Privacy Guard 1.0.5 (Indonesian)
# GNU Privacy Guard 1.0.6 (Indonesian)
# Copyright (C) 1999, 2001 Free Software Foundation, Inc.
# Tedi Heriyanto <tedi-h@usa.net>, 1999-2001.
# Tedi Heriyanto <tedi_h@gmx.net>, 1999-2001.
#
msgid ""
msgstr ""
"Project-Id-Version: GNU Privacy Guard 1.0.4\n"
"Project-Id-Version: GNUPG 1.0.6\n"
"POT-Creation-Date: 2001-05-29 08:58+0200\n"
"PO-Revision-Date: 2001-04-30 15:19GMT+0700\n"
"Last-Translator: Tedi Heriyanto <tedi-h@usa.net>\n"
"PO-Revision-Date: 2001-06-01 16:41GMT+0700\n"
"Last-Translator: Tedi Heriyanto <tedi_h@gmx.net>\n"
"Language-Team: Indonesian <id@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ISO-8859-1\n"
@ -598,9 +598,8 @@ msgid "|FD|write status info to this FD"
msgstr "|FD|tulis info status ke FD ini"
#: g10/g10.c:310
#, fuzzy
msgid "|KEYID|ultimately trust this key"
msgstr "|KEYID|sangat percaya kunci ini"
msgstr "|KEYID|sangat percayai kunci ini"
#: g10/g10.c:311
msgid "|FILE|load extension module FILE"
@ -1617,7 +1616,7 @@ msgstr ""
#: g10/keygen.c:1759
msgid "NOTE: creating subkeys for v3 keys is not OpenPGP compliant\n"
msgstr ""
msgstr "CATATAN: membuat subkey bagi kunci-kunci v3 tidak OpenPGP compliant\n"
#: g10/keygen.c:1786
msgid "Really create? "

View File

@ -1,3 +1,7 @@
2001-07-09 Werner Koch <wk@gnupg.org>
* autogen.sh (autoconf_vers): Require autoconf 2.50
2001-05-06 Werner Koch <wk@gnupg.org>
* config.guess, config.sub: Add updates from subversions.gnu.org.

View File

@ -13,7 +13,7 @@
PGM=GnuPG
lib_config_files=""
autoconf_vers=2.13
autoconf_vers=2.50
automake_vers=1.4
aclocal_vers=1.4

View File

@ -19,7 +19,7 @@
## Process this file with automake to produce Makefile.in
EXTRA_DIST = lspgpot ring-a-party mail-signed-keys
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/intl
INCLUDES = -I.. -I$(top_srcdir)/include -I$(top_srcdir)/intl
needed_libs = ../cipher/libcipher.a \
../mpi/libmpi.a ../util/libutil.a @INTLLIBS@

View File

@ -19,7 +19,7 @@
*/
/*
* TODO: Add an option to uncompress packets. This should come wuite handy.
* TODO: Add an option to uncompress packets. This should come quite handy.
*/
#include <config.h>
@ -49,13 +49,14 @@ enum cmd_and_opt_values { aNull = 0,
oPrefix = 'p',
aTest };
#warning Add an option to split a keyring into reasonable sized chunks.
static ARGPARSE_OPTS opts[] = {
{ 301, NULL, 0, "@\nOptions:\n " },
{ 301, NULL, 0, "@Options:\n " },
{ oVerbose, "verbose", 0, "verbose" },
{ oPrefix, "prefix", 2, "|STRING| Prepend filenames with STRING" },
{ oPrefix, "prefix", 2, "|STRING|Prepend filenames with STRING" },
{0} };

View File

@ -18,7 +18,7 @@
## Process this file with automake to produce Makefile.in
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/intl
INCLUDES = -I.. -I$(top_srcdir)/include -I$(top_srcdir)/intl
noinst_LIBRARIES = libutil.a