b.appendUtf8(ByteIterator.ofBytes(serverSignature).base64Encode()); return new ScramFinalServerMessage(serverSignature, b.toArray()); } catch (NoSuchAlgorithmException | InvalidKeyException e) { throw saslScram.mechMacAlgorithmNotSupported(e);
setNegotiationState(COMPLETE_STATE); ok = true; return finalServerMessage.getMessageBytes();
byte[] serverSignature = mac.doFinal(); if(trace) saslScram.tracef("[C] Recovered server signature: %s%n", ByteIterator.ofBytes(serverSignature).hexEncode().drainToString()); if (! Arrays.equals(finalChallenge.getRawServerSignature(), serverSignature)) { throw saslScram.mechServerAuthenticityCannotBeVerified();
public ScramFinalServerMessage parseFinalServerMessage(final byte[] messageBytes) throws AuthenticationMechanismException { final ByteIterator bi = ByteIterator.ofBytes(messageBytes); final byte[] sig; try { int c = bi.next(); if (c == 'e') { if (bi.next() == '=') { throw saslScram.scramServerRejectedAuthentication(ScramServerErrorCode.fromErrorString(bi.delimitedBy(',').asUtf8String().drainToString())); } throw saslScram.mechInvalidMessageReceived(); } else if (c == 'v' && bi.next() == '=') { sig = bi.delimitedBy(',').asUtf8String().base64Decode().drain(); } else { throw saslScram.mechInvalidMessageReceived(); } if (bi.hasNext()) { throw saslScram.mechInvalidMessageReceived(); } } catch (IllegalArgumentException e) { throw saslScram.mechInvalidMessageReceived(); } return new ScramFinalServerMessage(sig, messageBytes); }
byte[] serverSignature = mac.doFinal(); if(trace) saslScram.tracef("[C] Recovered server signature: %s%n", ByteIterator.ofBytes(serverSignature).hexEncode().drainToString()); if (! Arrays.equals(finalChallenge.getRawServerSignature(), serverSignature)) { throw saslScram.mechServerAuthenticityCannotBeVerified();
setNegotiationState(COMPLETE_STATE); ok = true; return finalServerMessage.getMessageBytes();
b.appendUtf8(ByteIterator.ofBytes(serverSignature).base64Encode()); return new ScramFinalServerMessage(serverSignature, b.toArray()); } catch (NoSuchAlgorithmException | InvalidKeyException e) { throw saslScram.mechMacAlgorithmNotSupported(e);
byte[] serverSignature = mac.doFinal(); if(trace) saslScram.tracef("[C] Recovered server signature: %s%n", ByteIterator.ofBytes(serverSignature).hexEncode().drainToString()); if (! Arrays.equals(finalChallenge.getRawServerSignature(), serverSignature)) { throw saslScram.mechServerAuthenticityCannotBeVerified();
setNegotiationState(COMPLETE_STATE); ok = true; return finalServerMessage.getMessageBytes();
b.appendUtf8(ByteIterator.ofBytes(serverSignature).base64Encode()); return new ScramFinalServerMessage(serverSignature, b.toArray()); } catch (NoSuchAlgorithmException | InvalidKeyException e) { throw saslScram.mechMacAlgorithmNotSupported(e);
byte[] serverSignature = mac.doFinal(); if(trace) saslScram.tracef("[C] Recovered server signature: %s%n", ByteIterator.ofBytes(serverSignature).hexEncode().drainToString()); if (! Arrays.equals(finalChallenge.getRawServerSignature(), serverSignature)) { throw saslScram.mechServerAuthenticityCannotBeVerified();
setNegotiationState(COMPLETE_STATE); ok = true; return finalServerMessage.getMessageBytes();
b.appendUtf8(ByteIterator.ofBytes(serverSignature).base64Encode()); return new ScramFinalServerMessage(serverSignature, b.toArray()); } catch (NoSuchAlgorithmException | InvalidKeyException e) { throw saslScram.mechMacAlgorithmNotSupported(e);
public ScramFinalServerMessage parseFinalServerMessage(final byte[] messageBytes) throws AuthenticationMechanismException { final ByteIterator bi = ByteIterator.ofBytes(messageBytes); final byte[] sig; try { int c = bi.next(); if (c == 'e') { if (bi.next() == '=') { throw saslScram.scramServerRejectedAuthentication(ScramServerErrorCode.fromErrorString(bi.delimitedBy(',').asUtf8String().drainToString())); } throw saslScram.mechInvalidMessageReceived(); } else if (c == 'v' && bi.next() == '=') { sig = bi.delimitedBy(',').asUtf8String().base64Decode().drain(); } else { throw saslScram.mechInvalidMessageReceived(); } if (bi.hasNext()) { throw saslScram.mechInvalidMessageReceived(); } } catch (IllegalArgumentException e) { throw saslScram.mechInvalidMessageReceived(); } return new ScramFinalServerMessage(sig, messageBytes); }
public ScramFinalServerMessage parseFinalServerMessage(final byte[] messageBytes) throws AuthenticationMechanismException { final ByteIterator bi = ByteIterator.ofBytes(messageBytes); final byte[] sig; try { int c = bi.next(); if (c == 'e') { if (bi.next() == '=') { throw saslScram.scramServerRejectedAuthentication(ScramServerErrorCode.fromErrorString(bi.delimitedBy(',').asUtf8String().drainToString())); } throw saslScram.mechInvalidMessageReceived(); } else if (c == 'v' && bi.next() == '=') { sig = bi.delimitedBy(',').asUtf8String().base64Decode().drain(); } else { throw saslScram.mechInvalidMessageReceived(); } if (bi.hasNext()) { throw saslScram.mechInvalidMessageReceived(); } } catch (IllegalArgumentException e) { throw saslScram.mechInvalidMessageReceived(); } return new ScramFinalServerMessage(sig, messageBytes); }
public ScramFinalServerMessage parseFinalServerMessage(final byte[] messageBytes) throws AuthenticationMechanismException { final ByteIterator bi = ByteIterator.ofBytes(messageBytes); final byte[] sig; try { int c = bi.next(); if (c == 'e') { if (bi.next() == '=') { throw saslScram.scramServerRejectedAuthentication(ScramServerErrorCode.fromErrorString(bi.delimitedBy(',').asUtf8String().drainToString())); } throw saslScram.mechInvalidMessageReceived(); } else if (c == 'v' && bi.next() == '=') { sig = bi.delimitedBy(',').asUtf8String().base64Decode().drain(); } else { throw saslScram.mechInvalidMessageReceived(); } if (bi.hasNext()) { throw saslScram.mechInvalidMessageReceived(); } } catch (IllegalArgumentException e) { throw saslScram.mechInvalidMessageReceived(); } return new ScramFinalServerMessage(sig, messageBytes); }