Examples of Type3Message


Examples of jcifs.ntlmssp.Type3Message

  }

  public NtlmUserAccount authenticate(byte[] material, byte[] serverChallenge)
    throws IOException, NoSuchAlgorithmException, NtlmLogonException {

    Type3Message type3Message = new Type3Message(material);

    if (type3Message.getFlag(
        _NTLMSSP_NEGOTIATE_EXTENDED_SESSION_SECURITY) &&
      (type3Message.getNTResponse().length == 24)) {

      MessageDigest messageDigest = MessageDigest.getInstance("MD5");

      byte[] bytes = new byte[16];

      System.arraycopy(serverChallenge, 0, bytes, 0, 8);
      System.arraycopy(type3Message.getLMResponse(), 0, bytes, 8, 8);

      messageDigest.update(bytes);

      serverChallenge = messageDigest.digest();
    }

    return _netlogon.logon(
       type3Message.getDomain(), type3Message.getUser(),
       type3Message.getWorkstation(), serverChallenge,
       type3Message.getNTResponse(), type3Message.getLMResponse());
  }
View Full Code Here

Examples of jcifs.ntlmssp.Type3Message

        try {
            t2m = new Type2Message(Base64.decode(challenge));
        } catch (IOException ex) {
            throw new NTLMEngineException("Invalid Type2 message", ex);
        }
        Type3Message t3m = new Type3Message(t2m, password, domain, username, workstation);
        return Base64.encode(t3m.toByteArray());
    }
View Full Code Here

Examples of jcifs.ntlmssp.Type3Message

            return Base64.encode(type1Message.toByteArray());
        }

        public String generateType3Msg(String username, String password, String domain, String workstation, String challenge) throws NTLMEngineException {
            Type2Message type2Message = decodeType2Message(challenge);
            Type3Message type3Message = new Type3Message(type2Message, password, domain, username, workstation, Type3Message.getDefaultFlags());
            return Base64.encode(type3Message.toByteArray());
        }
View Full Code Here

Examples of jcifs.ntlmssp.Type3Message

            String domain = credentials.substring(0, credentials.indexOf("\\"));
            String user = credentials.substring(domain.length()+1, credentials.indexOf(":"));
            String password = credentials.substring(domain.length()+user.length()+2);
            Type2Message type2 = (Type2Message) message;
            flags ^= NtlmFlags.NTLMSSP_NEGOTIATE_OEM;
            message = new Type3Message(type2, password, domain, user, null, flags);
        }
        return authMethod + " " + Base64.encode(message.toByteArray());
    }
View Full Code Here

Examples of jcifs.ntlmssp.Type3Message

          // confidentiality, session security and 128-bit encryption while creating TYpe3Message.
          // As the immediate lines of code below to the constructor set all these required flags, passing 0 as a parameter/falg to create
          // Type3Message object is valid. Please refer the below URL for more details.
          // http://code.google.com/p/google-enterprise-connector-sharepoint/issues/detail?id=63

      Type3Message t3m = new Type3Message(t2m, password, domain, username, host, 0);

          t3m.setFlag(NtlmSsp.NTLMSSP_NEGOTIATE_SIGN,true);
          t3m.setFlag(NtlmSsp.NTLMSSP_NEGOTIATE_SEAL,true);
          t3m.setFlag(NtlmSsp.NTLMSSP_NEGOTIATE_NTLM2,true);
          t3m.setFlag(NtlmSsp.NTLMSSP_NEGOTIATE_128,true);

          return EncodingUtil.getAsciiString(Base64.encodeBase64(t3m.toByteArray()));
          }catch(IOException e)
          {
            throw new AuthenticationException(e.getMessage());
          }
        }
View Full Code Here

Examples of jcifs.ntlmssp.Type3Message

      // confidentiality, session security and 128-bit encryption while creating TYpe3Message
      // object.as the immediate lines of code below to this constructor set all these required flags, passing 0 as a parameter/falg to create
      // Type3Message object is valid. Please refer the below URL for more details.
      // http://code.google.com/p/google-enterprise-connector-sharepoint/issues/detail?id=63

      Type3Message t3m = new Type3Message(t2m, password, domain, username, host, 0);

      t3m.setFlag(NtlmSsp.NTLMSSP_NEGOTIATE_SIGN,true);
      t3m.setFlag(NtlmSsp.NTLMSSP_NEGOTIATE_SEAL,true);
      t3m.setFlag(NtlmSsp.NTLMSSP_NEGOTIATE_NTLM2,true);
      t3m.setFlag(NtlmSsp.NTLMSSP_NEGOTIATE_128,true);
     
      return EncodingUtil.getAsciiString(Base64.encodeBase64(t3m.toByteArray()));
      }catch(IOException e)
      {
        throw new AuthenticationException(e.getMessage());
      }
    }
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.