diff --git a/allclasses-frame.html b/allclasses-frame.html index afaaf10..361f419 100644 --- a/allclasses-frame.html +++ b/allclasses-frame.html @@ -2,9 +2,9 @@ - + All Classes (Noise-Java) - + diff --git a/allclasses-noframe.html b/allclasses-noframe.html index 3304020..d1eb64d 100644 --- a/allclasses-noframe.html +++ b/allclasses-noframe.html @@ -2,9 +2,9 @@ - + All Classes (Noise-Java) - + diff --git a/com/southernstorm/noise/protocol/CipherState.html b/com/southernstorm/noise/protocol/CipherState.html index 166468f..76ab388 100644 --- a/com/southernstorm/noise/protocol/CipherState.html +++ b/com/southernstorm/noise/protocol/CipherState.html @@ -2,9 +2,9 @@ - + CipherState (Noise-Java) - + @@ -311,7 +311,7 @@ extends + javax.crypto.BadPaddingException
Decrypts a ciphertext buffer using the cipher and a block of associated data.
Parameters:
ad - The associated data, or null if there is none.
ciphertext - The buffer containing the ciphertext to decrypt.
ciphertextOffset - The offset within the ciphertext buffer of the first byte of ciphertext data.
plaintext - The buffer to place the plaintext in. This can be @@ -321,7 +321,7 @@ extends Throws:
javax.crypto.ShortBufferException - The plaintext buffer does not have enough space to store the decrypted data.
-
javax.crypto.AEADBadTagException - The MAC value failed to verify.
+
javax.crypto.BadPaddingException - The MAC value failed to verify.
java.lang.IllegalStateException - The nonce has wrapped around. The plaintext and ciphertext buffers can be the same for in-place @@ -351,14 +351,10 @@ extends void setNonce(long nonce)
Sets the nonce value.
Parameters:
nonce - The new nonce value, which must be greater than or equal - to the current value.
-
Throws:
-
java.lang.IllegalArgumentException - The nonce is less than the current value. + to the current value. - Note that in this implementation, nonces are 63-bit quantities. - The Noise specification normally allows for 64-bit nonces. - - Thie function is intended for testing purposes only.
+ This function is intended for testing purposes only. If the nonce + value goes backwards then security may be compromised.
diff --git a/com/southernstorm/noise/protocol/CipherStatePair.html b/com/southernstorm/noise/protocol/CipherStatePair.html index f416c90..887ed60 100644 --- a/com/southernstorm/noise/protocol/CipherStatePair.html +++ b/com/southernstorm/noise/protocol/CipherStatePair.html @@ -2,9 +2,9 @@ - + CipherStatePair (Noise-Java) - + diff --git a/com/southernstorm/noise/protocol/DHState.html b/com/southernstorm/noise/protocol/DHState.html index 11f0d07..0e4f312 100644 --- a/com/southernstorm/noise/protocol/DHState.html +++ b/com/southernstorm/noise/protocol/DHState.html @@ -2,9 +2,9 @@ - + DHState (Noise-Java) - + diff --git a/com/southernstorm/noise/protocol/Destroyable.html b/com/southernstorm/noise/protocol/Destroyable.html index fc2b5d8..80998be 100644 --- a/com/southernstorm/noise/protocol/Destroyable.html +++ b/com/southernstorm/noise/protocol/Destroyable.html @@ -2,9 +2,9 @@ - + Destroyable (Noise-Java) - + diff --git a/com/southernstorm/noise/protocol/HandshakeState.html b/com/southernstorm/noise/protocol/HandshakeState.html index 9f1567a..0fd3005 100644 --- a/com/southernstorm/noise/protocol/HandshakeState.html +++ b/com/southernstorm/noise/protocol/HandshakeState.html @@ -2,9 +2,9 @@ - + HandshakeState (Noise-Java) - + @@ -223,90 +223,96 @@ implements +void +fallback(java.lang.String patternName) +
Falls back to another handshake pattern.
+ + + int getAction()
Gets the next action that the application should perform for the handshake part of the protocol.
- + DHState getFixedEphemeralKey()
Gets the DHState object containing a fixed local ephemeral key value for this handshake.
- + byte[] getHandshakeHash()
Gets the current value of the handshake hash.
- + DHState getLocalKeyPair()
Gets the keypair object for the local static key.
- + java.lang.String getProtocolName()
Gets the name of the Noise protocol.
- + DHState getRemotePublicKey()
Gets the public key object for the remote static key.
- + int getRole()
Gets the role for this handshake.
- + boolean hasLocalKeyPair()
Determine if this handshake has already been configured with a local static key.
- + boolean hasPreSharedKey()
Determine if this object has already been configured with a pre-shared key.
- + boolean hasRemotePublicKey()
Determine if this handshake has already been configured with a remote static key.
- + boolean needsLocalKeyPair()
Determine if this handshake requires a local static key.
- + boolean needsPreSharedKey()
Determine if this handshake needs a pre-shared key value and one has not been configured yet.
- + boolean needsRemotePublicKey()
Determine if this handshake requires a remote static key.
- + int readMessage(byte[] message, int messageOffset, @@ -316,7 +322,7 @@ implements Reads a message payload during the handshake. - + void setPreSharedKey(byte[] key, int offset, @@ -324,7 +330,7 @@ implements Sets the pre-shared key for this handshake. - + void setPrologue(byte[] prologue, int offset, @@ -332,14 +338,14 @@ implements Sets the prologue for this handshake. - + CipherStatePair split()
Splits the transport encryption CipherState objects out of this HandshakeState object once the handshake completes.
- + CipherStatePair split(byte[] secondaryKey, int offset, @@ -348,13 +354,13 @@ implements + void start()
Starts the handshake running.
- + int writeMessage(byte[] message, int messageOffset, @@ -708,8 +714,8 @@ implements
See Also:
getAction(), + fallback handshake pattern without first calling fallback() on a + previous handshake.
See Also:
getAction(), writeMessage(byte[], int, byte[], int, int), readMessage(byte[], int, int, byte[], int), fallback()
@@ -725,11 +731,11 @@ implements Falls back to the "XXfallback" handshake pattern. - This function is used to help implement the "Noise Pipes" protocol. - It resets a HandshakeState object with the handshake pattern "IK", - converting it into an object with the handshake pattern "XXfallback". - Information from the previous session such as the local keypair, - the initiator's ephemeral key, the prologue value, and the + This function is intended used to help implement the "Noise Pipes" protocol. + It resets a HandshakeState object with the original handshake pattern + (usually "IK"), converting it into an object with the handshake pattern + "XXfallback". Information from the previous session such as the local + keypair, the initiator's ephemeral key, the prologue value, and the pre-shared key, are passed to the new session. Once the fallback has been initiated, the application can set @@ -739,13 +745,55 @@ implements Throws: -
java.lang.UnsupportedOperationException - The handshake pattern is - not currently set to "IK".
+
java.lang.UnsupportedOperationException - The current handshake pattern + is not compatible with "XXfallback".
+
java.lang.IllegalStateException - The previous protocol has not started + or it has not reached the fallback position yet.
+
java.security.NoSuchAlgorithmException - One of the cryptographic algorithms + that is specified in the new protocolName is not supported.
See Also:
start()
+ + + + + +
    +
  • +

    fallback

    +
    public void fallback(java.lang.String patternName)
    +              throws java.security.NoSuchAlgorithmException
    +
    Falls back to another handshake pattern.
    +
    Parameters:
    patternName - The name of the pattern to fall back to; + e.g. "XXfallback", "NXfallback", etc. + + This function resets a HandshakeState object with the original + handshake pattern, and converts it into an object with the new handshake + patternName. Information from the previous session such as the local + keypair, the initiator's ephemeral key, the prologue value, and the + pre-shared key, are passed to the new session. + + Once the fallback has been initiated, the application can set + new values for the handshake parameters if the values from the + previous session do not apply. For example, the application may + use a different prologue for the fallback than for the original + session. + + After setting any new parameters, the application calls start() + again to restart the handshake from where it left off before the fallback. + + The new pattern may have greater key requirements than the original; + for example changing from "NK" from "XXfallback" requires that the + initiator's static public key be set. The application is responsible for + setting any extra keys before calling start(). + + Note that this function reverses the roles of initiator and responder.
    +
    Throws:
    +
    java.lang.UnsupportedOperationException - The current handshake pattern + is not compatible with the patternName, or patternName is not a + fallback pattern.
    java.lang.IllegalStateException - The previous protocol has not started or it has not reached the fallback position yet.
    java.security.NoSuchAlgorithmException - One of the cryptographic algorithms @@ -806,7 +854,7 @@ implements Reads a message payload during the handshake.
    Parameters:
    message - Buffer containing the incoming handshake that was read from the transport.
    messageOffset - Offset of the first message byte.
    messageLength - The length of the incoming message.
    payload - Buffer that will be populated with the message payload.
    payloadOffset - Offset of the first byte in the @@ -817,7 +865,7 @@ implements See Also:
    getAction(), writeMessage(byte[], int, byte[], int, int)
  • diff --git a/com/southernstorm/noise/protocol/Noise.html b/com/southernstorm/noise/protocol/Noise.html index 7d2c722..da9154a 100644 --- a/com/southernstorm/noise/protocol/Noise.html +++ b/com/southernstorm/noise/protocol/Noise.html @@ -2,9 +2,9 @@ - + Noise (Noise-Java) - + @@ -177,6 +177,12 @@ extends java.lang.Object
    Generates random data using the system random number generator.
    + +static void +setForceFallbacks(boolean force) +
    Force the use of plain Java fallback crypto implementations.
    + + + + + +
      +
    • +

      setForceFallbacks

      +
      public static void setForceFallbacks(boolean force)
      +
      Force the use of plain Java fallback crypto implementations.
      +
      Parameters:
      force - Set to true for force fallbacks, false to + try to use the system implementation before falling back. + + This function is intended for testing purposes to toggle between + the system JCA/JCE implementations and the plain Java fallback + reference implementations.
      +
    • +
    diff --git a/com/southernstorm/noise/protocol/package-frame.html b/com/southernstorm/noise/protocol/package-frame.html index 934805a..6e4a48d 100644 --- a/com/southernstorm/noise/protocol/package-frame.html +++ b/com/southernstorm/noise/protocol/package-frame.html @@ -2,9 +2,9 @@ - + com.southernstorm.noise.protocol (Noise-Java) - + diff --git a/com/southernstorm/noise/protocol/package-summary.html b/com/southernstorm/noise/protocol/package-summary.html index c8d186b..9a0d131 100644 --- a/com/southernstorm/noise/protocol/package-summary.html +++ b/com/southernstorm/noise/protocol/package-summary.html @@ -2,9 +2,9 @@ - + com.southernstorm.noise.protocol (Noise-Java) - + diff --git a/com/southernstorm/noise/protocol/package-tree.html b/com/southernstorm/noise/protocol/package-tree.html index 3d21a6f..36070da 100644 --- a/com/southernstorm/noise/protocol/package-tree.html +++ b/com/southernstorm/noise/protocol/package-tree.html @@ -2,9 +2,9 @@ - + com.southernstorm.noise.protocol Class Hierarchy (Noise-Java) - + diff --git a/constant-values.html b/constant-values.html index 5a7e545..1c30f3a 100644 --- a/constant-values.html +++ b/constant-values.html @@ -2,9 +2,9 @@ - + Constant Field Values (Noise-Java) - + diff --git a/deprecated-list.html b/deprecated-list.html index c6affff..75caeb3 100644 --- a/deprecated-list.html +++ b/deprecated-list.html @@ -2,9 +2,9 @@ - + Deprecated List (Noise-Java) - + diff --git a/help-doc.html b/help-doc.html index 5810e5a..a5cfb8c 100644 --- a/help-doc.html +++ b/help-doc.html @@ -2,9 +2,9 @@ - + API Help (Noise-Java) - + diff --git a/index-all.html b/index-all.html index f612bcf..5b485c5 100644 --- a/index-all.html +++ b/index-all.html @@ -2,9 +2,9 @@ - + Index (Noise-Java) - + @@ -160,6 +160,10 @@
    Falls back to the "XXfallback" handshake pattern.
    +
    fallback(String) - Method in class com.southernstorm.noise.protocol.HandshakeState
    +
    +
    Falls back to another handshake pattern.
    +
    fork(byte[], int) - Method in interface com.southernstorm.noise.protocol.CipherState
    Creates a new instance of this cipher and initializes it with a key.
    @@ -386,6 +390,10 @@
    Destroys the receiving CipherState and retains only the sending CipherState.
    +
    setForceFallbacks(boolean) - Static method in class com.southernstorm.noise.protocol.Noise
    +
    +
    Force the use of plain Java fallback crypto implementations.
    +
    setNonce(long) - Method in interface com.southernstorm.noise.protocol.CipherState
    Sets the nonce value.
    diff --git a/index.html b/index.html index 846935f..2900daf 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + Noise-Java