Changeset 9fafc25 for core


Ignore:
Timestamp:
Feb 21, 2019 2:58:58 PM (16 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
5440a34
Parents:
b37160fa
Message:

Data: Always set unpublished flag for inner LS (Enc LS2)
Fix setDestination()

File:
1 edited

Legend:

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

    rb37160fa r9fafc25  
    8989    @Override
    9090    public void setDestination(Destination dest) {
    91         super.setDestination(dest);
     91        if (_signature != null && _destination != null) {
     92            if (!dest.equals(_destination))
     93                throw new IllegalStateException();
     94        } else {
     95            _destination = dest;
     96        }
    9297        SigningPublicKey spk = dest.getSigningPublicKey();
    9398        SigType type = spk.getType();
     
    296301            throw new IllegalStateException("not signed");
    297302        ByteArrayOutputStream baos = new ByteArrayOutputStream();
     303        // inner LS is always unpublished
     304        int saveFlags = _flags;
     305        setUnpublished();
    298306        try {
    299307            // Inner layer - type - data covered by sig
     
    306314        } catch (IOException ioe) {
    307315            throw new IllegalStateException("Error encrypting LS2", ioe);
     316        } finally {
     317            _flags = saveFlags;
    308318        }
    309319
     
    454464        Log log = I2PAppContext.getGlobalContext().logManager().getLog(EncryptedLeaseSet.class);
    455465        // now sign inner with the unblinded key
     466        // inner LS is always unpublished
     467        int saveFlags = _flags;
     468        setUnpublished();
    456469        super.sign(key);
     470        _flags = saveFlags;
    457471        if (log.shouldDebug()) {
    458472            log.debug("Sign inner with key: " + key.getType() + ' ' + key.toBase64());
Note: See TracChangeset for help on using the changeset viewer.