1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-05-24 16:43:28 +02:00

* keyserver.c (keyserver_spawn): Removed some variables

declaration due to shadowing warnings.
* build-packet.c (build_attribute_subpkt): s/index/idx/ to avoid
compiler warnig due to index(3).
* getkey.c (get_ctx_handle): Use KEYDB_HANDLE as return value.
* keylist.c (list_one): Made resname const.
* keyedit.c (keyedit_menu): Allow "addphoto" only when --openpgp is
not used.
* options.skel: Changed one example photo viewer to qiv.
This commit is contained in:
Werner Koch 2001-12-22 13:04:24 +00:00
parent 9837a415b4
commit ab430c4b24
8 changed files with 131 additions and 27 deletions

View File

@ -1,8 +1,109 @@
2001-12-22 Timo Schulz <ts@winpt.org> 2001-12-22 Timo Schulz <ts@winpt.org>
* encode.c (encode_simple, encode_crypt): Use is_file_compressed * encode.c (encode_simple, encode_crypt): Use is_file_compressed
to avoid to compress compressed files. to avoid to compress compressed files.
2001-12-22 Werner Koch <wk@gnupg.org>
* keyserver.c (keyserver_spawn): Removed some variables
declaration due to shadowing warnings.
* build-packet.c (build_attribute_subpkt): s/index/idx/ to avoid
compiler warnig due to index(3).
* getkey.c (get_ctx_handle): Use KEYDB_HANDLE as return value.
* keylist.c (list_one): Made resname const.
* keyedit.c (keyedit_menu): Allow "addphoto" only when --openpgp is
not used.
* options.skel: Changed one example photo viewer to qiv.
2001-12-21 David Shaw <dshaw@jabberwocky.com>
* Makefile.am: add exec.c, exec.h, photoid.c, and photoid.h
* build-packet.c (build_attribute_subpkt): new function to build
the raw attribute subpacket. Note that attribute subpackets have
the same format as signature subpackets.
* exec.c: new file with generic exec-a-program functionality.
Used by both photo IDs and keyserver helpers. This is pretty much
the same code that used to be keyserver specific, with some
changes to be usable generically.
* free-packet.c (free_attributes (new)): function to free an
attribute packet.
* gpgv.c: added stub show_photo
* keyedit.c (keyedit_menu, menu_adduid, menu_showphoto): can add a
photo (calls generate_photo_id), or display a photo (calls
show_photo) from the --edit menu. New commands are "addphoto",
and "delphoto" (same as "deluid").
* keylist.c (list_keyblock_print): show photos during key list if
--show-photos enabled.
* keyserver.c (keyserver_spawn): use the generic exec_xxx
functions to call keyserver helper.
* g10.c, options.h: three new options - --{no-}show-photos, and
--photo-viewer to give the command line to display a picture.
* options.skel: instructions for the photo viewer
* parse-packet.c (parse_user_id, setup_user_id (new)): common code
for both user IDs and attribute IDs moved to setup_user_id.
* parse-packet.c (make_attribute_uidname (new)): constructs a fake
"name" for attribute packets (e.g. "[image of size ...]")
* parse-packet.c (parse_attribute (replaces parse_photo_id),
parse_attribute_subpkts): Builds an array of individual
attributes. Currently only handles attribute image / type jpeg
subpackets.
* sign.c (hash_uid): Fix bug in signing attribute (formerly
photo_id) packets.
* packet.h, and callers: globally change "photo_id" to "attribute"
and add structures for attributes. The packet format is generic
attributes, even though the only attribute type thus far defined
is jpeg.
2001-12-21 David Shaw <dshaw@jabberwocky.com>
* parse-packet.c (can_handle_critical): Can handle critical
revocation subpackets now.
* trustdb.c (mark_usable_uid_certs): Disregard revocations for
nonrevocable sigs. Note that this allows a newer revocable
signature to override an older nonrevocable signature.
* sign.c (make_keysig_packet): add a duration field and change all
callers. This makes make_keysig_packet closer to
write_signature_packets and removes some duplicated expiration
code.
* keyedit.c (keyedit_menu, menu_revsig, sign_uids,
sign_mk_attrib): Add nrsign command, don't allow revoking a
nonrevocable signature,
* g10.c (main): Add --nrsign option to nonrevocably sign a key
from the command line.
* build-packet.c (build_sig_subpkt_from_sig): Comment to explain
the use of CRITICAL.
2001-12-21 Werner Koch <wk@gnupg.org>
* g10.c. options.h : New option --show-keyring
* getkey.c (get_ctx_handle): New.
* keylist.c (list_one): Implement option here. By David Champion.
=======
>>>>>>> 1.162.2.192
2001-12-20 David Shaw <dshaw@jabberwocky.com> 2001-12-20 David Shaw <dshaw@jabberwocky.com>
* keyserver.c (keyserver_spawn): Use mkdtemp() to make temp * keyserver.c (keyserver_spawn): Use mkdtemp() to make temp

