| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8b2a272 commit a893b42
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1745,26 +1745,31 @@ void SSLWrap<Base>::OnClientHello(void* arg, | |||
| 1745 | 1745 | Base* w = static_cast<Base*>(arg); | |
| 1746 | 1746 | Environment* env = w->ssl_env(); | |
| 1747 | 1747 | HandleScope handle_scope(env->isolate()); | |
| 1748 | - Context::Scope context_scope(env->context()); | ||
| 1748 | + Local<Context> context = env->context(); | ||
| 1749 | + Context::Scope context_scope(context); | ||
| 1749 | 1750 | ||
| 1750 | 1751 | Local<Object> hello_obj = Object::New(env->isolate()); | |
| 1751 | 1752 | Local<Object> buff = Buffer::Copy( | |
| 1752 | 1753 | env, | |
| 1753 | 1754 | reinterpret_cast<const char*>(hello.session_id()), | |
| 1754 | 1755 | hello.session_size()).ToLocalChecked(); | |
| 1755 | - hello_obj->Set(env->session_id_string(), buff); | ||
| 1756 | + hello_obj->Set(context, env->session_id_string(), buff).FromJust(); | ||
| 1756 | 1757 | if (hello.servername() == nullptr) { | |
| 1757 | - hello_obj->Set(env->servername_string(), String::Empty(env->isolate())); | ||
| 1758 | + hello_obj->Set(context, | ||
| 1759 | + env->servername_string(), | ||
| 1760 | + String::Empty(env->isolate())).FromJust(); | ||
| 1758 | 1761 | } else { | |
| 1759 | 1762 | Local<String> servername = OneByteString(env->isolate(), | |
| 1760 | 1763 | hello.servername(), | |
| 1761 | 1764 | hello.servername_size()); | |
| 1762 | - hello_obj->Set(env->servername_string(), servername); | ||
| 1765 | + hello_obj->Set(context, env->servername_string(), servername).FromJust(); | ||
| 1763 | 1766 | } | |
| 1764 | - hello_obj->Set(env->tls_ticket_string(), | ||
| 1765 | - Boolean::New(env->isolate(), hello.has_ticket())); | ||
| 1766 | - hello_obj->Set(env->ocsp_request_string(), | ||
| 1767 | - Boolean::New(env->isolate(), hello.ocsp_request())); | ||
| 1767 | + hello_obj->Set(context, | ||
| 1768 | + env->tls_ticket_string(), | ||
| 1769 | + Boolean::New(env->isolate(), hello.has_ticket())).FromJust(); | ||
| 1770 | + hello_obj->Set(context, | ||
| 1771 | + env->ocsp_request_string(), | ||
| 1772 | + Boolean::New(env->isolate(), hello.ocsp_request())).FromJust(); | ||
| 1768 | 1773 | ||
| 1769 | 1774 | Local<Value> argv[] = { hello_obj }; | |
| 1770 | 1775 | w->MakeCallback(env->onclienthello_string(), arraysize(argv), argv); | |
@@ -1809,7 +1814,7 @@ static bool SafeX509ExtPrint(BIO* out, X509_EXTENSION* ext) { | |||
| 1809 | 1814 | ||
| 1810 | 1815 | static Local<Object> X509ToObject(Environment* env, X509* cert) { | |
| 1811 | 1816 | EscapableHandleScope scope(env->isolate()); | |
| 1812 | - | ||
| 1817 | + Local<Context> context = env->context(); | ||
| 1813 | 1818 | Local<Object> info = Object::New(env->isolate()); | |
| 1814 | 1819 | ||
| 1815 | 1820 | BIO* bio = BIO_new(BIO_s_mem()); | |
@@ -1819,18 +1824,20 @@ static Local<Object> X509ToObject(Environment* env, X509* cert) { | |||
| 1819 | 1824 | 0, | |
| 1820 | 1825 | X509_NAME_FLAGS) > 0) { | |
| 1821 | 1826 | BIO_get_mem_ptr(bio, &mem); | |
| 1822 | - info->Set(env->subject_string(), | ||
| 1827 | + info->Set(context, env->subject_string(), | ||
| 1823 | 1828 | String::NewFromUtf8(env->isolate(), mem->data, | |
| 1824 | - String::kNormalString, mem->length)); | ||
| 1829 | + String::kNormalString, | ||
| 1830 | + mem->length)).FromJust(); | ||
| 1825 | 1831 | } | |
| 1826 | 1832 | USE(BIO_reset(bio)); | |
| 1827 | 1833 | ||
| 1828 | 1834 | X509_NAME* issuer_name = X509_get_issuer_name(cert); | |
| 1829 | 1835 | if (X509_NAME_print_ex(bio, issuer_name, 0, X509_NAME_FLAGS) > 0) { | |
| 1830 | 1836 | BIO_get_mem_ptr(bio, &mem); | |
| 1831 | - info->Set(env->issuer_string(), | ||
| 1837 | + info->Set(context, env->issuer_string(), | ||
| 1832 | 1838 | String::NewFromUtf8(env->isolate(), mem->data, | |
| 1833 | - String::kNormalString, mem->length)); | ||
| 1839 | + String::kNormalString, | ||
| 1840 | + mem->length)).FromJust(); | ||
| 1834 | 1841 | } | |
| 1835 | 1842 | USE(BIO_reset(bio)); | |
| 1836 | 1843 | ||
@@ -1855,9 +1862,10 @@ static Local<Object> X509ToObject(Environment* env, X509* cert) { | |||
| 1855 | 1862 | } | |
| 1856 | 1863 | ||
| 1857 | 1864 | BIO_get_mem_ptr(bio, &mem); | |
| 1858 | - info->Set(keys[i], | ||
| 1865 | + info->Set(context, keys[i], | ||
| 1859 | 1866 | String::NewFromUtf8(env->isolate(), mem->data, | |
| 1860 | - String::kNormalString, mem->length)); | ||
| 1867 | + String::kNormalString, | ||
| 1868 | + mem->length)).FromJust(); | ||
| 1861 | 1869 | ||
| 1862 | 1870 | USE(BIO_reset(bio)); | |
| 1863 | 1871 | } | |
@@ -1873,9 +1881,10 @@ static Local<Object> X509ToObject(Environment* env, X509* cert) { | |||
| 1873 | 1881 | RSA_get0_key(rsa, &n, &e, nullptr); | |
| 1874 | 1882 | BN_print(bio, n); | |
| 1875 | 1883 | BIO_get_mem_ptr(bio, &mem); | |
| 1876 | - info->Set(env->modulus_string(), | ||
| 1884 | + info->Set(context, env->modulus_string(), | ||
| 1877 | 1885 | String::NewFromUtf8(env->isolate(), mem->data, | |
| 1878 | - String::kNormalString, mem->length)); | ||
| 1886 | + String::kNormalString, | ||
| 1887 | + mem->length)).FromJust(); | ||
| 1879 | 1888 | USE(BIO_reset(bio)); | |
| 1880 | 1889 | ||
| 1881 | 1890 | uint64_t exponent_word = static_cast<uint64_t>(BN_get_word(e)); | |
@@ -1887,9 +1896,10 @@ static Local<Object> X509ToObject(Environment* env, X509* cert) { | |||
| 1887 | 1896 | BIO_printf(bio, "0x%x%08x", hi, lo); | |
| 1888 | 1897 | } | |
| 1889 | 1898 | BIO_get_mem_ptr(bio, &mem); | |
| 1890 | - info->Set(env->exponent_string(), | ||
| 1899 | + info->Set(context, env->exponent_string(), | ||
| 1891 | 1900 | String::NewFromUtf8(env->isolate(), mem->data, | |
| 1892 | - String::kNormalString, mem->length)); | ||
| 1901 | + String::kNormalString, | ||
| 1902 | + mem->length)).FromJust(); | ||
| 1893 | 1903 | USE(BIO_reset(bio)); | |
| 1894 | 1904 | } | |
| 1895 | 1905 | ||
@@ -1904,16 +1914,18 @@ static Local<Object> X509ToObject(Environment* env, X509* cert) { | |||
| 1904 | 1914 | ||
| 1905 | 1915 | ASN1_TIME_print(bio, X509_get_notBefore(cert)); | |
| 1906 | 1916 | BIO_get_mem_ptr(bio, &mem); | |
| 1907 | - info->Set(env->valid_from_string(), | ||
| 1917 | + info->Set(context, env->valid_from_string(), | ||
| 1908 | 1918 | String::NewFromUtf8(env->isolate(), mem->data, | |
| 1909 | - String::kNormalString, mem->length)); | ||
| 1919 | + String::kNormalString, | ||
| 1920 | + mem->length)).FromJust(); | ||
| 1910 | 1921 | USE(BIO_reset(bio)); | |
| 1911 | 1922 | ||
| 1912 | 1923 | ASN1_TIME_print(bio, X509_get_notAfter(cert)); | |
| 1913 | 1924 | BIO_get_mem_ptr(bio, &mem); | |
| 1914 | - info->Set(env->valid_to_string(), | ||
| 1925 | + info->Set(context, env->valid_to_string(), | ||
| 1915 | 1926 | String::NewFromUtf8(env->isolate(), mem->data, | |
| 1916 | - String::kNormalString, mem->length)); | ||
| 1927 | + String::kNormalString, | ||
| 1928 | + mem->length)).FromJust(); | ||
| 1917 | 1929 | BIO_free_all(bio); | |
| 1918 | 1930 | ||
| 1919 | 1931 | unsigned int md_size, i; | |
@@ -1934,8 +1946,8 @@ static Local<Object> X509ToObject(Environment* env, X509* cert) { | |||
| 1934 | 1946 | fingerprint[0] = '\0'; | |
| 1935 | 1947 | } | |
| 1936 | 1948 | ||
| 1937 | - info->Set(env->fingerprint_string(), | ||
| 1938 | - OneByteString(env->isolate(), fingerprint)); | ||
| 1949 | + info->Set(context, env->fingerprint_string(), | ||
| 1950 | + OneByteString(env->isolate(), fingerprint)).FromJust(); | ||
| 1939 | 1951 | } | |
| 1940 | 1952 | ||
| 1941 | 1953 | STACK_OF(ASN1_OBJECT)* eku = static_cast<STACK_OF(ASN1_OBJECT)*>( | |
@@ -1947,18 +1959,20 @@ static Local<Object> X509ToObject(Environment* env, X509* cert) { | |||
| 1947 | 1959 | int j = 0; | |
| 1948 | 1960 | for (int i = 0; i < sk_ASN1_OBJECT_num(eku); i++) { | |
| 1949 | 1961 | if (OBJ_obj2txt(buf, sizeof(buf), sk_ASN1_OBJECT_value(eku, i), 1) >= 0) | |
| 1950 | - ext_key_usage->Set(j++, OneByteString(env->isolate(), buf)); | ||
| 1962 | + ext_key_usage->Set(context, | ||
| 1963 | + j++, | ||
| 1964 | + OneByteString(env->isolate(), buf)).FromJust(); | ||
| 1951 | 1965 | } | |
| 1952 | 1966 | ||
| 1953 | 1967 | sk_ASN1_OBJECT_pop_free(eku, ASN1_OBJECT_free); | |
| 1954 | - info->Set(env->ext_key_usage_string(), ext_key_usage); | ||
| 1968 | + info->Set(context, env->ext_key_usage_string(), ext_key_usage).FromJust(); | ||
| 1955 | 1969 | } | |
| 1956 | 1970 | ||
| 1957 | 1971 | if (ASN1_INTEGER* serial_number = X509_get_serialNumber(cert)) { | |
| 1958 | 1972 | if (BIGNUM* bn = ASN1_INTEGER_to_BN(serial_number, nullptr)) { | |
| 1959 | 1973 | if (char* buf = BN_bn2hex(bn)) { | |
| 1960 | - info->Set(env->serial_number_string(), | ||
| 1961 | - OneByteString(env->isolate(), buf)); | ||
| 1974 | + info->Set(context, env->serial_number_string(), | ||
| 1975 | + OneByteString(env->isolate(), buf)).FromJust(); | ||
| 1962 | 1976 | OPENSSL_free(buf); | |
| 1963 | 1977 | } | |
| 1964 | 1978 | BN_free(bn); | |
@@ -1971,7 +1985,7 @@ static Local<Object> X509ToObject(Environment* env, X509* cert) { | |||
| 1971 | 1985 | unsigned char* serialized = reinterpret_cast<unsigned char*>( | |
| 1972 | 1986 | Buffer::Data(buff)); | |
| 1973 | 1987 | i2d_X509(cert, &serialized); | |
| 1974 | - info->Set(env->raw_string(), buff); | ||
| 1988 | + info->Set(context, env->raw_string(), buff).FromJust(); | ||
| 1975 | 1989 | ||
| 1976 | 1990 | return scope.Escape(info); | |
| 1977 | 1991 | } | |
@@ -1984,6 +1998,7 @@ void SSLWrap<Base>::GetPeerCertificate( | |||
| 1984 | 1998 | Base* w; | |
| 1985 | 1999 | ASSIGN_OR_RETURN_UNWRAP(&w, args.Holder()); | |
| 1986 | 2000 | Environment* env = w->ssl_env(); | |
| 2001 | + Local<Context> context = env->context(); | ||
| 1987 | 2002 | ||
| 1988 | 2003 | ClearErrorOnReturn clear_error_on_return; | |
| 1989 | 2004 | ||
@@ -2035,7 +2050,7 @@ void SSLWrap<Base>::GetPeerCertificate( | |||
| 2035 | 2050 | continue; | |
| 2036 | 2051 | ||
| 2037 | 2052 | Local<Object> ca_info = X509ToObject(env, ca); | |
| 2038 | - info->Set(env->issuercert_string(), ca_info); | ||
| 2053 | + info->Set(context, env->issuercert_string(), ca_info).FromJust(); | ||
| 2039 | 2054 | info = ca_info; | |
| 2040 | 2055 | ||
| 2041 | 2056 | // NOTE: Intentionally freeing cert that is not used anymore | |
@@ -2058,7 +2073,7 @@ void SSLWrap<Base>::GetPeerCertificate( | |||
| 2058 | 2073 | break; | |
| 2059 | 2074 | ||
| 2060 | 2075 | Local<Object> ca_info = X509ToObject(env, ca); | |
| 2061 | - info->Set(env->issuercert_string(), ca_info); | ||
| 2076 | + info->Set(context, env->issuercert_string(), ca_info).FromJust(); | ||
| 2062 | 2077 | info = ca_info; | |
| 2063 | 2078 | ||
| 2064 | 2079 | // NOTE: Intentionally freeing cert that is not used anymore | |
@@ -2070,7 +2085,7 @@ void SSLWrap<Base>::GetPeerCertificate( | |||
| 2070 | 2085 | ||
| 2071 | 2086 | // Self-issued certificate | |
| 2072 | 2087 | if (X509_check_issued(cert, cert) == X509_V_OK) | |
| 2073 | - info->Set(env->issuercert_string(), info); | ||
| 2088 | + info->Set(context, env->issuercert_string(), info).FromJust(); | ||
| 2074 | 2089 | ||
| 2075 | 2090 | CHECK_NE(cert, nullptr); | |
| 2076 | 2091 | ||
@@ -2266,6 +2281,7 @@ void SSLWrap<Base>::GetEphemeralKeyInfo( | |||
| 2266 | 2281 | Base* w; | |
| 2267 | 2282 | ASSIGN_OR_RETURN_UNWRAP(&w, args.Holder()); | |
| 2268 | 2283 | Environment* env = Environment::GetCurrent(args); | |
| 2284 | + Local<Context> context = env->context(); | ||
| 2269 | 2285 | ||
| 2270 | 2286 | CHECK_NE(w->ssl_, nullptr); | |
| 2271 | 2287 | ||
@@ -2280,22 +2296,24 @@ void SSLWrap<Base>::GetEphemeralKeyInfo( | |||
| 2280 | 2296 | if (SSL_get_server_tmp_key(w->ssl_, &key)) { | |
| 2281 | 2297 | switch (EVP_PKEY_id(key)) { | |
| 2282 | 2298 | case EVP_PKEY_DH: | |
| 2283 | - info->Set(env->type_string(), | ||
| 2284 | - FIXED_ONE_BYTE_STRING(env->isolate(), "DH")); | ||
| 2285 | - info->Set(env->size_string(), | ||
| 2286 | - Integer::New(env->isolate(), EVP_PKEY_bits(key))); | ||
| 2299 | + info->Set(context, env->type_string(), | ||
| 2300 | + FIXED_ONE_BYTE_STRING(env->isolate(), "DH")).FromJust(); | ||
| 2301 | + info->Set(context, env->size_string(), | ||
| 2302 | + Integer::New(env->isolate(), EVP_PKEY_bits(key))).FromJust(); | ||
| 2287 | 2303 | break; | |
| 2288 | 2304 | case EVP_PKEY_EC: | |
| 2289 | 2305 | { | |
| 2290 | 2306 | EC_KEY* ec = EVP_PKEY_get1_EC_KEY(key); | |
| 2291 | 2307 | int nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec)); | |
| 2292 | 2308 | EC_KEY_free(ec); | |
| 2293 | - info->Set(env->type_string(), | ||
| 2294 | - FIXED_ONE_BYTE_STRING(env->isolate(), "ECDH")); | ||
| 2295 | - info->Set(env->name_string(), | ||
| 2296 | - OneByteString(args.GetIsolate(), OBJ_nid2sn(nid))); | ||
| 2297 | - info->Set(env->size_string(), | ||
| 2298 | - Integer::New(env->isolate(), EVP_PKEY_bits(key))); | ||
| 2309 | + info->Set(context, env->type_string(), | ||
| 2310 | + FIXED_ONE_BYTE_STRING(env->isolate(), "ECDH")).FromJust(); | ||
| 2311 | + info->Set(context, env->name_string(), | ||
| 2312 | + OneByteString(args.GetIsolate(), | ||
| 2313 | + OBJ_nid2sn(nid))).FromJust(); | ||
| 2314 | + info->Set(context, env->size_string(), | ||
| 2315 | + Integer::New(env->isolate(), | ||
| 2316 | + EVP_PKEY_bits(key))).FromJust(); | ||
| 2299 | 2317 | } | |
| 2300 | 2318 | } | |
| 2301 | 2319 | EVP_PKEY_free(key); | |
@@ -2388,7 +2406,8 @@ void SSLWrap<Base>::VerifyError(const FunctionCallbackInfo<Value>& args) { | |||
| 2388 | 2406 | Local<String> reason_string = OneByteString(isolate, reason); | |
| 2389 | 2407 | Local<Value> exception_value = Exception::Error(reason_string); | |
| 2390 | 2408 | Local<Object> exception_object = exception_value->ToObject(isolate); | |
| 2391 | - exception_object->Set(w->env()->code_string(), OneByteString(isolate, code)); | ||
| 2409 | + exception_object->Set(w->env()->context(), w->env()->code_string(), | ||
| 2410 | + OneByteString(isolate, code)).FromJust(); | ||
| 2392 | 2411 | args.GetReturnValue().Set(exception_object); | |
| 2393 | 2412 | } | |
| 2394 | 2413 | ||
@@ -2398,16 +2417,18 @@ void SSLWrap<Base>::GetCurrentCipher(const FunctionCallbackInfo<Value>& args) { | |||
| 2398 | 2417 | Base* w; | |
| 2399 | 2418 | ASSIGN_OR_RETURN_UNWRAP(&w, args.Holder()); | |
| 2400 | 2419 | Environment* env = w->ssl_env(); | |
| 2420 | + Local<Context> context = env->context(); | ||
| 2401 | 2421 | ||
| 2402 | 2422 | const SSL_CIPHER* c = SSL_get_current_cipher(w->ssl_); | |
| 2403 | 2423 | if (c == nullptr) | |
| 2404 | 2424 | return; | |
| 2405 | 2425 | ||
| 2406 | 2426 | Local<Object> info = Object::New(env->isolate()); | |
| 2407 | 2427 | const char* cipher_name = SSL_CIPHER_get_name(c); | |
| 2408 | - info->Set(env->name_string(), OneByteString(args.GetIsolate(), cipher_name)); | ||
| 2409 | - info->Set(env->version_string(), | ||
| 2410 | - OneByteString(args.GetIsolate(), "TLSv1/SSLv3")); | ||
| 2428 | + info->Set(context, env->name_string(), | ||
| 2429 | + OneByteString(args.GetIsolate(), cipher_name)).FromJust(); | ||
| 2430 | + info->Set(context, env->version_string(), | ||
| 2431 | + OneByteString(args.GetIsolate(), "TLSv1/SSLv3")).FromJust(); | ||
| 2411 | 2432 | args.GetReturnValue().Set(info); | |
| 2412 | 2433 | } | |
| 2413 | 2434 | ||
@@ -2716,27 +2737,31 @@ int SSLWrap<Base>::SSLCertCallback(SSL* s, void* arg) { | |||
| 2716 | 2737 | return -1; | |
| 2717 | 2738 | ||
| 2718 | 2739 | Environment* env = w->env(); | |
| 2740 | + Local<Context> context = env->context(); | ||
| 2719 | 2741 | HandleScope handle_scope(env->isolate()); | |
| 2720 | - Context::Scope context_scope(env->context()); | ||
| 2742 | + Context::Scope context_scope(context); | ||
| 2721 | 2743 | w->cert_cb_running_ = true; | |
| 2722 | 2744 | ||
| 2723 | 2745 | Local<Object> info = Object::New(env->isolate()); | |
| 2724 | 2746 | ||
| 2725 | 2747 | const char* servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name); | |
| 2726 | 2748 | if (servername == nullptr) { | |
| 2727 | - info->Set(env->servername_string(), String::Empty(env->isolate())); | ||
| 2749 | + info->Set(context, | ||
| 2750 | + env->servername_string(), | ||
| 2751 | + String::Empty(env->isolate())).FromJust(); | ||
| 2728 | 2752 | } else { | |
| 2729 | 2753 | Local<String> str = OneByteString(env->isolate(), servername, | |
| 2730 | 2754 | strlen(servername)); | |
| 2731 | - info->Set(env->servername_string(), str); | ||
| 2755 | + info->Set(context, env->servername_string(), str).FromJust(); | ||
| 2732 | 2756 | } | |
| 2733 | 2757 | ||
| 2734 | 2758 | bool ocsp = false; | |
| 2735 | 2759 | #ifdef NODE__HAVE_TLSEXT_STATUS_CB | |
| 2736 | 2760 | ocsp = SSL_get_tlsext_status_type(s) == TLSEXT_STATUSTYPE_ocsp; | |
| 2737 | 2761 | #endif | |
| 2738 | 2762 | ||
| 2739 | - info->Set(env->ocsp_request_string(), Boolean::New(env->isolate(), ocsp)); | ||
| 2763 | + info->Set(context, env->ocsp_request_string(), | ||
| 2764 | + Boolean::New(env->isolate(), ocsp)).FromJust(); | ||
| 2740 | 2765 | ||
| 2741 | 2766 | Local<Value> argv[] = { info }; | |
| 2742 | 2767 | w->MakeCallback(env->oncertcb_string(), arraysize(argv), argv); | |
@@ -5653,7 +5678,7 @@ void PBKDF2(const FunctionCallbackInfo<Value>& args) { | |||
| 5653 | 5678 | keylen)); | |
| 5654 | 5679 | ||
| 5655 | 5680 | if (args[5]->IsFunction()) { | |
| 5656 | - obj->Set(env->ondone_string(), args[5]); | ||
| 5681 | + obj->Set(env->context(), env->ondone_string(), args[5]).FromJust(); | ||
| 5657 | 5682 | ||
| 5658 | 5683 | uv_queue_work(env->event_loop(), | |
| 5659 | 5684 | req.release()->work_req(), | |
@@ -5841,7 +5866,7 @@ void RandomBytes(const FunctionCallbackInfo<Value>& args) { | |||
| 5841 | 5866 | RandomBytesRequest::FREE_DATA)); | |
| 5842 | 5867 | ||
| 5843 | 5868 | if (args[1]->IsFunction()) { | |
| 5844 | - obj->Set(env->ondone_string(), args[1]); | ||
| 5869 | + obj->Set(env->context(), env->ondone_string(), args[1]).FromJust(); | ||
| 5845 | 5870 | ||
| 5846 | 5871 | uv_queue_work(env->event_loop(), | |
| 5847 | 5872 | req.release()->work_req(), | |
@@ -5910,7 +5935,10 @@ void GetSSLCiphers(const FunctionCallbackInfo<Value>& args) { | |||
| 5910 | 5935 | ||
| 5911 | 5936 | for (int i = 0; i < sk_SSL_CIPHER_num(ciphers); ++i) { | |
| 5912 | 5937 | const SSL_CIPHER* cipher = sk_SSL_CIPHER_value(ciphers, i); | |
| 5913 | - arr->Set(i, OneByteString(args.GetIsolate(), SSL_CIPHER_get_name(cipher))); | ||
| 5938 | + arr->Set(env->context(), | ||
| 5939 | + i, | ||
| 5940 | + OneByteString(args.GetIsolate(), | ||
| 5941 | + SSL_CIPHER_get_name(cipher))).FromJust(); | ||
| 5914 | 5942 | } | |
| 5915 | 5943 | ||
| 5916 | 5944 | SSL_free(ssl); | |
@@ -5973,7 +6001,10 @@ void GetCurves(const FunctionCallbackInfo<Value>& args) { | |||
| 5973 | 6001 | ||
| 5974 | 6002 | if (EC_get_builtin_curves(curves, num_curves)) { | |
| 5975 | 6003 | for (size_t i = 0; i < num_curves; i++) { | |
| 5976 | - arr->Set(i, OneByteString(env->isolate(), OBJ_nid2sn(curves[i].nid))); | ||
| 6004 | + arr->Set(env->context(), | ||
| 6005 | + i, | ||
| 6006 | + OneByteString(env->isolate(), | ||
| 6007 | + OBJ_nid2sn(curves[i].nid))).FromJust(); | ||
| 5977 | 6008 | } | |
| 5978 | 6009 | } | |
| 5979 | 6010 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments