Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for getAnsiHash (0.97 sec)

  1. src/test/java/jcifs/smb1/smb1/NtlmPasswordAuthenticationTest.java

        }
    
        // Test getAnsiHash always returns 24 bytes regardless of lmCompatibility
        @Test
        void testGetAnsiHashAlwaysReturns24Bytes() {
            NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication("DOMAIN", "user", "password");
            byte[] challenge = { 1, 2, 3, 4, 5, 6, 7, 8 };
            byte[] hash = auth.getAnsiHash(challenge);
            assertNotNull(hash);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 9.7K bytes
    - Viewed (0)
  2. src/main/java/jcifs/smb/NtlmPasswordAuthentication.java

         * {@inheritDoc}
         *
         * @see jcifs.smb.NtlmPasswordAuthenticator#getAnsiHash(jcifs.CIFSContext, byte[])
         */
        @Override
        public byte[] getAnsiHash(final CIFSContext tc, final byte[] chlng) throws GeneralSecurityException {
            if (this.hashesExternal) {
                return this.ansiHash;
            }
            return super.getAnsiHash(tc, chlng);
        }
    
        /**
         * {@inheritDoc}
         *
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 9.3K bytes
    - Viewed (0)
  3. src/main/java/jcifs/smb1/smb1/SmbComSessionSetupAndX.java

                        ntHash = new byte[0];
                        capabilities &= ~SmbConstants.CAP_EXTENDED_SECURITY;
                    } else if (session.transport.server.encryptedPasswords) {
                        lmHash = auth.getAnsiHash(session.transport.server.encryptionKey);
                        ntHash = auth.getUnicodeHash(session.transport.server.encryptionKey);
                        // prohibit HTTP auth attempts for the null session
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 7.1K bytes
    - Viewed (0)
  4. src/test/java/jcifs/smb1/smb1/SmbComSessionSetupAndXTest.java

            mockAuth.username = "testuser";
            mockAuth.domain = "TESTDOMAIN";
            mockAuth.password = "testpass";
    
            when(mockAuth.getAnsiHash(any(byte[].class))).thenReturn(new byte[24]);
            when(mockAuth.getUnicodeHash(any(byte[].class))).thenReturn(new byte[24]);
            when(mockAuth.getName()).thenReturn("testuser");
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 4.5K bytes
    - Viewed (0)
  5. src/main/java/jcifs/smb1/smb1/SmbComTreeConnectAndX.java

                if (session.transport.server.encryptedPasswords) {
                    // encrypted
                    password = session.auth.getAnsiHash(session.transport.server.encryptionKey);
                    passwordLength = password.length;
                } else if (DISABLE_PLAIN_TEXT_PASSWORDS) {
                    throw new RuntimeException("Plain text passwords are disabled");
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 6.6K bytes
    - Viewed (0)
  6. src/main/java/jcifs/internal/smb1/com/SmbComTreeConnectAndX.java

                    this.passwordLength = 1;
                } else if (this.server.encryptedPasswords) {
                    // encrypted
                    try {
                        this.password = pwAuth.getAnsiHash(this.ctx, this.server.encryptionKey);
                    } catch (final GeneralSecurityException e) {
                        throw new RuntimeCIFSException("Failed to encrypt password", e);
                    }
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 7.1K bytes
    - Viewed (0)
  7. src/main/java/jcifs/internal/smb1/com/SmbComSessionSetupAndX.java

                        }
                        this.primaryDomain = a.getUserDomain() != null ? a.getUserDomain().toUpperCase() : "?";
                        if (server.encryptedPasswords) {
                            this.lmHash = a.getAnsiHash(tc, server.encryptionKey);
                            this.ntHash = a.getUnicodeHash(tc, server.encryptionKey);
                            // prohibit HTTP auth attempts for the null session
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 8.9K bytes
    - Viewed (0)
  8. src/main/java/jcifs/smb/NtlmPasswordAuthenticator.java

         * @throws GeneralSecurityException if a security error occurs
         * @deprecated NTLMv1 is insecure. Use NTLMv2 (LM compatibility level 3 or higher)
         */
        @Deprecated
        public byte[] getAnsiHash(CIFSContext tc, byte[] chlng) throws GeneralSecurityException {
            int compatibility = tc.getConfig().getLanManCompatibility();
    
            // Log warning for insecure NTLMv1 usage
            if (compatibility < 3) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 30.3K bytes
    - Viewed (0)
  9. src/main/java/jcifs/smb1/smb1/NtlmPasswordAuthentication.java

        /**
         * Computes the 24 byte ANSI password hash given the 8 byte server challenge.
         *
         * @param challenge the server challenge bytes
         * @return the ANSI password hash
         */
        public byte[] getAnsiHash(final byte[] challenge) {
            if (hashesExternal) {
                return ansiHash;
            }
            switch (LM_COMPATIBILITY) {
            case 0:
            case 1:
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 26.7K bytes
    - Viewed (0)
Back to top