Skip to content

Commit

Permalink
fix logon problem with oracle 12.1.0.2 and high
Browse files Browse the repository at this point in the history
with sec_case_sensitive_logon=false and
SQLNET.ALLOWED_LOGON_VERSION_SERVER=11
  • Loading branch information
sijms committed Mar 12, 2021
1 parent b7b461d commit 675d9b1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion auth_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,27 +492,31 @@ func (obj *AuthObject) generatePasswordEncKey() ([]byte, error) {
key1 := obj.ServerSessKey
key2 := obj.ClientSessKey
start := 16
var retKeyLen int
logonCompatibility := obj.tcpNego.ServerCompileTimeCaps[4]
if logonCompatibility&32 != 0 {
var keyBuffer string
switch obj.VerifierType {
case 2361:
buffer := append(key2[:len(key2)/2], key1[:len(key1)/2]...)
keyBuffer = fmt.Sprintf("%X", buffer)
retKeyLen = 16
case 6949:
buffer := append(key2[:24], key1[:24]...)
keyBuffer = fmt.Sprintf("%X", buffer)
retKeyLen = 24
case 18453:
buffer := append(key2, key1...)
keyBuffer = fmt.Sprintf("%X", buffer)
retKeyLen = 32
default:
return nil, errors.New("unsupported verifier type")
}
df2key, err := HexStringToBytes(obj.pbkdf2ChkSalt)
if err != nil {
return nil, err
}
return generateSpeedyKey(df2key, []byte(keyBuffer), obj.pbkdf2SderCount)[:32], nil
return generateSpeedyKey(df2key, []byte(keyBuffer), obj.pbkdf2SderCount)[:retKeyLen], nil
} else {
switch obj.VerifierType {
case 2361:
Expand Down

0 comments on commit 675d9b1

Please sign in to comment.