mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-01 16:33:02 +01:00
Minor tweak to importing to allow more non-signed uids (now that
--allow-non-selfsigned-uid allows for completey unsigned uids). Do not choose an attribute packet (i.e. photo) as primary uid. This prevents oddities like "Good signature from [image of size 2671]". This is still not perfect (one can still select an attribute packet as primary in --edit), but is closer to the way the draft is going. The algorithms list should include #110. --pgp2 implies --no-ask-sig-expire and --no-ask-cert-expire as those would cause a v4 sig/cert. Be more lenient in what constitutes a valid armor header (i.e. -----BEGIN blah blah-----) as some Windows programs seem to add spaces at the end. --openpgp makes it strict again
This commit is contained in:
parent
d5a39044ef
commit
ff8460f20d
@ -1,3 +1,24 @@
|
|||||||
|
2002-03-23 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* import.c (append_uid, merge_sigs): it is okay to import
|
||||||
|
completely non-signed uids now (with --allow-non-selfsigned-uid).
|
||||||
|
|
||||||
|
* getkey.c (get_primary_uid, merge_selfsigs_main): do not choose
|
||||||
|
an attribute packet (i.e. photo) as primary uid. This prevents
|
||||||
|
oddities like "Good signature from [image of size 2671]". This is
|
||||||
|
still not perfect (one can still select an attribute packet as
|
||||||
|
primary in --edit), but is closer to the way the draft is going.
|
||||||
|
|
||||||
|
* g10.c (build_list): algorithms should include 110.
|
||||||
|
|
||||||
|
* g10.c (main): --pgp2 implies --no-ask-sig-expire and
|
||||||
|
--no-ask-cert-expire as those would cause a v4 sig/cert.
|
||||||
|
|
||||||
|
* armor.c (is_armor_header): be more lenient in what constitutes a
|
||||||
|
valid armor header (i.e. -----BEGIN blah blah-----) as some
|
||||||
|
Windows programs seem to add spaces at the end. --openpgp makes
|
||||||
|
it strict again.
|
||||||
|
|
||||||
2002-03-18 David Shaw <dshaw@jabberwocky.com>
|
2002-03-18 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
* keyserver.c (keyserver_search_prompt): Properly handle a "no
|
* keyserver.c (keyserver_search_prompt): Properly handle a "no
|
||||||
|
@ -287,6 +287,14 @@ is_armor_header( byte *line, unsigned len )
|
|||||||
return -1;
|
return -1;
|
||||||
save_p = p;
|
save_p = p;
|
||||||
p += 5;
|
p += 5;
|
||||||
|
|
||||||
|
/* Some mail programs on Windows seem to add spaces to the end of
|
||||||
|
the line. This becomes strict if --openpgp is set. */
|
||||||
|
|
||||||
|
if(!opt.rfc2440)
|
||||||
|
while(*p==' ')
|
||||||
|
p++;
|
||||||
|
|
||||||
if( *p == '\r' )
|
if( *p == '\r' )
|
||||||
p++;
|
p++;
|
||||||
if( *p == '\n' )
|
if( *p == '\n' )
|
||||||
|
@ -616,11 +616,11 @@ build_list( const char *text, const char * (*mapf)(int), int (*chkf)(int) )
|
|||||||
if( maybe_setuid )
|
if( maybe_setuid )
|
||||||
secmem_init( 0 ); /* drop setuid */
|
secmem_init( 0 ); /* drop setuid */
|
||||||
|
|
||||||
for(i=1; i < 110; i++ )
|
for(i=1; i <= 110; i++ )
|
||||||
if( !chkf(i) && (s=mapf(i)) )
|
if( !chkf(i) && (s=mapf(i)) )
|
||||||
n += strlen(s) + 2;
|
n += strlen(s) + 2;
|
||||||
list = m_alloc( 21 + n ); *list = 0;
|
list = m_alloc( 21 + n ); *list = 0;
|
||||||
for(p=NULL, i=1; i < 110; i++ ) {
|
for(p=NULL, i=1; i <= 110; i++ ) {
|
||||||
if( !chkf(i) && (s=mapf(i)) ) {
|
if( !chkf(i) && (s=mapf(i)) ) {
|
||||||
if( !p )
|
if( !p )
|
||||||
p = stpcpy( list, text );
|
p = stpcpy( list, text );
|
||||||
@ -1416,6 +1416,8 @@ main( int argc, char **argv )
|
|||||||
opt.escape_from = 1;
|
opt.escape_from = 1;
|
||||||
opt.force_v3_sigs = 1;
|
opt.force_v3_sigs = 1;
|
||||||
opt.pgp2_workarounds = 1;
|
opt.pgp2_workarounds = 1;
|
||||||
|
opt.ask_sig_expire = 0;
|
||||||
|
opt.ask_cert_expire = 0;
|
||||||
m_free(def_digest_string);
|
m_free(def_digest_string);
|
||||||
def_digest_string = m_strdup("md5");
|
def_digest_string = m_strdup("md5");
|
||||||
opt.def_compress_algo = 1;
|
opt.def_compress_algo = 1;
|
||||||
|
10
g10/getkey.c
10
g10/getkey.c
@ -176,6 +176,7 @@ get_primary_uid ( KBNODE keyblock, size_t *uidlen )
|
|||||||
|
|
||||||
for (k=keyblock; k; k=k->next ) {
|
for (k=keyblock; k; k=k->next ) {
|
||||||
if ( k->pkt->pkttype == PKT_USER_ID
|
if ( k->pkt->pkttype == PKT_USER_ID
|
||||||
|
&& !k->pkt->pkt.user_id->attrib_data
|
||||||
&& k->pkt->pkt.user_id->is_primary ) {
|
&& k->pkt->pkt.user_id->is_primary ) {
|
||||||
*uidlen = k->pkt->pkt.user_id->len;
|
*uidlen = k->pkt->pkt.user_id->len;
|
||||||
return k->pkt->pkt.user_id->name;
|
return k->pkt->pkt.user_id->name;
|
||||||
@ -1429,7 +1430,8 @@ merge_selfsigs_main( KBNODE keyblock, int *r_revoked )
|
|||||||
uiddate = uiddate2 = 0;
|
uiddate = uiddate2 = 0;
|
||||||
uidnode = uidnode2 = NULL;
|
uidnode = uidnode2 = NULL;
|
||||||
for(k=keyblock; k && k->pkt->pkttype != PKT_PUBLIC_SUBKEY; k = k->next ) {
|
for(k=keyblock; k && k->pkt->pkttype != PKT_PUBLIC_SUBKEY; k = k->next ) {
|
||||||
if ( k->pkt->pkttype == PKT_USER_ID ) {
|
if ( k->pkt->pkttype == PKT_USER_ID &&
|
||||||
|
!k->pkt->pkt.user_id->attrib_data) {
|
||||||
PKT_user_id *uid = k->pkt->pkt.user_id;
|
PKT_user_id *uid = k->pkt->pkt.user_id;
|
||||||
if ( uid->is_primary && uid->created > uiddate ) {
|
if ( uid->is_primary && uid->created > uiddate ) {
|
||||||
uiddate = uid->created;
|
uiddate = uid->created;
|
||||||
@ -1444,7 +1446,8 @@ merge_selfsigs_main( KBNODE keyblock, int *r_revoked )
|
|||||||
if ( uidnode ) {
|
if ( uidnode ) {
|
||||||
for(k=keyblock; k && k->pkt->pkttype != PKT_PUBLIC_SUBKEY;
|
for(k=keyblock; k && k->pkt->pkttype != PKT_PUBLIC_SUBKEY;
|
||||||
k = k->next ) {
|
k = k->next ) {
|
||||||
if ( k->pkt->pkttype == PKT_USER_ID ) {
|
if ( k->pkt->pkttype == PKT_USER_ID &&
|
||||||
|
!k->pkt->pkt.user_id->attrib_data) {
|
||||||
PKT_user_id *uid = k->pkt->pkt.user_id;
|
PKT_user_id *uid = k->pkt->pkt.user_id;
|
||||||
if ( k != uidnode )
|
if ( k != uidnode )
|
||||||
uid->is_primary = 0;
|
uid->is_primary = 0;
|
||||||
@ -1464,7 +1467,8 @@ merge_selfsigs_main( KBNODE keyblock, int *r_revoked )
|
|||||||
for(k=keyblock; k && k->pkt->pkttype != PKT_PUBLIC_SUBKEY;
|
for(k=keyblock; k && k->pkt->pkttype != PKT_PUBLIC_SUBKEY;
|
||||||
k = k->next )
|
k = k->next )
|
||||||
{
|
{
|
||||||
if(k->pkt->pkttype==PKT_USER_ID)
|
if(k->pkt->pkttype==PKT_USER_ID &&
|
||||||
|
!k->pkt->pkt.user_id->attrib_data)
|
||||||
{
|
{
|
||||||
k->pkt->pkt.user_id->is_primary=1;
|
k->pkt->pkt.user_id->is_primary=1;
|
||||||
break;
|
break;
|
||||||
|
11
g10/import.c
11
g10/import.c
@ -1338,11 +1338,6 @@ append_uid( KBNODE keyblock, KBNODE node, int *n_sigs,
|
|||||||
KBNODE n, n_where=NULL;
|
KBNODE n, n_where=NULL;
|
||||||
|
|
||||||
assert(node->pkt->pkttype == PKT_USER_ID );
|
assert(node->pkt->pkttype == PKT_USER_ID );
|
||||||
if( !node->next || node->next->pkt->pkttype == PKT_USER_ID ) {
|
|
||||||
log_error( _("key %08lX: our copy has no self-signature\n"),
|
|
||||||
(ulong)keyid[1]);
|
|
||||||
return G10ERR_GENERAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* find the position */
|
/* find the position */
|
||||||
for( n = keyblock; n; n_where = n, n = n->next ) {
|
for( n = keyblock; n; n_where = n, n = n->next ) {
|
||||||
@ -1391,12 +1386,6 @@ merge_sigs( KBNODE dst, KBNODE src, int *n_sigs,
|
|||||||
|
|
||||||
assert(dst->pkt->pkttype == PKT_USER_ID );
|
assert(dst->pkt->pkttype == PKT_USER_ID );
|
||||||
assert(src->pkt->pkttype == PKT_USER_ID );
|
assert(src->pkt->pkttype == PKT_USER_ID );
|
||||||
if( !dst->next || dst->next->pkt->pkttype == PKT_USER_ID ) {
|
|
||||||
log_error( _("key %08lX: our copy has no self-signature\n"),
|
|
||||||
(ulong)keyid[1]);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
for(n=src->next; n && n->pkt->pkttype != PKT_USER_ID; n = n->next ) {
|
for(n=src->next; n && n->pkt->pkttype != PKT_USER_ID; n = n->next ) {
|
||||||
if( n->pkt->pkttype != PKT_SIGNATURE )
|
if( n->pkt->pkttype != PKT_SIGNATURE )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user