Changeset 4a96e88


Ignore:
Timestamp:
Oct 2, 2010 3:00:30 PM (10 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
6100c79
Parents:
ed4c09b
Message:
  • Hash: Throw IAE if data length is not 32 bytes,

now that DSAEngine abuse is gone

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/data/Hash.java

    red4c09b r4a96e88  
    3232    }
    3333
     34    /** @throws IllegalArgumentException if data is not 32 bytes (null is ok) */
    3435    public Hash(byte data[]) {
    3536        setData(data);
     
    4041    }
    4142
     43    /** @throws IllegalArgumentException if data is not 32 bytes (null is ok) */
    4244    public void setData(byte[] data) {
     45        if (data != null && data.length != HASH_LENGTH)
     46            throw new IllegalArgumentException("Hash must be 32 bytes");
    4347        _data = data;
    4448        _stringified = null;
Note: See TracChangeset for help on using the changeset viewer.