1. Mar 28, 2014
    • Fedor Indutny's avatar
      tls: force readable/writable to `true` · ef096f8d
      Fedor Indutny authored
      These are an old and deprecated properties that was used by previous
      stream implementation, and are still in use in some user-land modules.
      
      Prior to this commit, they were read from the underlying socket, which
      may be non-readable/non-writable while connecting or while staying
      uninitialized.
      
      Force set them to `true`, just to make sure that there will be no
      inconsistency.
      
      fix #7152
      ef096f8d
  2. Mar 26, 2014
    • Fedor Indutny's avatar
      crypto: fix lint · e781832e
      Fedor Indutny authored
      e781832e
    • Fedor Indutny's avatar
      Merge remote-tracking branch 'origin/v0.10' · a030c7b9
      Fedor Indutny authored
      Conflicts:
      	src/node.cc
      	src/node_crypto.cc
      	src/node_crypto.h
      a030c7b9
    • Ben Noordhuis's avatar
      src: ensure that openssl's PRNG is fully seeded · f68a116c
      Ben Noordhuis authored
      Ensure that OpenSSL has enough entropy (at least 256 bits) for its PRNG.
      
      The entropy pool starts out empty and needs to fill up before the PRNG
      can be used securely.
      
      OpenSSL normally fills the pool automatically but not when someone
      starts generating random numbers before the pool is full: in that case
      OpenSSL keeps lowering the entropy estimate to thwart attackers trying
      to guess the initial state of the PRNG.
      
      When that happens, we wait until enough entropy is available, something
      that normally should never take longer than a few milliseconds.
      
      Fixes #7338.
      f68a116c
    • Ben Noordhuis's avatar
      src: seed V8's random number generator at startup · 70f198dd
      Ben Noordhuis authored
      The default entropy source is /dev/urandom on UNIX platforms, which is
      okay but we can do better by seeding it from OpenSSL's entropy pool.
      
      On Windows we can certainly do better; on that platform, V8 seeds the
      random number generator using only the current system time.
      
      Fixes #6250.
      
      NB: This is a back-port of commit 7ac23910 from the master branch that
      for some reason never got back-ported to the v0.10 branch.
      
      The default on UNIX platforms in v0.10 is different and arguably worse
      than it is with master: if no entropy source is provided, V8 3.14 calls
      srandom() with a xor of the PID and the current time in microseconds.
      
      That means that on systems with a coarse system clock, the initial
      state of the PRNG may be easily guessable.
      
      The situation on Windows is even more dire because there the PRNG is
      seeded with only the current time... in milliseconds.
      70f198dd
    • isaacs's avatar
      npm: upgrade to 1.4.6 · bd547d65
      isaacs authored
      * Documentation upgrades
      * Fix glob bug which prevents proper README publishing
      * node-gyp upgrade to 0.13
      * Documentation updates
      * Add --save-exact to save an exact dep (instead of a range)
      * alias 't' to 'test'
      bd547d65
    • Nathan Rajlich's avatar
      doc: remove `agent.request()` call in example · 69b8279d
      Nathan Rajlich authored
      The `Agent#request()` function was removed in
      f3189ace, so don't
      use it in the documentation example. The function
      wasn't documented in the first place.
      69b8279d
  3. Mar 25, 2014
    • Nathan Rajlich's avatar
      http: use defaultAgent.protocol in protocol check · 9f23fe11
      Nathan Rajlich authored
      Default to the `defaultAgent.protocol` when comparing the
      user-specified `options.protocol` string. This is so that
      `http.Agent` instances do not need to specify their own
      `protocol` field, since we have the relevant information
      already from the `defaultAgent`.
      
      Note that the test case could be separately cherry-picked
      to the `v0.10` branch, since it already passes correctly.
      
      Fixes #7349.
      Fixes the regression described in: http://git.io/2ds-WQ
      9f23fe11
  4. Mar 24, 2014
    • Ben Noordhuis's avatar
      build: fix g++ 4.8 build, disable -Werror · 7989f42f
      Ben Noordhuis authored
      Turn off -Werror when building V8, it hits -Werror=unused-local-typedefs
      with g++ 4.8.  The warning itself is harmless so don't abort the build.
      
      This was originally implemented in commit d2ab314e back in 2011 but the
      build process has gone through a few iterations since then, that change
      no longer works.
      7989f42f
  5. Mar 21, 2014
  6. Mar 18, 2014
  7. Mar 16, 2014
    • Ben Noordhuis's avatar
      src: fix tracing infrastructure after v8 upgrade · 23dfa71d
      Ben Noordhuis authored
      Fix up the dtrace/etw/systemtap infrastructure after the V8 upgrade in
      commit 1c7bf245.  The win32 changes are untested but can hardly make
      things worse because node doesn't build on windows right now.
      
      Fixes #7313 with some luck.
      23dfa71d
    • Ben Noordhuis's avatar
      src: don't call DecodeWrite() on Buffers · c30cc4e3
      Ben Noordhuis authored
      Don't call DecodeWrite() with a Buffer as its argument because it in
      turn calls StringBytes::Write() and that method expects a Local<String>.
      
      "Why then does that function take a Local<Value>?" I hear you ask.
      Good question but I don't have the answer.  I added a CHECK for good
      measure and what do you know, all of a sudden a large number of crypto
      tests started failing.
      
      Calling DecodeWrite(BINARY) on a buffer is nonsensical anyway: if you
      want the contents of the buffer, just copy out the data, there is no
      need to decode it - and that's exactly what this commit does.
      
      Fixes a great many instances of the following run-time error in debug
      builds:
      
          FATAL ERROR: v8::String::Cast() Could not convert to string
      c30cc4e3
    • Ben Noordhuis's avatar
      src: fix up smalloc weak persistent usage · e87ceb2b
      Ben Noordhuis authored
      Fix a regression that was introduced in commit ce04c726 after the
      upgrade to V8 3.24.
      
      The new weak persistent handle API no longer gives you the original
      persistent but still requires that you clear it inside your weak
      callback.
      
      Rearrange the code in src/smalloc.cc to keep track of the persistent
      handle with the least amount of pain and try hard to share as much
      code as possible between the 'just free it' and 'invoke my callback'
      versions of the smalloc API.
      
      Fixes #7309.
      e87ceb2b
    • Ben Noordhuis's avatar
      src: add CHECK_{GE,GT,LE,LT} macros · ad15d757
      Ben Noordhuis authored
      Conform to the Google styleguide more and make cpplint happy, add more
      CHECK macros.
      
      Preemptively addresses cpplint's readability/check warnings ("Consider
      using CHECK_GT instead of CHECK(a > b)".)
      ad15d757
    • Ben Noordhuis's avatar
      src: deduplicate CHECK_EQ/CHECK_NE macros · 8eb76075
      Ben Noordhuis authored
      DRY the macros, there is no need to define them twice depending on
      whether NDEBUG is defined or not.
      8eb76075
    • Ben Noordhuis's avatar
      src: fix segfaults, fix 32 bits integer negation · f6ea0c20
      Ben Noordhuis authored
      Make calls to v8::Isolate::AdjustAmountOfExternalAllocatedMemory() take
      special care when negating 32 bits unsigned types like size_t.
      
      Before this commit, values were negated before they got promoted to
      64 bits, meaning that on 32 bits architectures, a value like 42 got
      cast to 4294967254 instead of -42.
      
      That in turn made the garbage collector start scavenging like crazy
      because it thought the system was out of memory.
      
      That's bad enough but calls to AdjustAmountOfExternalAllocatedMemory()
      were made from weak callbacks, i.e. at a time when the garbage collector
      was already busy.  It triggered asserts in debug builds and caused
      random crashes and memory corruption in release builds.
      
      The behavior in release builds is arguably a V8 bug and should perhaps
      be reported upstream.
      
      Partially fixes #7309 but requires further bug fixes to src/smalloc.cc
      that I'll address in a follow-up commit.
      f6ea0c20
    • Ben Noordhuis's avatar
      src: squelch -Wmaybe-uninitialized warning · a3dca9a3
      Ben Noordhuis authored
      The variable isn't actually used uninitialized but g++ 4.8 doesn't know
      that.  Set it to NULL to silence the following compiler warning:
      
          ../src/string_bytes.cc:247:29: warning: 'data' may be used
          uninitialized in this function [-Wmaybe-uninitialized]
               unsigned a = hex2bin(src[i * 2 + 0]);
                                        ^
          ../src/string_bytes.cc:299:15: note: 'data' was declared here
             const char* data;
                         ^
      a3dca9a3
    • Ben Noordhuis's avatar
      src: remove unused ExternString constructor · 91b4a561
      Ben Noordhuis authored
      Remove an unused (and unsafe) constructor.  Unsafe because it doesn't
      initialize the data_ field.
      91b4a561
  8. Mar 14, 2014
  9. Mar 13, 2014
  10. Mar 12, 2014
    • Timothy J Fontaine's avatar
      Now working on 0.11.13 · 9bd934cb
      Timothy J Fontaine authored
      9bd934cb
    • Timothy J Fontaine's avatar
      Merge branch 'v0.11.12-release' · 44bf5f8c
      Timothy J Fontaine authored
      44bf5f8c
    • Timothy J Fontaine's avatar
      7d6b8db4
    • Timothy J Fontaine's avatar
      2014.03.11, Version 0.11.12 (Unstable) · 0c2e28d6
      Timothy J Fontaine authored
      * uv: Upgrade to v0.11.22 (Timothy J Fontaine)
      
      * buffer: allow toString to accept Infinity for end (Brian White)
      
      * child_process: add spawnSync/execSync (Bert Belder, Timothy J Fontaine)
      
      * cluster: handle bind errors on Windows (Alexis Campailla)
      
      * contextify: handle infinite recursion errors (Fedor Indutny)
      
      * crypto: allow custom generator for DiffieHellman (Brian White)
      
      * crypto: allow setting add'l authenticated data (Brian White)
      
      * crypto: fix CipherFinal return value check (Brian White)
      
      * crypto: make NewSessionDoneCb public (Fedor Indutny)
      
      * dgram: pass the bytes sent to the send callback (Timothy J Fontaine)
      
      * dns: validate arguments in resolver (Kenan Sulayman)
      
      * dns: verify argument is valid function in resolve (Kenan Sulayman)
      
      * http: avoid duplicate keys in writeHead (David Björklund)
      
      * net: add localPort to connect options (Timothy J Fontaine)
      
      * node: do not print SyntaxError hints to stderr (Fedor Indutny)
      
      * node: invoke `beforeExit` again if loop was active (Fedor Indutny)
      
      * node: make AsyncListenerInst field more explicit (Trevor Norris)
      
      * os: networkInterfaces include scopeid for ipv6 (Xidorn Quan)
      
      * process: allow changing `exitCode` in `on('exit')` (Fedor Indutny)
      
      * readline: fix `line` event, if input emit 'end' (Yazhong Liu)
      
      * src: add tracing.v8.on('gc') statistics hooks (Ben Noordhuis)
      
      * src: add v8.getHeapStatistics() function (Ben Noordhuis)
      
      * src: emit 'beforeExit' event on process object (Ben Noordhuis)
      
      * src: move AsyncListener from process to tracing (Trevor Norris)
      
      * tls: fix crash in SNICallback (Fedor Indutny)
      
      * tls: introduce asynchronous `newSession` (Fedor Indutny)
      
      * util: show meaningful values for boxed primitives (Nathan Rajlich)
      
      * vm: don't copy Proxy object from parent context (Ben Noordhuis)
      
      * windows: make stdout/sterr pipes blocking (Alexis Campailla)
      
      * zlib: add sync versions for convenience methods (Nikolai Vavilov)
      0c2e28d6
  11. Mar 11, 2014