Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

Commit 2553cc9

Browse files
chakrabotMSLaguana
authored andcommitted
meta: merge node/master into node-chakracore/master
Merge 89dd21a as of 2018-02-02 This commit was automatically generated. For any problems, please contact jackhorton Reviewed-By: Jimmy Thomson <jithomso@microsoft.com>
2 parents 6da5a68 + 89dd21a commit 2553cc9

File tree

11 files changed

+103
-48
lines changed

11 files changed

+103
-48
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ coverage-test: coverage-build
191191
$(RM) out/$(BUILDTYPE)/obj.target/node/gen/*.gcda
192192
$(RM) out/$(BUILDTYPE)/obj.target/node/src/*.gcda
193193
$(RM) out/$(BUILDTYPE)/obj.target/node/src/tracing/*.gcda
194+
$(RM) out/$(BUILDTYPE)/obj.target/node_lib/gen/*.gcda
195+
$(RM) out/$(BUILDTYPE)/obj.target/node_lib/src/*.gcda
196+
$(RM) out/$(BUILDTYPE)/obj.target/node_lib/src/tracing/*.gcda
194197
-$(MAKE) $(COVTESTS)
195198
mv lib lib__
196199
mv lib_ lib
@@ -201,7 +204,7 @@ coverage-test: coverage-build
201204
--temp-directory "$(CURDIR)/.cov_tmp" \
202205
--report-dir "../coverage")
203206
-(cd out && "../gcovr/scripts/gcovr" --gcov-exclude='.*deps' \
204-
--gcov-exclude='.*usr' -v -r Release/obj.target/node \
207+
--gcov-exclude='.*usr' -v -r Release/obj.target \
205208
--html --html-detail -o ../coverage/cxxcoverage.html \
206209
--gcov-executable="$(GCOV)")
207210
mv lib lib_

common.gypi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@
343343
],
344344
}],
345345
[ 'OS in "linux freebsd openbsd solaris aix"', {
346-
'cflags': [ '-pthread', ],
346+
'cflags': [ '-pthread' ],
347347
'ldflags': [ '-pthread' ],
348348
}],
349349
[ 'OS in "linux freebsd openbsd solaris android aix cloudabi"', {
@@ -356,6 +356,7 @@
356356
'standalone_static_library': 1,
357357
}],
358358
['OS=="openbsd"', {
359+
'cflags': [ '-I/usr/local/include' ],
359360
'ldflags': [ '-Wl,-z,wxneeded' ],
360361
}],
361362
],

deps/v8/src/v8.gyp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2068,9 +2068,10 @@
20682068
'-L/usr/local/lib -lexecinfo',
20692069
]},
20702070
'sources': [
2071+
'base/debug/stack_trace_posix.cc',
20712072
'base/platform/platform-openbsd.cc',
20722073
'base/platform/platform-posix.h',
2073-
'base/platform/platform-posix.cc'
2074+
'base/platform/platform-posix.cc',
20742075
'base/platform/platform-posix-time.h',
20752076
'base/platform/platform-posix-time.cc',
20762077
],

doc/api/crypto.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,11 +1239,15 @@ This property is deprecated.
12391239
### crypto.fips
12401240
<!-- YAML
12411241
added: v6.0.0
1242+
deprecated: REPLACEME
12421243
-->
12431244

12441245
Property for checking and controlling whether a FIPS compliant crypto provider is
12451246
currently in use. Setting to true requires a FIPS build of Node.js.
12461247

1248+
This property is deprecated. Please use `crypto.setFips()` and
1249+
`crypto.getFips()` instead.
1250+
12471251
### crypto.createCipher(algorithm, password[, options])
12481252
<!-- YAML
12491253
added: v0.1.94
@@ -1576,6 +1580,14 @@ const bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex');
15761580
console.log(aliceSecret === bobSecret);
15771581
```
15781582

1583+
### crypto.getFips()
1584+
<!-- YAML
1585+
added: REPLACEME
1586+
-->
1587+
1588+
Returns `true` if and only if a FIPS compliant crypto provider is
1589+
currently in use.
1590+
15791591
### crypto.getHashes()
15801592
<!-- YAML
15811593
added: v0.9.3
@@ -1999,6 +2011,15 @@ is a bit field taking one of or a mix of the following flags (defined in
19992011
* `crypto.constants.ENGINE_METHOD_ALL`
20002012
* `crypto.constants.ENGINE_METHOD_NONE`
20012013

2014+
### crypto.setFips(bool)
2015+
<!-- YAML
2016+
added: REPLACEME
2017+
-->
2018+
* `bool` {boolean} `true` to enable FIPS mode.
2019+
2020+
Enables the FIPS compliant crypto provider in a FIPS-enabled Node.js build.
2021+
Throws an error if FIPS mode is not available.
2022+
20022023
### crypto.timingSafeEqual(a, b)
20032024
<!-- YAML
20042025
added: v6.6.0

doc/api/deprecations.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,13 @@ Assigning properties to the top-level `this` as an alternative
840840
to `module.exports` is deprecated. Developers should use `exports`
841841
or `module.exports` instead.
842842
843+
### DEP00XX: crypto.fips is deprecated and replaced.
844+
845+
Type: Documentation-only
846+
847+
The [`crypto.fips`][] property is deprecated. Please use `crypto.setFips()`
848+
and `crypto.getFips()` instead.
849+
843850
[`--pending-deprecation`]: cli.html#cli_pending_deprecation
844851
[`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size
845852
[`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array
@@ -855,6 +862,7 @@ or `module.exports` instead.
855862
[`console.log()`]: console.html#console_console_log_data_args
856863
[`crypto.createCredentials()`]: crypto.html#crypto_crypto_createcredentials_details
857864
[`crypto.DEFAULT_ENCODING`]: crypto.html#crypto_crypto_default_encoding
865+
[`crypto.fips`]: crypto.html#crypto_crypto_fips
858866
[`crypto.pbkdf2()`]: crypto.html#crypto_crypto_pbkdf2_password_salt_iterations_keylen_digest_callback
859867
[`decipher.setAuthTag()`]: crypto.html#crypto_decipher_setauthtag_buffer
860868
[`domain`]: domain.html

lib/_stream_writable.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ Writable.prototype.uncork = function() {
297297

298298
if (!state.writing &&
299299
!state.corked &&
300-
!state.finished &&
301300
!state.bufferProcessing &&
302301
state.bufferedRequest)
303302
clearBuffer(this, state);
@@ -569,7 +568,7 @@ Writable.prototype.end = function(chunk, encoding, cb) {
569568
}
570569

571570
// ignore unnecessary end() calls.
572-
if (!state.ending && !state.finished)
571+
if (!state.ending)
573572
endWritable(this, state, cb);
574573
};
575574

@@ -648,11 +647,9 @@ function onCorkedFinish(corkReq, state, err) {
648647
cb(err);
649648
entry = entry.next;
650649
}
651-
if (state.corkedRequestsFree) {
652-
state.corkedRequestsFree.next = corkReq;
653-
} else {
654-
state.corkedRequestsFree = corkReq;
655-
}
650+
651+
// reuse the free corkReq.
652+
state.corkedRequestsFree.next = corkReq;
656653
}
657654

658655
Object.defineProperty(Writable.prototype, 'destroyed', {

lib/crypto.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ module.exports = exports = {
162162
rng: randomBytes,
163163
setEngine,
164164
timingSafeEqual,
165+
getFips: !fipsMode ? getFipsDisabled :
166+
fipsForced ? getFipsForced : getFipsCrypto,
167+
setFips: !fipsMode ? setFipsDisabled :
168+
fipsForced ? setFipsForced : setFipsCrypto,
165169

166170
// Classes
167171
Certificate,
@@ -196,6 +200,7 @@ function getFipsForced() {
196200
}
197201

198202
Object.defineProperties(exports, {
203+
// crypto.fips is deprecated. DEP00XX. Use crypto.getFips()/crypto.setFips()
199204
fips: {
200205
get: !fipsMode ? getFipsDisabled :
201206
fipsForced ? getFipsForced : getFipsCrypto,

node.gypi

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@
202202
],
203203
}],
204204
[ '(OS=="freebsd" or OS=="linux") and node_shared=="false"'
205-
' and coverage=="false" and force_load=="true"', {
205+
' and force_load=="true"', {
206206
'ldflags': [ '-Wl,-z,noexecstack' ],
207207
'conditions': [
208208
[ 'node_engine=="v8"', {
@@ -215,20 +215,15 @@
215215
}],
216216
]
217217
}],
218-
[ '(OS=="freebsd" or OS=="linux") and node_shared=="false"'
219-
' and coverage=="true" and force_load=="true"', {
220-
'ldflags': [ '-Wl,-z,noexecstack',
221-
'-Wl,--whole-archive <(v8_base)',
222-
'-Wl,--no-whole-archive',
223-
'--coverage',
218+
[ 'OS in "mac freebsd linux" and node_shared=="false"'
219+
' and coverage=="true"', {
220+
'ldflags': [ '--coverage',
224221
'-g',
225222
'-O0' ],
226-
'cflags': [ '--coverage',
223+
'cflags': [ '--coverage',
227224
'-g',
228225
'-O0' ],
229-
'cflags!': [ '-O3' ]
230-
}],
231-
[ 'OS=="mac" and node_shared=="false" and coverage=="true"', {
226+
'cflags!': [ '-O3' ],
232227
'xcode_settings': {
233228
'OTHER_LDFLAGS': [
234229
'--coverage',

src/node.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2637,6 +2637,7 @@ static void EnvGetter(Local<Name> property,
26372637
#else // _WIN32
26382638
node::TwoByteValue key(isolate, property);
26392639
WCHAR buffer[32767]; // The maximum size allowed for environment variables.
2640+
SetLastError(ERROR_SUCCESS);
26402641
DWORD result = GetEnvironmentVariableW(reinterpret_cast<WCHAR*>(*key),
26412642
buffer,
26422643
arraysize(buffer));
@@ -2685,6 +2686,7 @@ static void EnvQuery(Local<Name> property,
26852686
#else // _WIN32
26862687
node::TwoByteValue key(info.GetIsolate(), property);
26872688
WCHAR* key_ptr = reinterpret_cast<WCHAR*>(*key);
2689+
SetLastError(ERROR_SUCCESS);
26882690
if (GetEnvironmentVariableW(key_ptr, nullptr, 0) > 0 ||
26892691
GetLastError() == ERROR_SUCCESS) {
26902692
rc = 0;

0 commit comments

Comments
 (0)