public String getMessage() { return super.getMessage() + ": " + error.getText(); }
ScramServerErrorCode() { text = name().replace('_', '-').toLowerCase(Locale.US); final int length = text.length(); byte[] msg = new byte[length + 2]; msg[0] = 'e'; msg[1] = '='; System.arraycopy(text.getBytes(StandardCharsets.UTF_8), 0, msg, 2, length); messageBytes = msg; }
public static ScramServerErrorCode fromErrorString(String value) { try { return valueOf(value.replace('-', '_').toUpperCase(Locale.US)); } catch (IllegalArgumentException ignored) { return OTHER_ERROR; } }
setNegotiationState(FAILED_STATE); if (saslScram.isDebugEnabled()) { saslScram.debugf(cause, "[%s] error when evaluating message from client during state [%s]: %s", getMechanismName(), state, cause.getError().getText()); return cause.getError().getMessageBytes(); } catch (AuthenticationMechanismException e) { throw e.toSaslException();
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); }
setNegotiationState(FAILED_STATE); if (saslScram.isDebugEnabled()) { saslScram.debugf(cause, "[%s] error when evaluating message from client during state [%s]: %s", getMechanismName(), state, cause.getError().getText()); return cause.getError().getMessageBytes(); } catch (AuthenticationMechanismException e) { throw e.toSaslException();
bi.next(); if (bi.next() == '=') { throw saslScram.scramServerRejectedAuthentication(ScramServerErrorCode.fromErrorString(bi.delimitedBy(',').asUtf8String().drainToString()));
setNegotiationState(FAILED_STATE); if (saslScram.isDebugEnabled()) { saslScram.debugf(cause, "[%s] error when evaluating message from client during state [%s]: %s", getMechanismName(), state, cause.getError().getText()); return cause.getError().getMessageBytes(); } catch (AuthenticationMechanismException e) { throw e.toSaslException();
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 static ScramServerErrorCode fromErrorString(String value) { try { return valueOf(value.replace('-', '_').toUpperCase(Locale.US)); } catch (IllegalArgumentException ignored) { return OTHER_ERROR; } }
ScramServerErrorCode() { text = name().replace('_', '-').toLowerCase(Locale.US); final int length = text.length(); byte[] msg = new byte[length + 2]; msg[0] = 'e'; msg[1] = '='; System.arraycopy(text.getBytes(StandardCharsets.UTF_8), 0, msg, 2, length); messageBytes = msg; }
public String getMessage() { return super.getMessage() + ": " + error.getText(); }
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 static ScramServerErrorCode fromErrorString(String value) { try { return valueOf(value.replace('-', '_').toUpperCase(Locale.US)); } catch (IllegalArgumentException ignored) { return OTHER_ERROR; } }
ScramServerErrorCode() { text = name().replace('_', '-').toLowerCase(Locale.US); final int length = text.length(); byte[] msg = new byte[length + 2]; msg[0] = 'e'; msg[1] = '='; System.arraycopy(text.getBytes(StandardCharsets.UTF_8), 0, msg, 2, length); messageBytes = msg; }
public String getMessage() { return super.getMessage() + ": " + error.getText(); }
bi.next(); if (bi.next() == '=') { throw saslScram.scramServerRejectedAuthentication(ScramServerErrorCode.fromErrorString(bi.delimitedBy(',').asUtf8String().drainToString()));
bi.next(); if (bi.next() == '=') { throw saslScram.scramServerRejectedAuthentication(ScramServerErrorCode.fromErrorString(bi.delimitedBy(',').asUtf8String().drainToString()));