Skip to content

Commit 7443a9e

Browse files
trigonometrYaroslav Panichkin
and
Yaroslav Panichkin
authored
fix: salt and iterations parsing for scram (#1026)
Co-authored-by: Yaroslav Panichkin <[email protected]>
1 parent 172b8f6 commit 7443a9e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

asyncpg/protocol/scram.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,12 @@ cdef class SCRAMAuthentication:
156156
if not self.server_nonce.startswith(self.client_nonce):
157157
raise Exception("invalid nonce")
158158
try:
159-
self.password_salt = re.search(b's=([^,]+),',
159+
self.password_salt = re.search(b',s=([^,]+),',
160160
self.server_first_message).group(1)
161161
except IndexError:
162162
raise Exception("could not get salt")
163163
try:
164-
self.password_iterations = int(re.search(b'i=(\d+),?',
164+
self.password_iterations = int(re.search(b',i=(\d+),?',
165165
self.server_first_message).group(1))
166166
except (IndexError, TypeError, ValueError):
167167
raise Exception("could not get iterations")

0 commit comments

Comments
 (0)