Changeset 045627a


Ignore:
Timestamp:
Mar 16, 2012 12:17:07 PM (8 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
fb8244e
Parents:
e7898b5
Message:

throw ISE on attempt to change peer value

File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/transport/crypto/DHSessionKeyBuilder.java

    re7898b5 r045627a  
    199199    /**
    200200     * Specify the value given by the peer for use in the session key negotiation
    201      *
    202      */
    203     public void setPeerPublicValue(BigInteger peerVal) throws InvalidPublicParameterException {
     201     * @throws IllegalStateException if already set
     202     */
     203    public synchronized void setPeerPublicValue(BigInteger peerVal) throws InvalidPublicParameterException {
     204        if (_peerValue != null) {
     205            if (!_peerValue.equals(peerVal))
     206                throw new IllegalStateException();
     207            return;
     208        }
    204209        validatePublic(peerVal);
    205210        _peerValue = peerVal;
Note: See TracChangeset for help on using the changeset viewer.