I am studying the Oracle mechanism for authentication in a 10g database. Although less documented than its 9i mapper, I still managed to find many of its details on various websites and blogs. However, one part remains a mystery. Before mentioning what is missing, let me explain what is known about the protocol in pseudo-code:
// CLIENT SIDE PSEUDO CODE user = "SCOTT" password = "TIGER" password_hash = oracle_password_hash(user, password) // 1. Client provides user name to server send(user) // 2. Server responds with its encrypted AUTH_SESSKEY, // a randomly generated number associated with the current session encrypted_server_AUTH_SESSKEY = receive_AUTH_SESSKEY() // 32 bytes decrypted_server_AUTH_SESSKEY = aes_decrypt( encrypted_input => encrypted_server_AUTH_SESSKEY, decryption_key => password_hash ) // 3. Client generates its own AUTH_SESSKEY for this session unencrypted_client_AUTH_SESSKEY = generate_random_AUTH_SESSKEY() // 32 bytes encrypted_client_AUTH_SESSKEY = aes_encrypt( unencrypted_input => unencrypted_client_AUTH_SESSKEY, encryption_key => password_hash ) // 4. Client combines the two AUTH_SESSKEYs using a known Oracle-specific algorithm combined_AUTH_SESSKEYs = oracle_combine(decrypted_server_AUTH_SESSKEY, unencrypted_client_AUTH_SESSKEY) // 5. Client builds AUTH_PASSWORD unencrypted_AUTH_PASSWORD = byte[32] unencrypted_AUTH_PASSWORD[0 .. 16] = ??? // THIS IS THE PROBLEM unencrypted_AUTH_PASSWORD[16 .. 16 + len(password)] = password unencrypted_AUTH_PASSWORD[16 + len(password) .. ] = PKCS
What did the Oracle client put AUTH_PASSWORD in the bottom 16 bytes in step 5?
Almost all of the documentation I found only cares about getting the plain text password contained inside, paying little attention to these first bytes. I tried to look at the JDBC driver, but it seems that even version 10g avoids this authentication scheme, referring to the server returning to an older scheme (which is much better understood). The excellent C program demonstrates AUTH_PASSWORD decryption.
Can someone point me in the right direction?
source share