Skip to content

Commit c234476

Browse files
committed
remove sasl and legacy crypto
1 parent 7d1deb7 commit c234476

File tree

5 files changed

+1
-271
lines changed

5 files changed

+1
-271
lines changed

packages/pg/lib/client.js

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
var EventEmitter = require('events').EventEmitter
44
var utils = require('./utils')
5-
var sasl = require('./crypto/sasl')
65
var TypeOverrides = require('./type-overrides')
76

87
var ConnectionParameters = require('./connection-parameters')
@@ -178,10 +177,6 @@ class Client extends EventEmitter {
178177
con.on('authenticationCleartextPassword', this._handleAuthCleartextPassword.bind(this))
179178
// password request handling
180179
con.on('authenticationMD5Password', this._handleAuthMD5Password.bind(this))
181-
// password request handling (SASL)
182-
con.on('authenticationSASL', this._handleAuthSASL.bind(this))
183-
con.on('authenticationSASLContinue', this._handleAuthSASLContinue.bind(this))
184-
con.on('authenticationSASLFinal', this._handleAuthSASLFinal.bind(this))
185180
con.on('backendKeyData', this._handleBackendKeyData.bind(this))
186181
con.on('error', this._handleErrorEvent.bind(this))
187182
con.on('errorMessage', this._handleErrorMessage.bind(this))
@@ -255,35 +250,6 @@ class Client extends EventEmitter {
255250
})
256251
}
257252

258-
_handleAuthSASL(msg) {
259-
this._checkPgPass(() => {
260-
try {
261-
this.saslSession = sasl.startSession(msg.mechanisms)
262-
this.connection.sendSASLInitialResponseMessage(this.saslSession.mechanism, this.saslSession.response)
263-
} catch (err) {
264-
this.connection.emit('error', err)
265-
}
266-
})
267-
}
268-
269-
async _handleAuthSASLContinue(msg) {
270-
try {
271-
await sasl.continueSession(this.saslSession, this.password, msg.data)
272-
this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)
273-
} catch (err) {
274-
this.connection.emit('error', err)
275-
}
276-
}
277-
278-
_handleAuthSASLFinal(msg) {
279-
try {
280-
sasl.finalizeSession(this.saslSession, msg.data)
281-
this.saslSession = null
282-
} catch (err) {
283-
this.connection.emit('error', err)
284-
}
285-
}
286-
287253
_handleBackendKeyData(msg) {
288254
this.processID = msg.processID
289255
this.secretKey = msg.secretKey

packages/pg/lib/connection.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,7 @@ class Connection extends EventEmitter {
132132
password(password) {
133133
this._send(serialize.password(password))
134134
}
135-
136-
sendSASLInitialResponseMessage(mechanism, initialResponse) {
137-
this._send(serialize.sendSASLInitialResponseMessage(mechanism, initialResponse))
138-
}
139-
135+
140136
sendSCRAMClientFinalMessage(additionalData) {
141137
this._send(serialize.sendSCRAMClientFinalMessage(additionalData))
142138
}

packages/pg/lib/crypto/sasl.js

Lines changed: 0 additions & 186 deletions
This file was deleted.

packages/pg/lib/crypto/utils-legacy.js

Lines changed: 0 additions & 37 deletions
This file was deleted.

packages/pg/lib/crypto/utils.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)