@@ -126,7 +126,7 @@ bool GenerateRandData(uint8_t* buf, size_t len) {
126126Local<Array> GetClientHelloCiphers (QuicSession* session) {
127127 const unsigned char * buf;
128128 Environment* env = session->env ();
129- auto ctx = session->CryptoContext ();
129+ QuicCryptoContext* ctx = session->CryptoContext ();
130130 size_t len = SSL_client_hello_get0_ciphers (**ctx, &buf);
131131 std::vector<Local<Value>> ciphers_array;
132132 for (size_t n = 0 ; n < len; n += 2 ) {
@@ -135,14 +135,14 @@ Local<Array> GetClientHelloCiphers(QuicSession* session) {
135135 const char * cipher_name = SSL_CIPHER_get_name (cipher);
136136 const char * cipher_version = SSL_CIPHER_get_version (cipher);
137137 Local<Object> obj = Object::New (env->isolate ());
138- USE ( obj->Set (
138+ obj->Set (
139139 env->context (),
140140 env->name_string (),
141- OneByteString (env->isolate (), cipher_name)));
142- USE ( obj->Set (
141+ OneByteString (env->isolate (), cipher_name)). FromJust ( );
142+ obj->Set (
143143 env->context (),
144144 env->version_string (),
145- OneByteString (env->isolate (), cipher_version)));
145+ OneByteString (env->isolate (), cipher_version)). FromJust ( );
146146 ciphers_array.push_back (obj);
147147 }
148148 return Array::New (env->isolate (), ciphers_array.data (), ciphers_array.size ());
@@ -153,7 +153,7 @@ const char* GetClientHelloServerName(QuicSession* session) {
153153 size_t len;
154154 size_t rem;
155155
156- auto ctx = session->CryptoContext ();
156+ QuicCryptoContext* ctx = session->CryptoContext ();
157157
158158 if (!SSL_client_hello_get0_ext (
159159 **ctx,
@@ -187,7 +187,7 @@ const char* GetClientHelloALPN(QuicSession* session) {
187187 size_t len;
188188 size_t rem;
189189
190- auto ctx = session->CryptoContext ();
190+ QuicCryptoContext* ctx = session->CryptoContext ();
191191
192192 if (!SSL_client_hello_get0_ext (
193193 **ctx,
@@ -707,7 +707,7 @@ int VerifyHostnameIdentity(SSL* ssl, const char* hostname) {
707707}
708708
709709const char * GetServerName (QuicSession* session) {
710- auto ctx = session->CryptoContext ();
710+ QuicCryptoContext* ctx = session->CryptoContext ();
711711 return SSL_get_servername (**ctx, TLSEXT_NAMETYPE_host_name);
712712}
713713
@@ -731,7 +731,7 @@ Local<Value> GetALPNProtocol(QuicSession* session) {
731731 Local<Value> alpn;
732732 const unsigned char * alpn_buf = nullptr ;
733733 unsigned int alpnlen;
734- auto ctx = session->CryptoContext ();
734+ QuicCryptoContext* ctx = session->CryptoContext ();
735735
736736 SSL_get0_alpn_selected (**ctx, &alpn_buf, &alpnlen);
737737 if (alpnlen == sizeof (NGTCP2_ALPN_H3) - 2 &&
@@ -745,7 +745,7 @@ Local<Value> GetALPNProtocol(QuicSession* session) {
745745
746746Local<Value> GetCertificate (QuicSession* session) {
747747 crypto::ClearErrorOnReturn clear_error_on_return;
748- auto ctx = session->CryptoContext ();
748+ QuicCryptoContext* ctx = session->CryptoContext ();
749749 Local<Value> value = v8::Undefined (session->env ()->isolate ());
750750 X509* cert = SSL_get_certificate (**ctx);
751751 if (cert != nullptr )
@@ -758,7 +758,7 @@ Local<Value> GetEphemeralKey(QuicSession* session) {
758758 Local<Context> context = env->context ();
759759
760760 Local<Object> info = Object::New (env->isolate ());
761- auto ctx = session->CryptoContext ();
761+ QuicCryptoContext* ctx = session->CryptoContext ();
762762
763763 EVP_PKEY* raw_key;
764764 if (SSL_get_server_tmp_key (**ctx, &raw_key)) {
@@ -785,12 +785,18 @@ Local<Value> GetEphemeralKey(QuicSession* session) {
785785 } else {
786786 curve_name = OBJ_nid2sn (kid);
787787 }
788- USE (info->Set (context, env->type_string (),
789- FIXED_ONE_BYTE_STRING (env->isolate (), " ECDH" )));
790- USE (info->Set (context, env->name_string (),
791- OneByteString (env->isolate (), curve_name)));
792- USE (info->Set (context, env->size_string (),
793- Integer::New (env->isolate (), EVP_PKEY_bits (key.get ()))));
788+ info->Set (context, env->type_string (),
789+ FIXED_ONE_BYTE_STRING (
790+ env->isolate (),
791+ " ECDH" )).FromJust ();
792+ info->Set (context, env->name_string (),
793+ OneByteString (
794+ env->isolate (),
795+ curve_name)).FromJust ();
796+ info->Set (context, env->size_string (),
797+ Integer::New (
798+ env->isolate (),
799+ EVP_PKEY_bits (key.get ()))).FromJust ();
794800 }
795801 break ;
796802 default :
@@ -802,7 +808,7 @@ Local<Value> GetEphemeralKey(QuicSession* session) {
802808
803809Local<Value> GetCipherName (QuicSession* session) {
804810 Local<Value> cipher;
805- auto ctx = session->CryptoContext ();
811+ QuicCryptoContext* ctx = session->CryptoContext ();
806812 const SSL_CIPHER* c = SSL_get_current_cipher (**ctx);
807813 if (c != nullptr ) {
808814 const char * cipher_name = SSL_CIPHER_get_name (c);
@@ -813,7 +819,7 @@ Local<Value> GetCipherName(QuicSession* session) {
813819
814820Local<Value> GetCipherVersion (QuicSession* session) {
815821 Local<Value> version;
816- auto ctx = session->CryptoContext ();
822+ QuicCryptoContext* ctx = session->CryptoContext ();
817823 const SSL_CIPHER* c = SSL_get_current_cipher (**ctx);
818824 if (c != nullptr ) {
819825 const char * cipher_version = SSL_CIPHER_get_version (c);
@@ -839,7 +845,7 @@ Local<Value> GetPeerCertificate(
839845 bool abbreviated) {
840846 crypto::ClearErrorOnReturn clear_error_on_return;
841847
842- auto ctx = session->CryptoContext ();
848+ QuicCryptoContext* ctx = session->CryptoContext ();
843849
844850 Local<Value> result = v8::Undefined (session->env ()->isolate ());
845851 Local<Object> issuer_chain;
@@ -955,8 +961,7 @@ int TLS_Status_Callback(SSL* ssl, void* arg) {
955961}
956962
957963int New_Session_Callback (SSL* ssl, SSL_SESSION* session) {
958- QuicClientSession* s =
959- static_cast <QuicClientSession*>(SSL_get_app_data (ssl));
964+ QuicSession* s = static_cast <QuicSession*>(SSL_get_app_data (ssl));
960965 return s->SetSession (session);
961966}
962967
@@ -1056,7 +1061,7 @@ SSL_QUIC_METHOD quic_method = SSL_QUIC_METHOD{
10561061} // namespace
10571062
10581063void InitializeTLS (QuicSession* session) {
1059- auto ctx = session->CryptoContext ();
1064+ QuicCryptoContext* ctx = session->CryptoContext ();
10601065
10611066 SSL_set_app_data (**ctx, session);
10621067 SSL_set_cert_cb (**ctx, CertCB, session);
@@ -1146,7 +1151,7 @@ bool SetCryptoSecrets(
11461151 SessionIV tx_iv;
11471152 SessionKey tx_hp;
11481153
1149- auto ctx = session->CryptoContext ();
1154+ QuicCryptoContext* ctx = session->CryptoContext ();
11501155
11511156 if (NGTCP2_ERR (ngtcp2_crypto_derive_and_install_key (
11521157 session->Connection (),
0 commit comments