Skip to content

Commit 640dc7a

Browse files
committed
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 a5b3c15 commit 640dc7a

File tree

2 files changed

+5
-23
lines changed

2 files changed

+5
-23
lines changed

src/node_crypto.cc

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,13 +1381,11 @@ void SSLWrap<Base>::AddMethods(Environment* env, Local<FunctionTemplate> t) {
13811381
env->SetProtoMethod(t, "setSession", SetSession);
13821382
env->SetProtoMethod(t, "loadSession", LoadSession);
13831383
env->SetProtoMethodNoSideEffect(t, "isSessionReused", IsSessionReused);
1384-
env->SetProtoMethodNoSideEffect(t, "isInitFinished", IsInitFinished);
13851384
env->SetProtoMethodNoSideEffect(t, "verifyError", VerifyError);
13861385
env->SetProtoMethodNoSideEffect(t, "getCurrentCipher", GetCurrentCipher);
13871386
env->SetProtoMethod(t, "endParser", EndParser);
13881387
env->SetProtoMethod(t, "certCbDone", CertCbDone);
13891388
env->SetProtoMethod(t, "renegotiate", Renegotiate);
1390-
env->SetProtoMethod(t, "shutdownSSL", Shutdown);
13911389
env->SetProtoMethodNoSideEffect(t, "getTLSTicket", GetTLSTicket);
13921390
env->SetProtoMethod(t, "newSessionDone", NewSessionDone);
13931391
env->SetProtoMethod(t, "setOCSPResponse", SetOCSPResponse);
@@ -1993,16 +1991,6 @@ void SSLWrap<Base>::Renegotiate(const FunctionCallbackInfo<Value>& args) {
19931991
}
19941992

19951993

1996-
template <class Base>
1997-
void SSLWrap<Base>::Shutdown(const FunctionCallbackInfo<Value>& args) {
1998-
Base* w;
1999-
ASSIGN_OR_RETURN_UNWRAP(&w, args.Holder());
2000-
2001-
int rv = SSL_shutdown(w->ssl_.get());
2002-
args.GetReturnValue().Set(rv);
2003-
}
2004-
2005-
20061994
template <class Base>
20071995
void SSLWrap<Base>::GetTLSTicket(const FunctionCallbackInfo<Value>& args) {
20081996
Base* w;
@@ -2136,15 +2124,6 @@ void SSLWrap<Base>::SetMaxSendFragment(
21362124
#endif // SSL_set_max_send_fragment
21372125

21382126

2139-
template <class Base>
2140-
void SSLWrap<Base>::IsInitFinished(const FunctionCallbackInfo<Value>& args) {
2141-
Base* w;
2142-
ASSIGN_OR_RETURN_UNWRAP(&w, args.Holder());
2143-
bool yes = SSL_is_init_finished(w->ssl_.get());
2144-
args.GetReturnValue().Set(yes);
2145-
}
2146-
2147-
21482127
template <class Base>
21492128
void SSLWrap<Base>::VerifyError(const FunctionCallbackInfo<Value>& args) {
21502129
Base* w;

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

Lines changed: 5 additions & 2 deletions
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)