DiscofyAPI/node_modules/mariadb/lib/cmd/handshake/auth/clear-password-auth.js

24 lines
606 B
JavaScript
Raw Permalink Normal View History

2021-03-25 17:23:36 +01:00
const PluginAuth = require('./plugin-auth');
/**
* Send password in clear.
* (used only when SSL is active)
*/
class ClearPasswordAuth extends PluginAuth {
constructor(packSeq, compressPackSeq, pluginData, resolve, reject, multiAuthResolver) {
super(resolve, reject, multiAuthResolver);
this.sequenceNo = packSeq;
}
start(out, opts, info) {
out.startPacket(this);
if (opts.password) out.writeString(opts.password);
out.writeInt8(0);
out.flushBuffer(true);
this.emit('send_end');
this.onPacketReceive = this.successSend;
}
}
module.exports = ClearPasswordAuth;