|
|
|
@ -504,7 +504,7 @@ pgp_write_xfer_pubkey(pgp_output_t *output,
|
|
|
|
|
const pgp_key_t *key,
|
|
|
|
|
const unsigned armoured)
|
|
|
|
|
{
|
|
|
|
|
unsigned i, j;
|
|
|
|
|
unsigned /*i,*/ j;
|
|
|
|
|
|
|
|
|
|
if (armoured) {
|
|
|
|
|
pgp_writer_push_armoured(output, PGP_PGP_PUBLIC_KEY_BLOCK);
|
|
|
|
@ -516,16 +516,25 @@ pgp_write_xfer_pubkey(pgp_output_t *output,
|
|
|
|
|
|
|
|
|
|
/* TODO: revocation signatures go here */
|
|
|
|
|
|
|
|
|
|
/* user ids and corresponding signatures */
|
|
|
|
|
for (i = 0; i < key->uidc; i++) {
|
|
|
|
|
if (!pgp_write_struct_userid(output, key->uids[i])) {
|
|
|
|
|
/* TODO : fix this */
|
|
|
|
|
// /* user ids and corresponding signatures */
|
|
|
|
|
// for (i = 0; i < key->uidc; i++) {
|
|
|
|
|
// if (!pgp_write_struct_userid(output, key->uids[i])) {
|
|
|
|
|
// return 0;
|
|
|
|
|
// }
|
|
|
|
|
// for (j = 0; j < key->packetc; j++) {
|
|
|
|
|
// if (!pgp_write(output, key->packets[j].raw, (unsigned)key->packets[j].length)) {
|
|
|
|
|
// return 0;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/* until fixed, output all raw subpackets, except 1st, the key itself */
|
|
|
|
|
for (j = 1; j < key->packetc; j++) {
|
|
|
|
|
if (!pgp_write(output, key->packets[j].raw,
|
|
|
|
|
(unsigned)key->packets[j].length)) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
for (j = 0; j < key->packetc; j++) {
|
|
|
|
|
if (!pgp_write(output, key->packets[j].raw, (unsigned)key->packets[j].length)) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* TODO: user attributes and corresponding signatures */
|
|
|
|
@ -562,7 +571,7 @@ pgp_write_xfer_seckey(pgp_output_t *output,
|
|
|
|
|
const size_t pplen,
|
|
|
|
|
unsigned armoured)
|
|
|
|
|
{
|
|
|
|
|
unsigned i, j;
|
|
|
|
|
unsigned /*i,*/ j;
|
|
|
|
|
|
|
|
|
|
if (armoured) {
|
|
|
|
|
pgp_writer_push_armoured(output, PGP_PGP_PRIVATE_KEY_BLOCK);
|
|
|
|
@ -575,16 +584,25 @@ pgp_write_xfer_seckey(pgp_output_t *output,
|
|
|
|
|
|
|
|
|
|
/* TODO: revocation signatures go here */
|
|
|
|
|
|
|
|
|
|
/* user ids and corresponding signatures */
|
|
|
|
|
for (i = 0; i < key->uidc; i++) {
|
|
|
|
|
if (!pgp_write_struct_userid(output, key->uids[i])) {
|
|
|
|
|
/* TODO : fix this */
|
|
|
|
|
// /* user ids and corresponding signatures */
|
|
|
|
|
// for (i = 0; i < key->uidc; i++) {
|
|
|
|
|
// if (!pgp_write_struct_userid(output, key->uids[i])) {
|
|
|
|
|
// return 0;
|
|
|
|
|
// }
|
|
|
|
|
// for (j = 0; j < key->packetc; j++) {
|
|
|
|
|
// if (!pgp_write(output, key->packets[j].raw, (unsigned)key->packets[j].length)) {
|
|
|
|
|
// return 0;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/* until fixed, output all raw subpackets, except 1st, the key itself */
|
|
|
|
|
for (j = 1; j < key->packetc; j++) {
|
|
|
|
|
if (!pgp_write(output, key->packets[j].raw,
|
|
|
|
|
(unsigned)key->packets[j].length)) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
for (j = 0; j < key->packetc; j++) {
|
|
|
|
|
if (!pgp_write(output, key->packets[j].raw, (unsigned)key->packets[j].length)) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* TODO: user attributes and corresponding signatures */
|
|
|
|
|