Examples of PasswordMessage


Examples of org.jruby.pg.internal.messages.PasswordMessage

      if (currentInMessage.remaining() == 0) {
        processMessage();
        state = state.nextState(currentInMessage.getMessage().getType());

        if (state == ConnectionState.SendingAuthentication) {
          PasswordMessage message = createPasswordMessage(currentInMessage.getMessage());
          currentOutBuffer = message.toBytes();
        }
        currentInMessage = new ProtocolMessageBuffer();
      }
    }
View Full Code Here

Examples of org.jruby.pg.internal.messages.PasswordMessage

  private PasswordMessage createPasswordMessage(ProtocolMessage message) {
    switch (message.getType()) {
    case AuthenticationCleartextPassword:
      if (password == null)
        return new PasswordMessage(new byte[0]);
      return new PasswordMessage(password.getBytes());
    case AuthenticationMD5Password:
      try {
        AuthenticationMD5Password auth = (AuthenticationMD5Password) message;
        byte[] firstmd5 = encrypt(password.getBytes(), user.getBytes());
        byte[] finalmd5 = encrypt(firstmd5, 3, auth.getSalt());
        return new PasswordMessage(finalmd5);
      } catch (Exception e) {
        // if I know what I'm doing then we shouldn't be here
        return null;
      }
    default:
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.