Changeset 8fb7bd2


Ignore:
Timestamp:
Aug 2, 2018 11:48:55 AM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
8d629de2
Parents:
2e85c23
Message:

NTCP2: Remove debug code

Location:
router/java/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/com/southernstorm/noise/protocol/ChaChaPolyCipherState.java

    r2e85c23 r8fb7bd2  
    4242        private long n;
    4343        private boolean haskey;
    44         // I2P debug to be removed
    45         private byte[] initialKey;
    4644       
    4745        /**
     
    8381        @Override
    8482        public void initializeKey(byte[] key, int offset) {
    85                 // I2P debug to be removed
    86                 initialKey = new byte[32];
    87                 System.arraycopy(key, 0, initialKey, 0, 32);
    8883                ChaChaCore.initKey256(input, key, offset);
    8984                n = 0;
     
    295290
    296291        /**
    297          *  I2P debug to be removed
    298          *  @return null if none yet
    299          */
    300         public byte[] getKey() {
    301                 if (!haskey)
    302                         return null;
    303                 return initialKey;
    304         }
    305 
    306         /**
    307292         *  I2P debug
    308293         */
     
    313298                           "    nonce: ");
    314299                buf.append(n);
    315                 buf.append("\n" +
    316                            "    init key: ");
    317                 // I2P debug to be removed
    318                 if (haskey)
    319                         buf.append(net.i2p.data.Base64.encode(initialKey));
    320                 else
    321                         buf.append("null");
    322300                buf.append("\n    poly key: ");
    323301                if (haskey)
  • router/java/src/com/southernstorm/noise/protocol/CipherState.java

    r2e85c23 r8fb7bd2  
    156156         */
    157157        void setNonce(long nonce);
    158 
    159         /**
    160          *  I2P debug to be removed
    161          */
    162         public byte[] getKey();
    163158}
  • router/java/src/net/i2p/router/transport/ntcp/InboundEstablishState.java

    r2e85c23 r8fb7bd2  
    902902        CipherState rcvr = ckp.getReceiver();
    903903        CipherState sender = ckp.getSender();
    904         // debug, to be removed
    905         byte[] k_ab = rcvr.getKey();
    906         byte[] k_ba = sender.getKey();
    907904
    908905        // Data phase SipHash keys
     
    919916            if (_log.shouldDebug()) {
    920917                _log.debug("Finished establishment for " + this +
    921                           "\nGenerated ChaCha key for A->B: " + Base64.encode(k_ab) +
    922                           "\nGenerated ChaCha key for B->A: " + Base64.encode(k_ba) +
    923918                          "\nGenerated SipHash key for A->B: " + Base64.encode(sip_ab) +
    924919                          "\nGenerated SipHash key for B->A: " + Base64.encode(sip_ba));
  • router/java/src/net/i2p/router/transport/ntcp/OutboundNTCP2State.java

    r2e85c23 r8fb7bd2  
    405405        CipherState rcvr = ckp.getReceiver();
    406406        CipherState sender = ckp.getSender();
    407         // debug, to be removed
    408         byte[] k_ab = sender.getKey();
    409         byte[] k_ba = rcvr.getKey();
    410407
    411408        // Data phase SipHash keys
     
    416413        if (_log.shouldDebug()) {
    417414            _log.debug("Finished establishment for " + this +
    418                       "\nGenerated ChaCha key for A->B: " + Base64.encode(k_ab) +
    419                       "\nGenerated ChaCha key for B->A: " + Base64.encode(k_ba) +
    420415                      "\nGenerated SipHash key for A->B: " + Base64.encode(sip_ab) +
    421416                      "\nGenerated SipHash key for B->A: " + Base64.encode(sip_ba));
Note: See TracChangeset for help on using the changeset viewer.