Skip to content

Commit 08ab05e

Browse files
Copilotmariuz
andcommitted
Fix alignment calculation in sendOpContAuth causing login errors
Co-authored-by: mariuz <18359+mariuz@users.noreply.github.com>
1 parent cb84f2d commit 08ab05e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/wire/connection.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,8 @@ class Connection {
233233
// Send authData as length-prefixed buffer, not string
234234
msg.addInt(authDataBuffer.length);
235235
msg.addBuffer(authDataBuffer);
236-
// Add alignment padding
237-
var alen = (authDataBuffer.length + 3) & ~3;
238-
msg.addAlignment(alen - authDataBuffer.length);
236+
// Add alignment padding - addAlignment calculates padding from data length
237+
msg.addAlignment(authDataBuffer.length);
239238

240239
msg.addString(pluginName, Const.DEFAULT_ENCODING)
241240
msg.addString(Const.AUTH_PLUGIN_LIST.join(','), Const.DEFAULT_ENCODING);

0 commit comments

Comments
 (0)