oracledb 6.9.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/LICENSE.txt +1 -1
  2. package/NOTICE.txt +1 -1
  3. package/README.md +9 -9
  4. package/build/Release/oracledb-7.0.0-darwin-arm64.node +0 -0
  5. package/build/Release/oracledb-7.0.0-darwin-arm64.node-buildinfo.txt +1 -0
  6. package/build/Release/oracledb-7.0.0-js-buildinfo.txt +1 -0
  7. package/build/Release/oracledb-7.0.0-linux-arm64.node +0 -0
  8. package/build/Release/oracledb-7.0.0-linux-arm64.node-buildinfo.txt +1 -0
  9. package/build/Release/oracledb-7.0.0-linux-x64.node +0 -0
  10. package/build/Release/oracledb-7.0.0-linux-x64.node-buildinfo.txt +1 -0
  11. package/build/Release/oracledb-7.0.0-win32-x64.node +0 -0
  12. package/build/Release/oracledb-7.0.0-win32-x64.node-buildinfo.txt +1 -0
  13. package/eslint.config.js +39 -0
  14. package/lib/aqDeqOptions.js +18 -1
  15. package/lib/aqQueue.js +10 -6
  16. package/lib/connection.js +418 -39
  17. package/lib/dbObject.js +25 -4
  18. package/lib/endUserSecurityContext.js +176 -0
  19. package/lib/errors.js +99 -8
  20. package/lib/impl/aqDeqOptions.js +10 -1
  21. package/lib/impl/connection.js +76 -2
  22. package/lib/impl/datahandlers/buffer.js +68 -5
  23. package/lib/impl/datahandlers/oson.js +7 -2
  24. package/lib/impl/datahandlers/vector.js +25 -5
  25. package/lib/impl/lob.js +9 -0
  26. package/lib/impl/parserHelpers.js +443 -0
  27. package/lib/impl/resultset.js +1 -1
  28. package/lib/impl/sodaDocument.js +5 -14
  29. package/lib/lob.js +27 -14
  30. package/lib/obfuscation.js +97 -0
  31. package/lib/oracledb.js +163 -49
  32. package/lib/parser.js +204 -0
  33. package/lib/pipeline.js +113 -0
  34. package/lib/pool.js +203 -147
  35. package/lib/poolStatistics.js +1 -1
  36. package/lib/resultset.js +42 -21
  37. package/lib/settings.js +1 -0
  38. package/lib/sodaCollection.js +12 -8
  39. package/lib/sodaDatabase.js +35 -8
  40. package/lib/sodaDocument.js +24 -6
  41. package/lib/sodaOperation.js +7 -6
  42. package/lib/thin/aq.js +475 -0
  43. package/lib/thin/connection.js +518 -54
  44. package/lib/thin/dbObject.js +7 -1
  45. package/lib/thin/lob.js +20 -1
  46. package/lib/thin/pool.js +42 -62
  47. package/lib/thin/protocol/capabilities.js +21 -4
  48. package/lib/thin/protocol/constants.js +143 -2
  49. package/lib/thin/protocol/encryptDecrypt.js +45 -10
  50. package/lib/thin/protocol/messages/aqArray.js +238 -0
  51. package/lib/thin/protocol/messages/aqBase.js +305 -0
  52. package/lib/thin/protocol/messages/aqDeq.js +164 -0
  53. package/lib/thin/protocol/messages/aqEnq.js +135 -0
  54. package/lib/thin/protocol/messages/auth.js +18 -28
  55. package/lib/thin/protocol/messages/base.js +245 -4
  56. package/lib/thin/protocol/messages/dataType.js +8 -3
  57. package/lib/thin/protocol/messages/directPathLoadStream.js +377 -0
  58. package/lib/thin/protocol/messages/directPathOp.js +65 -0
  59. package/lib/thin/protocol/messages/directPathPrepare.js +158 -0
  60. package/lib/thin/protocol/messages/endPipeline.js +56 -0
  61. package/lib/thin/protocol/messages/execute.js +9 -7
  62. package/lib/thin/protocol/messages/index.js +9 -1
  63. package/lib/thin/protocol/messages/protocol.js +2 -2
  64. package/lib/thin/protocol/messages/withData.js +10 -142
  65. package/lib/thin/protocol/packet.js +120 -28
  66. package/lib/thin/protocol/protocol.js +110 -25
  67. package/lib/thin/protocol/utils.js +1 -26
  68. package/lib/thin/resultSet.js +13 -19
  69. package/lib/thin/sqlnet/ezConnectResolver.js +2 -2
  70. package/lib/thin/sqlnet/networkSession.js +63 -41
  71. package/lib/thin/sqlnet/ntTcp.js +24 -0
  72. package/lib/thin/sqlnet/nvStrToNvPair.js +50 -25
  73. package/lib/thin/sqlnet/packet.js +25 -4
  74. package/lib/thin/sqlnet/paramParser.js +10 -7
  75. package/lib/thin/statementCache.js +2 -4
  76. package/lib/traceHandler.js +59 -2
  77. package/lib/transformer.js +8 -3
  78. package/lib/types.js +36 -22
  79. package/lib/util.js +6 -19
  80. package/lib/version.js +3 -3
  81. package/package/install.js +5 -5
  82. package/package/prunebinaries.js +1 -1
  83. package/package.json +1 -1
  84. package/plugins/configProviders/awsCommon.js +125 -0
  85. package/plugins/configProviders/awss3/index.js +138 -0
  86. package/plugins/configProviders/awssecretsmanager/index.js +147 -0
  87. package/plugins/configProviders/azure/index.js +7 -5
  88. package/plugins/token/extensionAzure/index.js +0 -1
  89. package/plugins/token/extensionOci/index.js +0 -1
  90. package/build/Release/oracledb-6.9.0-darwin-arm64.node +0 -0
  91. package/build/Release/oracledb-6.9.0-darwin-arm64.node-buildinfo.txt +0 -1
  92. package/build/Release/oracledb-6.9.0-darwin-x64.node +0 -0
  93. package/build/Release/oracledb-6.9.0-darwin-x64.node-buildinfo.txt +0 -1
  94. package/build/Release/oracledb-6.9.0-js-buildinfo.txt +0 -1
  95. package/build/Release/oracledb-6.9.0-linux-arm64.node +0 -0
  96. package/build/Release/oracledb-6.9.0-linux-arm64.node-buildinfo.txt +0 -1
  97. package/build/Release/oracledb-6.9.0-linux-x64.node +0 -0
  98. package/build/Release/oracledb-6.9.0-linux-x64.node-buildinfo.txt +0 -1
  99. package/build/Release/oracledb-6.9.0-win32-x64.node +0 -0
  100. package/build/Release/oracledb-6.9.0-win32-x64.node-buildinfo.txt +0 -1
