(session, options)
| 124 | } |
| 125 | |
| 126 | function wrapSessionState(session, options) { |
| 127 | if (!Buffer.isBuffer(session) || options?.isServer) |
| 128 | return session; |
| 129 | |
| 130 | const servername = Buffer.from(getSessionServerIdentity(options), 'utf8'); |
| 131 | const servernameLength = Buffer.allocUnsafe(2); |
| 132 | servernameLength.writeUInt16BE(servername.length, 0); |
| 133 | |
| 134 | return Buffer.concat([ |
| 135 | kTLSSessionStatePrefix, |
| 136 | servernameLength, |
| 137 | servername, |
| 138 | session, |
| 139 | ]); |
| 140 | } |
| 141 | |
| 142 | function unwrapSessionState(session) { |
| 143 | if (!Buffer.isBuffer(session) || |
no test coverage detected
searching dependent graphs…