Changeset 05597ae


Ignore:
Timestamp:
Mar 17, 2010 4:23:20 PM (10 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
617d1cd
Parents:
0f1eb46
Message:

disable i2ptunnel nonce checking if console password is set

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java

    r0f1eb46 r05597ae  
    4343    private long _curNonce;
    4444    private long _nextNonce;
    45     /** deprecated unimplemented, now using routerconsole realm */
    46     private String _passphrase;
    4745
    4846    private String _type;
     
    8381   
    8482    /** deprecated unimplemented, now using routerconsole realm */
    85     public static final String PROP_TUNNEL_PASSPHRASE = "i2ptunnel.passphrase";
     83    //public static final String PROP_TUNNEL_PASSPHRASE = "i2ptunnel.passphrase";
     84    public static final String PROP_TUNNEL_PASSPHRASE = "consolePassword";
    8685    static final String PROP_NONCE = IndexBean.class.getName() + ".nonce";
    8786    static final String PROP_NONCE_OLD = PROP_NONCE + '2';
     
    130129    /** deprecated unimplemented, now using routerconsole realm */
    131130    public void setPassphrase(String phrase) {
    132         _passphrase = phrase;
    133131    }
    134132   
     
    146144    }
    147145   
    148     /** deprecated unimplemented, now using routerconsole realm */
    149     private boolean validPassphrase(String proposed) {
    150         if (proposed == null) return false;
     146    /** just check if console password option is set, jetty will do auth */
     147    private boolean validPassphrase() {
    151148        String pass = _context.getProperty(PROP_TUNNEL_PASSPHRASE);
    152         if ( (pass != null) && (pass.trim().length() > 0) )
    153             return pass.trim().equals(proposed.trim());
    154         else
    155             return false;
     149        return pass != null && pass.trim().length() > 0;
    156150    }
    157151   
     
    159153        if ( (_action == null) || (_action.trim().length() <= 0) || ("Cancel".equals(_action)))
    160154            return "";
    161         if ( (_prevNonce != _curNonce) && (_prevNonce2 != _curNonce) && (!validPassphrase(_passphrase)) )
     155        if ( (_prevNonce != _curNonce) && (_prevNonce2 != _curNonce) && (!validPassphrase()) )
    162156            return "Invalid form submission, probably because you used the 'back' or 'reload' button on your browser. Please resubmit.";
    163157        if ("Stop all".equals(_action))
Note: See TracChangeset for help on using the changeset viewer.