@@ -0,0 +1,164 @@
1
+ // Copyright (c) 2025, Oracle and/or its affiliates.
2
+
3
+ //-----------------------------------------------------------------------------
4
+ //
5
+ // This software is dual-licensed to you under the Universal Permissive License
6
+ // (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
7
+ // 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose
8
+ // either license.
9
+ //
10
+ // If you elect to accept the software under the Apache License, Version 2.0,
11
+ // the following applies:
12
+ //
13
+ // Licensed under the Apache License, Version 2.0 (the "License");
14
+ // you may not use this file except in compliance with the License.
15
+ // You may obtain a copy of the License at
16
+ //
17
+ // https://www.apache.org/licenses/LICENSE-2.0
18
+ //
19
+ // Unless required by applicable law or agreed to in writing, software
20
+ // distributed under the License is distributed on an "AS IS" BASIS,
21
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
+ // See the License for the specific language governing permissions and
23
+ // limitations under the License.
24
+ //
25
+ //-----------------------------------------------------------------------------
26
+
27
+ //-----------------------------------------------------------------------------
28
+ // aqDeq.js
29
+ //
30
+ // This file defines the messages that are sent to the database and the
31
+ // responses that are received by the client for dequeuing an AQ message.
32
+ //-----------------------------------------------------------------------------
33
+
34
+ 'use strict';
35
+
36
+ const AqBaseMessage = require("./aqBase.js");
37
+ const constants = require("../constants.js");
38
+
39
+ class AqDeqMessage extends AqBaseMessage {
40
+
41
+ constructor(connImpl) {
42
+ super(connImpl);
43
+ this.functionCode = constants.TNS_FUNC_AQ_DEQ;
44
+ this.propsImpl = null;
45
+ }
46
+
47
+ //--------------------------------------------------------------------------
48
+ // processReturnParameter()
49
+ //
50
+ // Process the return parameters of the AQ Dequeue request.
51
+ //--------------------------------------------------------------------------
52
+ processReturnParameter(buf) {
53
+ const numBytes = buf.readUB4();
54
+ if (numBytes > 0) {
55
+ this._processMsgProps(buf, this.propsImpl);
56
+ this.propsImpl.recipients = this._processRecipients(buf);
57
+ this.propsImpl.payload = this._processPayload(buf);
58
+ this.propsImpl.msgId = this._processMsgId(buf);
59
+ }
60
+ }
61
+
62
+ //--------------------------------------------------------------------------
63
+ // _writeMessageBody()
64
+ //
65
+ // Writes the body of the message to the buffer.
66
+ //--------------------------------------------------------------------------
67
+ encode(buf) {
68
+ const queueNameBytes = Buffer.from(this.queueImpl.name, 'utf-8');
69
+ const consumerNameBytes = this.deqOptionsImpl.consumerName ?
70
+ Buffer.from(this.deqOptionsImpl.consumerName, 'utf-8') : null;
71
+ const correlationBytes = this.deqOptionsImpl.correlation ?
72
+ Buffer.from(this.deqOptionsImpl.correlation, 'utf-8') : null;
73
+ const conditionBytes = this.deqOptionsImpl.condition ?
74
+ Buffer.from(this.deqOptionsImpl.condition, 'utf-8') : null;
75
+ let msgIdBytes = this.deqOptionsImpl.msgId ?
76
+ this.deqOptionsImpl.msgId.slice(0, 16) : null;
77
+ const deliveryMode = this.deqOptionsImpl.deliveryMode;
78
+ let deqFlags = 0;
79
+
80
+ if (msgIdBytes && msgIdBytes.length < 16) {
81
+ msgIdBytes = Buffer.concat([msgIdBytes,
82
+ Buffer.alloc(16 - msgIdBytes.length)]);
83
+ }
84
+
85
+ if (deliveryMode === constants.TNS_AQ_MSG_BUFFERED) {
86
+ deqFlags |= constants.TNS_KPD_AQ_BUFMSG;
87
+ } else if (deliveryMode === constants.TNS_AQ_MSG_PERSISTENT_OR_BUFFERED) {
88
+ deqFlags |= constants.TNS_KPD_AQ_EITHER;
89
+ }
90
+
91
+ this.writeFunctionHeader(buf);
92
+ buf.writeUInt8(1); // queue name (ptr)
93
+ buf.writeUB4(queueNameBytes.length); // queue name len
94
+ buf.writeUInt8(1); // message properties
95
+ buf.writeUInt8(1); // msg props len
96
+ buf.writeUInt8(1); // recipient list
97
+ buf.writeUInt8(1); // recipient list len
98
+ if (consumerNameBytes) {
99
+ buf.writeUInt8(1); // consumer name
100
+ buf.writeUB4(consumerNameBytes.length);
101
+ } else {
102
+ buf.writeUInt8(0); // consumer name
103
+ buf.writeUB4(0); // consumer name len
104
+ }
105
+ buf.writeSB4(this.deqOptionsImpl.mode); // dequeue mode
106
+ buf.writeSB4(this.deqOptionsImpl.navigation); // navigation
107
+ buf.writeSB4(this.deqOptionsImpl.visibility); // visibility
108
+ buf.writeSB4(this.deqOptionsImpl.wait); // wait
109
+ if (msgIdBytes) {
110
+ buf.writeUInt8(1); // select mesg id
111
+ buf.writeUB4(constants.TNS_AQ_MESSAGE_ID_LENGTH); // mesg id len
112
+ } else {
113
+ buf.writeUInt8(0); // select mesg id
114
+ buf.writeUB4(0); // select mesg id len
115
+ }
116
+ if (correlationBytes) {
117
+ buf.writeUInt8(1); // correlation id
118
+ buf.writeUB4(correlationBytes.length); // correlation id len
119
+ } else {
120
+ buf.writeUInt8(0); // correlation id
121
+ buf.writeUB4(0); // correlation id len
122
+ }
123
+ buf.writeUInt8(1); // toid of payload
124
+ buf.writeUB4(16); // toid len
125
+ buf.writeUB2(constants.TNS_AQ_MESSAGE_VERSION);
126
+ buf.writeUInt8(1); // payload
127
+ buf.writeUInt8(1); // return msg id
128
+ buf.writeUB4(constants.TNS_AQ_MESSAGE_ID_LENGTH);
129
+ buf.writeUB4(deqFlags); // dequeue flags
130
+ if (conditionBytes) {
131
+ buf.writeUInt8(1); // condition (pointer)
132
+ buf.writeUB4(conditionBytes.length); // condition len
133
+ } else {
134
+ buf.writeUInt8(0); // condition
135
+ buf.writeUB4(0); // condition len
136
+ }
137
+ buf.writeUInt8(0); // extensions
138
+ buf.writeUB4(0); // number of extensions
139
+ if (buf.caps.ttcFieldVersion >= constants.TNS_CCAP_FIELD_VERSION_20_1) {
140
+ buf.writeUInt8(0); // JSON payload
141
+ }
142
+ if (buf.caps.ttcFieldVersion >= constants.TNS_CCAP_FIELD_VERSION_21_1) {
143
+ buf.writeUB4(0xffffffff); // shard id
144
+ }
145
+
146
+ buf.writeBytesWithLength(queueNameBytes);
147
+ if (consumerNameBytes) {
148
+ buf.writeBytesWithLength(consumerNameBytes);
149
+ }
150
+ if (msgIdBytes) {
151
+ buf.writeBytes(msgIdBytes);
152
+ }
153
+ if (correlationBytes) {
154
+ buf.writeBytesWithLength(correlationBytes);
155
+ }
156
+ buf.writeBytes(this.queueImpl.payloadToid);
157
+ if (conditionBytes) {
158
+ buf.writeBytesWithLength(conditionBytes);
159
+ }
160
+ }
161
+
162
+ }
163
+
164
+ module.exports = AqDeqMessage;
@@ -0,0 +1,135 @@
1
+ // Copyright (c) 2025, Oracle and/or its affiliates.
2
+
3
+ //-----------------------------------------------------------------------------
4
+ //
5
+ // This software is dual-licensed to you under the Universal Permissive License
6
+ // (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
7
+ // 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose
8
+ // either license.
9
+ //
10
+ // If you elect to accept the software under the Apache License, Version 2.0,
11
+ // the following applies:
12
+ //
13
+ // Licensed under the Apache License, Version 2.0 (the "License");
14
+ // you may not use this file except in compliance with the License.
15
+ // You may obtain a copy of the License at
16
+ //
17
+ // https://www.apache.org/licenses/LICENSE-2.0
18
+ //
19
+ // Unless required by applicable law or agreed to in writing, software
20
+ // distributed under the License is distributed on an "AS IS" BASIS,
21
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
+ // See the License for the specific language governing permissions and
23
+ // limitations under the License.
24
+ //
25
+ //-----------------------------------------------------------------------------
26
+
27
+ //-----------------------------------------------------------------------------
28
+ // aqEnq.js
29
+ //
30
+ // This file defines the messages that are sent to the database and the
31
+ // responses that are received by the client for enqueuing an AQ message.
32
+ //-----------------------------------------------------------------------------
33
+
34
+ 'use strict';
35
+
36
+ const AqBaseMessage = require("./aqBase.js");
37
+ const constants = require("../constants.js");
38
+
39
+ class AqEnqMessage extends AqBaseMessage {
40
+
41
+ constructor(connImpl) {
42
+ super(connImpl);
43
+ this.functionCode = constants.TNS_FUNC_AQ_ENQ;
44
+ this.propsImpl = null;
45
+ }
46
+
47
+ //--------------------------------------------------------------------------
48
+ // processReturnParameter()
49
+ //
50
+ // Process the return parameters for the AQ enqueue request.
51
+ //--------------------------------------------------------------------------
52
+ processReturnParameter(buf) {
53
+ this.propsImpl.msgId = this._processMsgId(buf);
54
+ buf.skipUB2(); // extensions length
55
+ }
56
+
57
+ //--------------------------------------------------------------------------
58
+ // encode()
59
+ //
60
+ // Writes the body of the message to the buffer.
61
+ //--------------------------------------------------------------------------
62
+ encode(buf) {
63
+ const queueNameBytes = Buffer.from(this.queueImpl.name, 'utf-8');
64
+ let enqFlags = 0;
65
+
66
+ if (this.enqOptionsImpl.deliveryMode === constants.TNS_AQ_MSG_BUFFERED) {
67
+ enqFlags |= constants.TNS_KPD_AQ_BUFMSG;
68
+ }
69
+
70
+ this.writeFunctionHeader(buf);
71
+ buf.writeUInt8(1); // queue name (ptr)
72
+ buf.writeUB4(queueNameBytes.length); // queue name len
73
+ this._writeMsgProps(buf, this.propsImpl);
74
+ if (!this.propsImpl.recipients) {
75
+ buf.writeUInt8(0); // recipients (ptr)
76
+ buf.writeUB4(0); // no. of key/value pairs
77
+ } else {
78
+ buf.writeUInt8(1); // recipients (ptr)
79
+ buf.writeUB4(3 * this.propsImpl.recipients.length);
80
+ }
81
+ buf.writeUB4(this.enqOptionsImpl.visibility);
82
+ buf.writeUInt8(0); // relative msg id
83
+ buf.writeUB4(0); // relative msg len
84
+ buf.writeUB4(0); // sequence deviation
85
+ buf.writeUInt8(1); // TOID of payload (ptr)
86
+ buf.writeUB4(16); // TOID of payload len
87
+ buf.writeUB2(constants.TNS_AQ_MESSAGE_VERSION);
88
+ if (this.queueImpl.isJson) {
89
+ buf.writeUInt8(0); // payload (ptr)
90
+ buf.writeUInt8(0); // RAW payload (ptr)
91
+ buf.writeUB4(0); // RAW payload len
92
+ } else if (this.queueImpl.payloadTypeClass) {
93
+ buf.writeUInt8(1); // payload (ptr)
94
+ buf.writeUInt8(0); // RAW payload (ptr)
95
+ buf.writeUB4(0); // RAW payload len
96
+ } else {
97
+ buf.writeUInt8(0); // payload (ptr)
98
+ buf.writeUInt8(1); // RAW payload (ptr)
99
+ buf.writeUB4(this.propsImpl.payload.length);
100
+ }
101
+ buf.writeUInt8(1); // return msg id (ptr)
102
+ buf.writeUB4(constants.TNS_AQ_MESSAGE_ID_LENGTH); // return msg id len
103
+ buf.writeUB4(enqFlags); // enqueue flags
104
+ buf.writeUInt8(0); // extensions 1 (ptr)
105
+ buf.writeUB4(0); // number of extensions 1
106
+ buf.writeUInt8(0); // extensions 2 (ptr)
107
+ buf.writeUB4(0); // number of extensions 2
108
+ buf.writeUInt8(0); // source sequence number
109
+ buf.writeUB4(0); // source sequence len
110
+ buf.writeUInt8(0); // max sequence number
111
+ buf.writeUB4(0); // max sequence len
112
+ buf.writeUInt8(0); // output ack len
113
+ buf.writeUInt8(0); // correlation (ptr)
114
+ buf.writeUB4(0); // correlation len
115
+ buf.writeUInt8(0); // sender name (ptr)
116
+ buf.writeUB4(0); // sender name len
117
+ buf.writeUInt8(0); // sender address (ptr)
118
+ buf.writeUB4(0); // sender address len
119
+ buf.writeUInt8(0); // sender charset id
120
+ buf.writeUInt8(0); // sender ncharset id
121
+ if (buf.caps.ttcFieldVersion >= constants.TNS_CCAP_FIELD_VERSION_20_1) {
122
+ buf.writeUInt8(this.queueImpl.isJson ? 1 : 0); // JSON payload (ptr)
123
+ }
124
+
125
+ buf.writeBytesWithLength(queueNameBytes);
126
+ if (this.propsImpl.recipients) {
127
+ this._writeRecipients(buf, this.propsImpl);
128
+ }
129
+ buf.writeBytes(this.queueImpl.payloadToid);
130
+ this._writePayload(buf, this.propsImpl);
131
+ }
132
+
133
+ }
134
+
135
+ module.exports = AqEnqMessage;
@@ -29,6 +29,7 @@
29
29
  const { Buffer } = require('buffer');
