Skip to content

Commit 63a3854

Browse files
The error "DPY-3015: unsupported password verifier type" is now raised when
the database sends a password challenge with a verifier type that is not recognized, instead of "ORA-01017: invalid username/password" (#26).
1 parent 914e2d8 commit 63a3854

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

doc/src/release_notes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ Thin Mode Changes
1818
#) The error `DPY-2030: LOB offset must be greater than zero` is now raised
1919
when the offset parameter to :func:`LOB.read()` is zero or negative
2020
(`issue 13 <https://github.com/oracle/python-oracledb/issues/13>`__).
21+
#) The error `DPY-3015: unsupported password verifier type` is now raised when
22+
the database sends a password challenge with a verifier type that is not
23+
recognized, instead of `ORA-01017: invalid username/password`
24+
(`issue 26 <https://github.com/oracle/python-oracledb/issues/26>`__).
2125
#) Internally make use of the `TCP_NODELAY` socket option to remove delays
2226
in socket reads.
2327

src/oracledb/errors.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ def _raise_from_string(exc_type: Exception, message: str) -> None:
171171
ERR_NCHAR_CS_NOT_SUPPORTED = 3012
172172
ERR_UNSUPPORTED_PYTHON_TYPE_FOR_VAR = 3013
173173
ERR_LOB_OF_WRONG_TYPE = 3014
174+
ERR_UNSUPPORTED_VERIFIER_TYPE = 3015
174175

175176
# error numbers that result in DatabaseError
176177
ERR_TNS_ENTRY_NOT_FOUND = 4000
@@ -437,6 +438,8 @@ def _raise_from_string(exc_type: Exception, message: str) -> None:
437438
'{db_type_name}',
438439
ERR_UNSUPPORTED_VAR_SET:
439440
'variable of type {db_type_name} does not support being set',
441+
ERR_UNSUPPORTED_VERIFIER_TYPE:
442+
'unsupported password verifier type: 0x{verifier_type:x}',
440443
ERR_WALLET_FILE_MISSING:
441444
'cannot connect to database. Wallet file {name} was not found',
442445
ERR_WRONG_ARRAY_DEFINITION:

src/oracledb/impl/thin/constants.pxi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,8 +596,9 @@ DEF TNS_RCAP_TTC_ZERO_COPY = 0x01
596596
DEF TNS_RCAP_TTC_32K = 0x04
597597

598598
# verifier types
599-
DEF TNS_VERIFIER_TYPE_SHA1 = 45394
600-
DEF TNS_VERIFIER_TYPE_SSHA1 = 6949
599+
DEF TNS_VERIFIER_TYPE_11G_1 = 0xb152
600+
DEF TNS_VERIFIER_TYPE_11G_2 = 0x1b25
601+
DEF TNS_VERIFIER_TYPE_12C = 0x4815
601602

602603
# other constants
603604
DEF TNS_MAX_SHORT_LENGTH = 252

src/oracledb/impl/thin/messages.pyx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,9 +1477,13 @@ cdef class AuthMessage(Message):
14771477
if self.purity != 0:
14781478
num_pairs += 1
14791479
self.auth_mode |= TNS_AUTH_MODE_WITH_PASSWORD
1480-
if self.verifier_type == TNS_VERIFIER_TYPE_SHA1 \
1481-
or self.verifier_type == TNS_VERIFIER_TYPE_SSHA1:
1480+
1481+
if self.verifier_type in (TNS_VERIFIER_TYPE_11G_1,
1482+
TNS_VERIFIER_TYPE_11G_2):
14821483
verifier_11g = True
1484+
elif self.verifier_type != TNS_VERIFIER_TYPE_12C:
1485+
errors._raise_err(errors.ERR_UNSUPPORTED_VERIFIER_TYPE,
1486+
verifier_type=self.verifier_type)
14831487
else:
14841488
num_pairs += 1
14851489
self._generate_verifier(verifier_11g)

0 commit comments

Comments
 (0)