1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

PGP2 patch. --pgp2 sets things up for pgp2 compatibility, and prints a

warning if the user does something that would make the message not
compatible (i.e. encrypt with a non-RSA key, etc.)
This commit is contained in:
David Shaw 2001-12-07 15:24:32 +00:00
parent 1ccd578910
commit 27949781ec
5 changed files with 85 additions and 6 deletions

View file

@ -250,7 +250,7 @@ encode_crypt( const char *filename, STRLIST remusr )
armor_filter_context_t afx;
compress_filter_context_t zfx;
text_filter_context_t tfx;
PK_LIST pk_list;
PK_LIST pk_list,work_list;
int do_compress = opt.compress && !opt.rfc1991;
@ -263,6 +263,17 @@ encode_crypt( const char *filename, STRLIST remusr )
if( (rc=build_pk_list( remusr, &pk_list, PUBKEY_USAGE_ENC)) )
return rc;
if(opt.pgp2)
for(work_list=pk_list;work_list->next!=NULL;work_list=work_list->next)
if(!(is_RSA(work_list->pk->pubkey_algo) &&
nbits_from_pk(work_list->pk)<=2048))
{
log_info(_("You can only encrypt to RSA keys of 2048 bits or "
"less in --pgp2 mode\n"));
log_info(_("This message will not be usable by PGP 2.x\n"));
break;
}
/* prepare iobufs */
if( !(inp = iobuf_open(filename)) ) {
log_error(_("can't open %s: %s\n"), filename? filename: "[stdin]",