1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

Merge branch 'STABLE-BRANCH-1-4' of git+ssh://playfair.gnupg.org/git/gnupg into STABLE-BRANCH-1-4

This commit is contained in:
David Shaw 2012-01-19 22:34:45 -05:00
commit 561d89803b
30 changed files with 6088 additions and 291 deletions

View file

@ -30,7 +30,7 @@
#include "cipher.h"
#include "options.h"
#include "i18n.h"
#include "status.h"
static int mdc_decode_filter( void *opaque, int control, IOBUF a,
byte *buf, size_t *ret_len);
@ -91,6 +91,15 @@ decrypt_data( void *procctx, PKT_encrypted *ed, DEK *dek )
log_info(_("encrypted with unknown algorithm %d\n"), dek->algo );
dek->algo_info_printed = 1;
}
{
char buf[20];
snprintf (buf, sizeof buf, "%d %d", ed->mdc_method, dek->algo);
write_status_text (STATUS_DECRYPTION_INFO, buf);
}
if( (rc=check_cipher_algo(dek->algo)) )
goto leave;
blocksize = cipher_get_blocksize(dek->algo);
@ -120,7 +129,7 @@ decrypt_data( void *procctx, PKT_encrypted *ed, DEK *dek )
{
log_error("key setup failed: %s\n", g10_errstr(rc) );
goto leave;
}
if (!ed->buf) {
log_error(_("problem handling encrypted packet\n"));
@ -199,7 +208,7 @@ decrypt_data( void *procctx, PKT_encrypted *ed, DEK *dek )
/*log_hexdump("MDC calculated:",md_read( dfx->mdc_hash, 0), datalen);*/
/*log_hexdump("MDC message :", dfx->defer, 20);*/
}
leave:
release_dfx_context (dfx);

View file

@ -75,7 +75,7 @@ progress_cb ( void *ctx, int c )
}
static const char *
get_status_string ( int no )
get_status_string ( int no )
{
const char *s;
@ -165,6 +165,7 @@ get_status_string ( int no )
case STATUS_PKA_TRUST_GOOD : s = "PKA_TRUST_GOOD"; break;
case STATUS_BEGIN_SIGNING : s = "BEGIN_SIGNING"; break;
case STATUS_ERROR : s = "ERROR"; break;
case STATUS_DECRYPTION_INFO: s = "DECRYPTION_INFO"; break;
default: s = "?"; break;
}
return s;
@ -187,13 +188,13 @@ status_currently_allowed (int no)
prompt the user. */
switch (no)
{
case STATUS_GET_BOOL:
case STATUS_GET_LINE:
case STATUS_GET_HIDDEN:
case STATUS_GOT_IT:
case STATUS_GET_BOOL:
case STATUS_GET_LINE:
case STATUS_GET_HIDDEN:
case STATUS_GOT_IT:
case STATUS_IMPORTED:
case STATUS_IMPORT_OK:
case STATUS_IMPORT_CHECK:
case STATUS_IMPORT_OK:
case STATUS_IMPORT_CHECK:
case STATUS_IMPORT_RES:
return 1; /* Yes. */
default:
@ -214,7 +215,7 @@ set_status_fd ( int fd )
if ( statusfp && statusfp != stdout && statusfp != stderr )
fclose (statusfp);
statusfp = NULL;
if ( fd == -1 )
if ( fd == -1 )
return;
if( fd == 1 )
@ -260,7 +261,7 @@ write_status_text ( int no, const char *text)
fputs ( "\\n", statusfp );
else if (*text == '\r')
fputs ( "\\r", statusfp );
else
else
putc ( *(const byte *)text, statusfp );
}
}
@ -287,7 +288,7 @@ write_status_text_and_buffer ( int no, const char *string,
if( !statusfp || !status_currently_allowed (no) )
return; /* Not enabled or allowed. */
if (wrap == -1) {
lower_limit--;
wrap = 0;
@ -306,8 +307,8 @@ write_status_text_and_buffer ( int no, const char *string,
first = 0;
}
for (esc=0, s=buffer, n=len; n && !esc; s++, n-- ) {
if ( *s == '%' || *(const byte*)s <= lower_limit
|| *(const byte*)s == 127 )
if ( *s == '%' || *(const byte*)s <= lower_limit
|| *(const byte*)s == 127 )
esc = 1;
if ( wrap && ++count > wrap ) {
dowrap=1;
@ -317,7 +318,7 @@ write_status_text_and_buffer ( int no, const char *string,
if (esc) {
s--; n++;
}
if (s != buffer)
if (s != buffer)
fwrite (buffer, s-buffer, 1, statusfp );
if ( esc ) {
fprintf (statusfp, "%%%02X", *(const byte*)s );
@ -535,7 +536,7 @@ myread(int fd, void *buf, size_t count)
raise (SIGHUP); /* no more input data */
#endif
}
}
}
return rc;
}

View file

@ -120,6 +120,8 @@
#define STATUS_ERROR 85
#define STATUS_DECRYPTION_INFO 86
/*-- status.c --*/
void set_status_fd ( int fd );

View file

@ -57,10 +57,7 @@ struct trust_record {
byte min_cert_level;
ulong created; /* timestamp of trustdb creation */
ulong nextcheck; /* timestamp of next scheduled check */
ulong reserved;
ulong reserved2;
ulong firstfree;
ulong reserved3;
ulong trusthashtbl;
} ver;
struct { /* free record */
@ -82,7 +79,7 @@ struct trust_record {
} trust;
struct {
byte namehash[20];
ulong next;
ulong next;
byte validity;
byte full_count;
byte marginal_count;