View File

@ -916,23 +916,23 @@ build_attribute_subpkt(PKT_user_id *uid,byte type,
const void *header,int headerlen) const void *header,int headerlen)
{ {
byte *attrib; byte *attrib;
int index; int idx;
if(1+headerlen+buflen>8383) if(1+headerlen+buflen>8383)
index=5; idx=5;
else if(1+headerlen+buflen>191) else if(1+headerlen+buflen>191)
index=2; idx=2;
else else
index=1; idx=1;
/* realloc uid->attrib_data to the right size */ /* realloc uid->attrib_data to the right size */
uid->attrib_data=m_realloc(uid->attrib_data, uid->attrib_data=m_realloc(uid->attrib_data,
uid->attrib_len+index+headerlen+buflen); uid->attrib_len+idx+headerlen+buflen);
attrib=&uid->attrib_data[uid->attrib_len]; attrib=&uid->attrib_data[uid->attrib_len];
if(index==5) if(idx==5)
{ {
attrib[0]=255; attrib[0]=255;
attrib[1]=(1+headerlen+buflen) >> 24; attrib[1]=(1+headerlen+buflen) >> 24;
@ -940,7 +940,7 @@ build_attribute_subpkt(PKT_user_id *uid,byte type,
attrib[3]=(1+headerlen+buflen) >> 8; attrib[3]=(1+headerlen+buflen) >> 8;
attrib[4]=1+headerlen+buflen; attrib[4]=1+headerlen+buflen;
} }
else if(index==2) else if(idx==2)
{ {
attrib[0]=(1+headerlen+buflen-192) / 256 + 192; attrib[0]=(1+headerlen+buflen-192) / 256 + 192;
attrib[1]=(1+headerlen+buflen-192) % 256; attrib[1]=(1+headerlen+buflen-192) % 256;
@ -948,13 +948,13 @@ build_attribute_subpkt(PKT_user_id *uid,byte type,
else else
attrib[0]=1+headerlen+buflen; /* Good luck finding a JPEG this small! */ attrib[0]=1+headerlen+buflen; /* Good luck finding a JPEG this small! */
attrib[index++]=type; attrib[idx++]=type;
/* Tack on our data at the end */ /* Tack on our data at the end */
memcpy(&attrib[index],header,headerlen); memcpy(&attrib[idx],header,headerlen);
memcpy(&attrib[index+headerlen],buf,buflen); memcpy(&attrib[idx+headerlen],buf,buflen);
uid->attrib_len+=index+headerlen+buflen; uid->attrib_len+=idx+headerlen+buflen;
} }
static int static int

View File

@ -2194,7 +2194,7 @@ get_user_id( u32 *keyid, size_t *rn )
return p; return p;
} }
const char* KEYDB_HANDLE
get_ctx_handle(GETKEY_CTX ctx) get_ctx_handle(GETKEY_CTX ctx)
{ {
return ctx->kr_handle; return ctx->kr_handle;

View File

@ -209,7 +209,7 @@ char*get_user_id_string( u32 *keyid );
char*get_user_id_string_native( u32 *keyid ); char*get_user_id_string_native( u32 *keyid );
char*get_long_user_id_string( u32 *keyid ); char*get_long_user_id_string( u32 *keyid );
char*get_user_id( u32 *keyid, size_t *rn ); char*get_user_id( u32 *keyid, size_t *rn );
const char*get_ctx_handle(GETKEY_CTX ctx); KEYDB_HANDLE get_ctx_handle(GETKEY_CTX ctx);
/*-- keyid.c --*/ /*-- keyid.c --*/
int pubkey_letter( int algo ); int pubkey_letter( int algo );

View File

@ -1029,6 +1029,12 @@ keyedit_menu( const char *username, STRLIST locusr, STRLIST commands,
break; break;
case cmdADDPHOTO: case cmdADDPHOTO:
if (opt.rfc2440)
{
tty_printf(
_("This command is not allowed while in OpenPGP mode.\n"));
break;
}
photo=1; photo=1;
/* fall through */ /* fall through */

View File

@ -174,7 +174,7 @@ list_one( STRLIST names, int secret )
int rc = 0; int rc = 0;
KBNODE keyblock = NULL; KBNODE keyblock = NULL;
GETKEY_CTX ctx; GETKEY_CTX ctx;
char *resname; const char *resname;
char *keyring_str = N_("Keyring"); char *keyring_str = N_("Keyring");
int i; int i;

View File

@ -259,7 +259,7 @@ print_keyinfo(int count,char *keystring,u32 *keyid)
static int static int
keyserver_spawn(int action,STRLIST list,u32 (*kidlist)[2],int count,int *prog) keyserver_spawn(int action,STRLIST list,u32 (*kidlist)[2],int count,int *prog)
{ {
int ret=0,i,gotversion=0; int ret=0,i, gotversion=0;
STRLIST temp; STRLIST temp;
unsigned int maxlen=256,buflen; unsigned int maxlen=256,buflen;
char *command=NULL,*searchstr=NULL; char *command=NULL,*searchstr=NULL;
@ -327,8 +327,6 @@ keyserver_spawn(int action,STRLIST list,u32 (*kidlist)[2],int count,int *prog)
{ {
case GET: case GET:
{ {
int i;
fprintf(spawn->tochild,"COMMAND GET\n\n"); fprintf(spawn->tochild,"COMMAND GET\n\n");
/* Which keys do we want? */ /* Which keys do we want? */
@ -344,7 +342,7 @@ keyserver_spawn(int action,STRLIST list,u32 (*kidlist)[2],int count,int *prog)
case SEND: case SEND:
{ {
STRLIST key,temp; STRLIST key;
/* Note the extra \n here to send an empty keylist block */ /* Note the extra \n here to send an empty keylist block */
fprintf(spawn->tochild,"COMMAND SEND\n\n\n"); fprintf(spawn->tochild,"COMMAND SEND\n\n\n");
@ -491,10 +489,9 @@ keyserver_spawn(int action,STRLIST list,u32 (*kidlist)[2],int count,int *prog)
case SEARCH: case SEARCH:
{ {
byte *line=NULL; line=NULL;
unsigned int buflen=0,maxlen=80; buflen = 0;
int count; maxlen = 80;
/* Look for the COUNT line */ /* Look for the COUNT line */
do do
{ {
@ -504,9 +501,9 @@ keyserver_spawn(int action,STRLIST list,u32 (*kidlist)[2],int count,int *prog)
goto fail; /* i.e. EOF */ goto fail; /* i.e. EOF */
} }
} }
while(sscanf(line,"COUNT %d\n",&count)!=1); while(sscanf(line,"COUNT %d\n",&i)!=1);
keyserver_search_prompt(spawn->fromchild,count,searchstr); keyserver_search_prompt(spawn->fromchild,i,searchstr);
break; break;
} }

View File

@ -171,7 +171,7 @@ lock-once
# The default program is "xloadimage -fork -quiet -title 'KeyID 0x%k' stdin" # The default program is "xloadimage -fork -quiet -title 'KeyID 0x%k' stdin"
# #
# Some other viewers: # Some other viewers:
# photo-viewer "xv -name \"KeyID 0x%k\" -" # photo-viewer "qiv %i"
# photo-viewer "ee %i" # photo-viewer "ee %i"
# photo-viewer "display -title 'KeyID 0x%k'" # photo-viewer "display -title 'KeyID 0x%k'"
# #