| 6 |
details. |
details. |
| 7 |
|
|
| 8 |
OpenPGP messages |
OpenPGP messages |
| 9 |
$Id: pgp.c,v 1.6 2002/08/20 06:50:38 rabbi Exp $ */ |
$Id: pgp.c,v 1.7 2002/08/25 13:27:40 weaselp Exp $ */ |
| 10 |
|
|
| 11 |
|
|
| 12 |
#include "mix3.h" |
#include "mix3.h" |
| 198 |
if (mode & PGP_DETACHEDSIG) { |
if (mode & PGP_DETACHEDSIG) { |
| 199 |
buf_move(in, sig); |
buf_move(in, sig); |
| 200 |
if (!(mode & PGP_NOARMOR)) |
if (!(mode & PGP_NOARMOR)) |
| 201 |
pgp_armor(in, 4); |
pgp_armor(in, PGP_ARMOR_NYMSIG); |
| 202 |
goto end; |
goto end; |
| 203 |
} |
} |
| 204 |
} |
} |
| 263 |
buf_move(in, out); |
buf_move(in, out); |
| 264 |
} |
} |
| 265 |
if (!(mode & PGP_NOARMOR)) |
if (!(mode & PGP_NOARMOR)) |
| 266 |
pgp_armor(in, (mode & PGP_REMAIL) ? 1 : 0); |
pgp_armor(in, (mode & PGP_REMAIL) ? PGP_ARMOR_REM : PGP_ARMOR_NORMAL); |
| 267 |
|
|
| 268 |
end: |
end: |
| 269 |
buf_free(out); |
buf_free(out); |
| 368 |
encode(in, 64); |
encode(in, 64); |
| 369 |
|
|
| 370 |
out = buf_new(); |
out = buf_new(); |
| 371 |
if (mode == 2 || mode == 3) |
if (mode == PGP_ARMOR_KEY || mode == PGP_ARMOR_NYMKEY) |
| 372 |
buf_sets(out, begin_pgpkey); |
buf_sets(out, begin_pgpkey); |
| 373 |
else if (mode == 4) |
else if (mode == PGP_ARMOR_NYMSIG) |
| 374 |
buf_sets(out, begin_pgpsig); |
buf_sets(out, begin_pgpsig); |
| 375 |
|
else if (mode == PGP_ARMOR_SECKEY) |
| 376 |
|
buf_sets(out, begin_pgpseckey); |
| 377 |
else |
else |
| 378 |
buf_sets(out, begin_pgpmsg); |
buf_sets(out, begin_pgpmsg); |
| 379 |
buf_nl(out); |
buf_nl(out); |
| 380 |
#ifdef CLOAK |
#ifdef CLOAK |
| 381 |
if (mode == 1 || mode == 3 || mode == 4) |
if (mode == PGP_ARMOR_REM || mode == PGP_ARMOR_NYMKEY || mode == PGP_ARMOR_NYMSIG) |
| 382 |
buf_appends(out, "Version: N/A\n"); |
buf_appends(out, "Version: N/A\n"); |
| 383 |
else |
else |
| 384 |
#elif MIMIC |
#elif MIMIC |
| 385 |
if (mode == 1 || mode == 3 || mode == 4) |
if (mode == PGP_ARMOR_REM || mode == PGP_ARMOR_NYMKEY || mode == PGP_ARMOR_NYMSIG) |
| 386 |
buf_appends(out, "Version: 2.6.3i\n"); |
buf_appends(out, "Version: 2.6.3i\n"); |
| 387 |
else |
else |
| 388 |
#endif |
#endif |
| 401 |
buf_appendc(out, '='); |
buf_appendc(out, '='); |
| 402 |
buf_cat(out, in); |
buf_cat(out, in); |
| 403 |
buf_nl(out); |
buf_nl(out); |
| 404 |
if (mode == 2 || mode == 3) |
if (mode == PGP_ARMOR_KEY || mode == PGP_ARMOR_NYMKEY) |
| 405 |
buf_appends(out, end_pgpkey); |
buf_appends(out, end_pgpkey); |
| 406 |
else if (mode == 4) |
else if (mode == PGP_ARMOR_NYMSIG) |
| 407 |
buf_appends(out, end_pgpsig); |
buf_appends(out, end_pgpsig); |
| 408 |
|
else if (mode == PGP_ARMOR_SECKEY) |
| 409 |
|
buf_appends(out, end_pgpseckey); |
| 410 |
else |
else |
| 411 |
buf_appends(out, end_pgpmsg); |
buf_appends(out, end_pgpmsg); |
| 412 |
buf_nl(out); |
buf_nl(out); |