Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 108 for salt (0.11 sec)

  1. src/test/java/jcifs/internal/smb2/nego/PreauthIntegrityNegotiateContextTest.java

            }
    
            @Test
            @DisplayName("Should return salt correctly")
            void testGetSalt() {
                int[] hashAlgos = { 0x01 };
                byte[] salt = { 0x01, 0x02, 0x03, 0x04 };
                PreauthIntegrityNegotiateContext context = new PreauthIntegrityNegotiateContext(mockConfig, hashAlgos, salt);
    
                assertArrayEquals(salt, context.getSalt());
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 34K bytes
    - Viewed (0)
  2. src/test/java/jcifs/smb/PreauthIntegrityServiceTest.java

        @Test
        @DisplayName("Test preauth salt generation")
        public void testPreauthSaltGeneration() {
            byte[] salt1 = preauthService.generatePreauthSalt();
            byte[] salt2 = preauthService.generatePreauthSalt();
    
            assertNotNull(salt1);
            assertNotNull(salt2);
            assertEquals(32, salt1.length); // 32 bytes as per SMB 3.1.1 spec
            assertEquals(32, salt2.length);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 11.1K bytes
    - Viewed (0)
  3. src/main/java/jcifs/internal/smb2/nego/PreauthIntegrityNegotiateContext.java

            this.hashAlgos = hashAlgos;
            this.salt = salt;
        }
    
        /**
         * Default constructor for deserialization.
         */
        public PreauthIntegrityNegotiateContext() {
        }
    
        /**
         * Gets the salt value used for preauth integrity.
         *
         * @return the salt
         */
        public byte[] getSalt() {
            return this.salt;
        }
    
        /**
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 4.4K bytes
    - Viewed (0)
  4. src/test/java/jcifs/util/SecureCredentialStorageTest.java

            } finally {
                storage2.close();
            }
    
            // Clean up
            Arrays.fill(plaintext, '\0');
        }
    
        @Test
        public void testSaltRetrieval() throws Exception {
            byte[] salt = storage.getSalt();
            assertNotNull(salt, "Salt should not be null");
            assertEquals(32, salt.length, "Salt should be 32 bytes");
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 12.7K bytes
    - Viewed (0)
  5. src/main/java/jcifs/smb/PreauthIntegrityService.java

        }
    
        /**
         * Generates a new preauth salt for SMB 3.1.1 negotiation.
         *
         * @return a cryptographically secure random salt
         */
        public byte[] generatePreauthSalt() {
            byte[] salt = new byte[SALT_SIZE];
            secureRandom.nextBytes(salt);
            log.debug("Generated new preauth salt of {} bytes", salt.length);
            return salt;
        }
    
        /**
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 12.1K bytes
    - Viewed (0)
  6. src/main/java/jcifs/internal/smb2/nego/Smb2NegotiateRequest.java

                final byte[] salt = new byte[32];
                config.getRandom().nextBytes(salt);
                negoContexts.add(
                        new PreauthIntegrityNegotiateContext(config, new int[] { PreauthIntegrityNegotiateContext.HASH_ALGO_SHA512 }, salt));
                this.preauthSalt = salt;
    
                if (config.isEncryptionEnabled()) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 9.3K bytes
    - Viewed (0)
  7. src/test/java/jcifs/internal/smb2/nego/NegotiateContextRequestTest.java

                int[] hashAlgos = { 1, 2 };
                byte[] salt = new byte[8];
                Arrays.fill(salt, (byte) 0xFF);
    
                context = new PreauthIntegrityNegotiateContext(mockConfig, hashAlgos, salt);
    
                // Encode at position 100
                int encoded = context.encode(buffer, 100);
                assertEquals(context.size(), encoded);
    
                // Verify salt is at correct position
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 18.8K bytes
    - Viewed (0)
  8. src/main/java/jcifs/util/SecureCredentialStorage.java

            }
            if (salt == null || salt.length != SALT_SIZE) {
                throw new IllegalArgumentException("Invalid salt");
            }
    
            this.salt = salt.clone();
            this.masterKey = deriveKey(masterPassword, this.salt);
    
            // Clear the master password after use
            Arrays.fill(masterPassword, '\0');
        }
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 12.7K bytes
    - Viewed (0)
  9. src/test/java/jcifs/internal/smb2/nego/NegotiateContextResponseTest.java

                byte[] buffer = new byte[] { 0x02, 0x00, // 2 hash algos
                        0x04, 0x00, // 4 bytes salt
                        0x01, 0x00, // SHA512
                        0x02, 0x00, // Another hash algo
                        0x0A, 0x0B, 0x0C, 0x0D // Salt
                };
    
                // Act
                int decodedSize = context.decode(buffer, 0, buffer.length);
    
                // Assert
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 19.4K bytes
    - Viewed (0)
  10. src/test/java/jcifs/internal/smb2/nego/Smb2NegotiateRequestTest.java

            when(mockConfig.getMachineId()).thenReturn(testMachineId);
            when(mockConfig.getRandom()).thenReturn(mockRandom);
            when(mockContext.getConfig()).thenReturn(mockConfig);
    
            // Mock random for predictable salt generation
            doAnswer(invocation -> {
                byte[] buffer = invocation.getArgument(0);
                System.arraycopy(testSalt, 0, buffer, 0, Math.min(buffer.length, testSalt.length));
                return null;
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 20.7K bytes
    - Viewed (0)
Back to top