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

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

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

revision 227 by disastry, Sat Sep 7 11:27:22 2002 UTC revision 254 by disastry, Thu Sep 12 17:26:00 2002 UTC
# Line 6  Line 6 
6     details.     details.
7    
8     Create OpenPGP packets     Create OpenPGP packets
9     $Id: pgpcreat.c,v 1.8 2002/09/07 11:27:22 disastry Exp $ */     $Id: pgpcreat.c,v 1.9 2002/09/12 17:25:59 disastry Exp $ */
10    
11    
12  #include "mix3.h"  #include "mix3.h"
# Line 454  int pgp_sessionkey(BUFFER *out, BUFFER * Line 454  int pgp_sessionkey(BUFFER *out, BUFFER *
454      tempbuf = 1;      tempbuf = 1;
455    }    }
456    sym = seskey->data[0];    sym = seskey->data[0];
457    if ((algo = pgpdb_getkey(PK_ENCRYPT, PGP_ANY, &sym, NULL, key, user, NULL, keyid,    if ((algo = pgpdb_getkey(PK_ENCRYPT, PGP_ANY, &sym, NULL, NULL, key, user, NULL, keyid,
458                             pubring, NULL)) == -1)                             pubring, NULL)) == -1)
459      goto end;      goto end;
460    
# Line 628  int pgp_signhashalgo(BUFFER *algo, BUFFE Line 628  int pgp_signhashalgo(BUFFER *algo, BUFFE
628  {  {
629    int pkalgo;    int pkalgo;
630    
631    pkalgo = pgpdb_getkey(PK_SIGN, PGP_ANY, NULL, NULL, NULL, userid, NULL, NULL,    pkalgo = pgpdb_getkey(PK_SIGN, PGP_ANY, NULL, NULL, NULL, NULL, userid, NULL, NULL,
632                          secring, pass);                          secring, pass);
633    if (pkalgo == PGP_S_DSA)    if (pkalgo == PGP_S_DSA)
634      buf_sets(algo, "sha1");      buf_sets(algo, "sha1");
# Line 670  int pgp_sign(BUFFER *msg, BUFFER *msg2, Line 670  int pgp_sign(BUFFER *msg, BUFFER *msg2,
670    }    }
671    if (keypacket) {    if (keypacket) {
672      buf_rewind(keypacket);      buf_rewind(keypacket);
673      algo = pgp_getkey(PK_SIGN, PGP_ANY, NULL, NULL, keypacket, key, id, NULL, pass);      algo = pgp_getkey(PK_SIGN, PGP_ANY, NULL, NULL, NULL, keypacket, key, id, NULL, pass);
674    } else    } else
675      algo = pgpdb_getkey(PK_SIGN, PGP_ANY, NULL, NULL, key, userid, NULL, id, secring,      algo = pgpdb_getkey(PK_SIGN, PGP_ANY, NULL, NULL, NULL, key, userid, NULL, id, secring,
676                          pass);                          pass);
677    if (algo <= -1) {    if (algo <= -1) {
678      err = algo;      err = algo;
# Line 686  int pgp_sign(BUFFER *msg, BUFFER *msg2, Line 686  int pgp_sign(BUFFER *msg, BUFFER *msg2,
686      hashalgo = PGP_H_SHA1;      hashalgo = PGP_H_SHA1;
687    
688    if (!self && type != PGP_SIG_BINDSUBKEY)    if (!self && type != PGP_SIG_BINDSUBKEY)
689      version = 3; /* why this one? shouldn't it be removed? */      version = 3;
690    
691    switch (type) {    switch (type) {
692     case PGP_SIG_CERT:     case PGP_SIG_CERT:
693       case PGP_SIG_CERT1:
694       case PGP_SIG_CERT2:
695       case PGP_SIG_CERT3:
696       type1 = pgp_getpacket(msg, d) == PGP_PUBKEY;       type1 = pgp_getpacket(msg, d) == PGP_PUBKEY;
697       assert (type1);       assert (type1);
698       buf_setc(msg, 0x99);       buf_setc(msg, 0x99);

Legend:
Removed from v.227  
changed lines
  Added in v.254

  ViewVC Help
Powered by ViewVC 1.1.5