| 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" |
| 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 |
|
|
| 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"); |
| 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; |
| 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); |