   # Base-64-decode the file data
   for key,val of data
     val.data = new Buffer val.data, 'base64'
+    await corrupt val.data, defer val.bad_data
 
   cb()
 

{do_message} = require '../../lib/openpgp/processor'
{keys,data}  = require '../data/detached'
{WordArray}  = require 'triplesec'

#=================================================

ring = new PgpKeyRing()

#==========================================



#==========================================

good_check_sig_all_at_once = (T, name, {data,sig,bad_data}, cb) -> 
  await do_message { keyfetch : ring, armored : sig, data }, defer err
  T.no_error err, "sig worked for #{name}"
  T.waypoint "Sig #{name} / good checked out"
  cb()

#==========================================

bad_check_sig_all_at_once = (T, name, {sig,bad_data}, cb) -> 
  await do_message { keyfetch : ring, armored : sig, data : bad_data }, defer err
  T.assert err?, "errored out on bad signature"
  T.waypoint "Sig #{name} / bad checked out"
  cb()

#==========================================
