1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

* misc.c (pct_expando), options.skel: Use %t to indicate type of a photo

ID (in this version, it's always "jpeg").  Also tweak string expansion
loop to minimize reallocs.

* mainproc.c (do_check_sig): Variable type fix.

* keyedit.c (menu_set_primary_uid): Differentiate between true user IDs
and attribute user IDs when making one of them primary. That is, if we are
making a user ID primary, we alter user IDs. If we are making an attribute
packet primary, we alter attribute packets.  This matches the language in
the latest attribute packet draft.

* keyedit.c (sign_uids): No need for the empty string hack.

* getkey.c (fixup_uidnode): Only accept preferences from the hashed
segment of the self-sig.
This commit is contained in:
David Shaw 2002-04-11 04:04:41 +00:00
parent f29240cc2e
commit 018f352294
6 changed files with 65 additions and 25 deletions

View file

@ -439,8 +439,8 @@ idea_cipher_warn(int show)
}
}
/* The largest string we have an expando for, times two. */
#define LARGEST_EXPANDO ((MAX_FINGERPRINT_LEN*2)*2)
/* The largest string we have an expando for. */
#define LARGEST_EXPANDO (MAX_FINGERPRINT_LEN*2)
/* Expand %-strings. Returns a string which must be m_freed. Returns
NULL if the string cannot be expanded (too large). */
@ -454,7 +454,7 @@ pct_expando(const char *string,PKT_public_key *pk)
keyid_from_pk(pk,keyid);
maxlen=LARGEST_EXPANDO;
maxlen=LARGEST_EXPANDO*2;
ret=m_alloc(maxlen+1); /* one more to leave room for the trailing \0 */
ret[0]='\0';
@ -464,7 +464,7 @@ pct_expando(const char *string,PKT_public_key *pk)
/* 8192 is way bigger than we'll need here */
if(maxlen-idx<LARGEST_EXPANDO && maxlen<8192)
{
maxlen+=LARGEST_EXPANDO;
maxlen+=LARGEST_EXPANDO*2;
ret=m_realloc(ret,maxlen+1);
}
@ -508,7 +508,17 @@ pct_expando(const char *string,PKT_public_key *pk)
}
}
break;
/* photo type. For now, it's always jpeg so this is
easy! */
case 't':
if(idx+4>maxlen)
goto fail;
strcpy(&ret[idx],"jpeg");
idx+=4;
break;
case '%':
if(idx+1>maxlen)
goto fail;