Changeset 47

Show
Ignore:
Timestamp:
07/26/06 14:55:50 (2 years ago)
Author:
jm3
Message:

signing fix and debug-logging for perl.jm3

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 10kz/scripts/crypto-ui-injector.user.js

    r46 r47  
    123123 
    124124function sign_message() { 
    125         //debugger; 
    126         //top.js._CM_OnSendButtonKeyDown(); 
    127         //return true; 
    128  
    129  
    130125        var snd = document.getElementById('snd'); 
    131126        snd = !snd ? document.getElementById('nc_0') : snd; 
     
    164159 
    165160                p.addEventListener("keypress", function(event) { 
    166                         handle_enter(this, event); 
     161                        broker_remote_read(this, event); 
    167162                }, true); 
    168163 
     
    190185                link_button.setAttribute( "href", "#" );  
    191186                link_button.addEventListener("click", function(event) { 
    192                         log( "XXX sign_message(): listener firing" ); 
    193                         handle_enter(document.getElementById( "passphrase" ), "manual"); 
     187                        log( "sign_message(): listener firing" ); 
     188                        broker_remote_read( document.getElementById( "passphrase" ), "manual"); 
    194189                }, true); 
    195190                var instruction = document.createTextNode( "  Sign " ); 
     
    346341} 
    347342 
    348 function handle_enter( myfield, e ) { 
     343function broker_remote_read( myfield, e ) { 
    349344        var mode = myfield.getAttribute( "mode" ) ? myfield.getAttribute( "mode" ) : "decrypt"; 
    350345 
     
    503498                                dec.appendChild( document.createTextNode( "Decrypt" )); 
    504499                                dec.addEventListener('click', function(event) { 
    505                                         log( "XXX decrypt listener firing" ); 
     500                                        log( "decrypt listener firing" ); 
    506501                                        decrypt_message(event, ct); 
    507502                                }, true); 
    508503                                 
    509504                                var f = document.createElement("form"); 
    510                                 f.setAttribute("style", "padding: 0.5em; background-color: #dddddd; border: 2px solid red; margin-bottom: 1.0em;");                     
     505                                f.setAttribute("style", "padding: 0.5em; background-color: #dddddd; border: 2px solid red; width: 95%; margin-bottom: 1.0em;"); 
    511506                                f.setAttribute( "id",   "jm3_status_pane" ); 
    512507 
     
    514509                                p.setAttribute( "mode", "decrypt" );  
    515510                                p.addEventListener("keypress", function(event) { 
    516                                         handle_enter(this, event); 
     511                                        broker_remote_read(this, event); 
    517512                                }, true); 
    518513                                 
    519                                 f.appendChild( document.createTextNode( "This is a secret message (woo, scary!). To read it, enter your passphrase: ")); 
     514                                f.appendChild( document.createTextNode( "This is an encrypted message (wooo, scary!). To read it, enter your passphrase: ")); 
    520515                                f.appendChild( p ); 
    521516                                f.appendChild( dec ); 
     
    539534                var injection_point = buttons[i]; 
    540535 
    541                 /* look for the "Discard" to insertBefore -- inserting before Send does odd things */ 
     536                /* search for the "Discard" to insertBefore -- inserting before Send does odd things */ 
    542537                if (injection_point.getAttribute('id')=='x') { 
    543538 
  • 10kz/shell/perl.jm3

    r45 r47  
    99 
    1010$debug = 0; 
     11if( $debug ) { 
     12        open LOG, ">/tmp/10kz.log" or print "\n\nCouldn't open logfile for writing: $!\n"; 
     13        print LOG "*** starting new crypto session: ***\n"; 
     14        my $pwd = `pwd`; 
     15        print LOG "pwd: $pwd\n"; 
     16} 
    1117 
    1218# FIXME: ugh, unless we perl-ify the other shell scripts, we need a way to share the configure.sh info between perl + shell 
     
    1521 
    1622#print header; 
    17 if( $debug == 1 ) { print header('text/XMl'); } else { 
     23#if( $debug == 1 ) { print header('text/XMl'); } else { 
    1824print header('text/plain'); 
    19 
     25#
    2026         
    2127if (param()) { 
     
    5056        if( $mode eq "sign"    ) { $cmd = $sign_cmd; } 
    5157        if( $mode eq "decrypt" ) { $cmd = $decrypt_cmd; } 
    52         if( $debug == 1 ) { print "$cmd\n"; } 
    53         if( $debug == 1 ) { print "$plaintext\n"; } 
     58        if( $debug == 1 ) { print LOG "\$cmd: $cmd\n"; } 
     59        if( $debug == 1 ) { print LOG "\$plaintext: $plaintext\n"; } 
    5460 
    5561        # FIXME: need to tee off stderr here so we can capture and optionally grovel through GPG's egregiously bad error messages 
     
    7177        } 
    7278 
    73  
    74         if( $debug == 1 ) { print "out: $out\n"; } 
     79        if( $debug == 1 ) {  
     80                print LOG "err: $err\n";  
     81                print LOG "out: $out\n";  
     82        } 
    7583         
    7684        if( -f "$pt.asc" ) {