Skip to content

Commit 9327a58

Browse files
maclover7targos
authored andcommitted
crypto: remove unused SSLWrap handle methods
One was not used at all, and the other was only used in a test, which I converted to use the more standard `ShutdownWrap` API. PR-URL: #22216 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent ab1e5d1 commit 9327a58

File tree

2 files changed

+5
-23
lines changed

2 files changed

+5
-23
lines changed

src/node_crypto.cc

-21
Original file line numberDiff line numberDiff line change
@@ -1375,13 +1375,11 @@ void SSLWrap<Base>::AddMethods(Environment* env, Local<FunctionTemplate> t) {
13751375
env->SetProtoMethod(t, "setSession", SetSession);
13761376
env->SetProtoMethod(t, "loadSession", LoadSession);
13771377
env->SetProtoMethodNoSideEffect(t, "isSessionReused", IsSessionReused);
1378-
env->SetProtoMethodNoSideEffect(t, "isInitFinished", IsInitFinished);
13791378
env->SetProtoMethodNoSideEffect(t, "verifyError", VerifyError);
13801379
env->SetProtoMethodNoSideEffect(t, "getCurrentCipher", GetCurrentCipher);
13811380
env->SetProtoMethod(t, "endParser", EndParser);
13821381
env->SetProtoMethod(t, "certCbDone", CertCbDone);
13831382
env->SetProtoMethod(t, "renegotiate", Renegotiate);
1384-
env->SetProtoMethod(t, "shutdownSSL", Shutdown);
13851383
env->SetProtoMethodNoSideEffect(t, "getTLSTicket", GetTLSTicket);
13861384
env->SetProtoMethod(t, "newSessionDone", NewSessionDone);
13871385
env->SetProtoMethod(t, "setOCSPResponse", SetOCSPResponse);
@@ -1987,16 +1985,6 @@ void SSLWrap<Base>::Renegotiate(const FunctionCallbackInfo<Value>& args) {
19871985
}
19881986

19891987

1990-
template <class Base>
1991-
void SSLWrap<Base>::Shutdown(const FunctionCallbackInfo<Value>& args) {
1992-
Base* w;
1993-
ASSIGN_OR_RETURN_UNWRAP(&w, args.Holder());
1994-
1995-
int rv = SSL_shutdown(w->ssl_.get());
1996-
args.GetReturnValue().Set(rv);
1997-
}
1998-
1999-
20001988
template <class Base>
20011989
void SSLWrap<Base>::GetTLSTicket(const FunctionCallbackInfo<Value>& args) {
20021990
Base* w;
@@ -2130,15 +2118,6 @@ void SSLWrap<Base>::SetMaxSendFragment(
21302118
#endif // SSL_set_max_send_fragment
21312119

21322120

2133-
template <class Base>
2134-
void SSLWrap<Base>::IsInitFinished(const FunctionCallbackInfo<Value>& args) {
2135-
Base* w;
2136-
ASSIGN_OR_RETURN_UNWRAP(&w, args.Holder());
2137-
bool yes = SSL_is_init_finished(w->ssl_.get());
2138-
args.GetReturnValue().Set(yes);
2139-
}
2140-
2141-
21422121
template <class Base>
21432122
void SSLWrap<Base>::VerifyError(const FunctionCallbackInfo<Value>& args) {
21442123
Base* w;

test/parallel/test-tls-close-notify.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,17 @@ if (!common.hasCrypto)
2727

2828
const tls = require('tls');
2929
const fixtures = require('../common/fixtures');
30+
const { ShutdownWrap } = process.binding('stream_wrap');
3031

3132
const server = tls.createServer({
3233
key: fixtures.readKey('agent1-key.pem'),
3334
cert: fixtures.readKey('agent1-cert.pem')
3435
}, function(c) {
3536
// Send close-notify without shutting down TCP socket
36-
if (c._handle.shutdownSSL() !== 1)
37-
c._handle.shutdownSSL();
37+
const req = new ShutdownWrap();
38+
req.oncomplete = common.mustCall(() => {});
39+
req.handle = c._handle;
40+
c._handle.shutdown(req);
3841
}).listen(0, common.mustCall(function() {
3942
const c = tls.connect(this.address().port, {
4043
rejectUnauthorized: false

0 commit comments

Comments
 (0)