30
30
  const constants = require("../constants.js");
31
31
  const errors = require("../../../errors.js");
32
+ const parser = require("../../../parser.js");
32
33
  const process = require("process");
33
34
  const ED = require("../encryptDecrypt.js");
34
35
  const Message = require("./base.js");
@@ -158,6 +159,10 @@ class AuthMessage extends Message {
158
159
  let sign, tzRepr;
159
160
  if (process.env.ORA_SDTZ) {
160
161
  tzRepr = process.env.ORA_SDTZ;
162
+ // LOCAL and DBTIMEZONE are SQL keywords and must not be quoted.
163
+ if (["LOCAL", "DBTIMEZONE"].includes(tzRepr.toUpperCase())) {
164
+ return `ALTER SESSION SET TIME_ZONE =${tzRepr}\x00`;
165
+ }
161
166
  } else {
162
167
  const date = new Date();
163
168
  const timezoneMinutes = date.getTimezoneOffset();
@@ -172,7 +177,7 @@ class AuthMessage extends Message {
172
177
  tzHour = tzHour.toLocaleString('en-US', {minimumIntegerDigits: 2});
173
178
  tzRepr = `${sign}${tzHour}:${tzMinutes}`;
174
179
  }
175
- return `ALTER SESSION SET TIME_ZONE ='${tzRepr}'\x00`;
180
+ return `ALTER SESSION SET TIME_ZONE =${parser.enquoteLiteral(tzRepr)}\x00`;
176
181
  }
177
182
 
178
183
  encode(buf) {
@@ -355,34 +360,19 @@ class AuthMessage extends Message {
355
360
  }
356
361
  if (this.functionCode === constants.TNS_FUNC_AUTH_PHASE_ONE) {
357
362
  this.functionCode = constants.TNS_FUNC_AUTH_PHASE_TWO;
358
- } else {
359
- let releaseNum;
360
- let updateNum;
361
- let portReleaseNum;
362
- let portUpdateNum;
363
-
364
- this.conn.dbDomain = this.sessionData['AUTH_SC_DB_DOMAIN'];
365
- this.conn.dbName = this.sessionData['AUTH_DBNAME'];
366
- this.conn.maxOpenCursors = Number(this.sessionData['AUTH_MAX_OPEN_CURSORS'] || 0);
367
- this.conn.serviceName = this.sessionData['AUTH_SC_SERVICE_NAME'];
368
- this.conn.instanceName = this.sessionData['AUTH_INSTANCENAME'];
369
- this.conn.maxIdentifierLength = Number(this.sessionData['AUTH_MAX_IDEN_LENGTH'] || 30);
370
- const fullVersionNum = Number(this.sessionData['AUTH_VERSION_NO']);
371
- const versionNum = (fullVersionNum >> 24) & 0xFF;
372
- this.conn.warning = this.warning;
373
- if (buf.caps.ttcFieldVersion >= constants.TNS_CCAP_FIELD_VERSION_18_1_EXT_1) {
374
- releaseNum = (fullVersionNum >> 16) & 0xFF;
375
- updateNum = (fullVersionNum >> 12) & 0x0F;
376
- portReleaseNum = (fullVersionNum >> 4) & 0xFF;
377
- portUpdateNum = fullVersionNum & 0x0F;
378
- } else {
379
- releaseNum = (fullVersionNum >> 20) & 0x0F;
380
- updateNum = (fullVersionNum >> 12) & 0xFF;
381
- portReleaseNum = (fullVersionNum >> 8) & 0x0F;
382
- portUpdateNum = fullVersionNum & 0xFF;
363
+ } else if (!this.changePassword && this.comboKey) {
364
+ const value = this.sessionData.AUTH_SVR_RESPONSE;
365
+ let response;
366
+ if (value) {
367
+ const encodedResponse = Buffer.from(value, "hex");
368
+ response = ED.decrypt(this.comboKey, encodedResponse);
369
+ }
370
+ if (
371
+ !response ||
372
+ !response.subarray(16, 32).equals(Buffer.from("SERVER_TO_CLIENT"))
373
+ ) {
374
+ errors.throwErr(errors.ERR_INVALID_SERVER_RESPONSE);
383
375
  }
384
- this.conn.serverVersionString = versionNum + '.' + releaseNum + '.' + updateNum + '.' + portReleaseNum + '.' + portUpdateNum;
385
- this.conn.serverVersion = versionNum * 100000000 + releaseNum * 1000000 + updateNum * 10000 + portReleaseNum * 100 + portUpdateNum * 1;
386
376
  }
387
377
  }
388
378