/[pkg-mixmaster]/trunk/Mix/Src/pgpdb.c
ViewVC logotype

Diff of /trunk/Mix/Src/pgpdb.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 170 by rabbi, Fri Aug 16 19:03:37 2002 UTC revision 171 by weaselp, Thu Aug 22 08:13:36 2002 UTC
# Line 6  Line 6 
6     details.     details.
7    
8     OpenPGP key database     OpenPGP key database
9     $Id: pgpdb.c,v 1.6 2002/08/16 19:03:37 rabbi Exp $ */     $Id: pgpdb.c,v 1.7 2002/08/22 08:13:36 weaselp Exp $ */
10    
11    
12  #include "mix3.h"  #include "mix3.h"
# Line 410  int pgp_rlist(REMAILER remailer[], int n Line 410  int pgp_rlist(REMAILER remailer[], int n
410    return (0);    return (0);
411  }  }
412    
413    int pgp_rkeylist(REMAILER remailer[], int keyid[], int n)
414         /* Step through all remailers and get keyid */
415    {
416      BUFFER *userid;
417      BUFFER *id;
418      int i, err;
419      int mdc, sym;
420    
421      userid = buf_new();
422      id = buf_new();
423    
424      for (i = 1; i < n; i++) {
425        buf_clear(userid);
426        buf_setf(userid, "<%s>", remailer[i].addr);
427    
428        keyid[i]=0;
429        if (remailer[i].flags.pgp) {
430          mdc = sym = 0;
431          buf_clear(id);
432          err = pgpdb_getkey(PK_VERIFY, PGP_ANY, &sym, &mdc, NULL, userid, NULL, id, NULL, NULL);
433          if (id->length == 8) {
434            /* printf("%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x %s\n",
435               id->data[0], id->data[1], id->data[2], id->data[3], id->data[4], id->data[5], id->data[6], id->data[7], id->data[8], remailer[i].addr); */
436            keyid[i] = (((((id->data[4] << 8) + id->data[5]) << 8) + id->data[6]) << 8) + id->data[7];
437          }
438        }
439      }
440    
441      buf_free(userid);
442      return (0);
443    }
444    
445  #endif /* USE_PGP */  #endif /* USE_PGP */

Legend:
Removed from v.170  
changed lines
  Added in v.171

  ViewVC Help
Powered by ViewVC 1.1.5