Index: openpgpsdk/trunk/examples/packet-dump.c =================================================================== --- openpgpsdk/trunk/examples/packet-dump.c (revision 339) +++ openpgpsdk/trunk/examples/packet-dump.c (revision 342) @@ -834,4 +834,9 @@ print_hexdump("IV",content->secret_key.iv, ops_block_size(content->secret_key.algorithm)); + + /* no more set if encrypted */ + if(content_->tag == OPS_PTAG_CT_ENCRYPTED_SECRET_KEY) + break; + printf("Checksum: %04x\n",content->secret_key.checksum); Index: openpgpsdk/trunk/src/packet-parse.c =================================================================== --- openpgpsdk/trunk/src/packet-parse.c (revision 341) +++ openpgpsdk/trunk/src/packet-parse.c (revision 342) @@ -1854,4 +1854,7 @@ return 0; + /* Let callbacks see what they're about to be passphrased for */ + CBP(parse_info,OPS_PTAG_CT_ENCRYPTED_SECRET_KEY,&content); + passphrase=NULL; pc.content.passphrase=&passphrase; @@ -1861,5 +1864,4 @@ if(!consume_packet(region,parse_info,ops_false)) return 0; - CBP(parse_info,OPS_PTAG_CT_ENCRYPTED_SECRET_KEY,&content); return 1; }