0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

84 Commits

Author SHA1 Message Date
Haoliang Gao
1151016d0a doc: fix typo in crypto
PR-URL: https://github.com/iojs/io.js/pull/765
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-02-09 13:34:56 +01:00
Haoliang Gao
7c568684b8 doc: change the order of crypto.publicDecrypt
PR-URL: https://github.com/iojs/io.js/pull/767
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-02-09 13:33:26 +01:00
Ben Noordhuis
789bbb91d3 doc: update node.js references in api docs
Fixes: https://github.com/iojs/io.js/issues/740
PR-URL: https://github.com/iojs/io.js/pull/750
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-02-07 17:07:15 -05:00
Calvin Metcalf
6561274d23 crypto: support passwords in publicEncrypt
Private keys may be used along with publicEncrypt since the private key
includes the public one.  This adds the ability to use encrypted private
keys which previously threw an error.  This commit also makes sure the
user exposed functions have names.

PR-URL: https://github.com/iojs/io.js/pull/626
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-02-02 23:21:49 +01:00
Calvin Metcalf
7604e6decc docs: add note about default padding in crypto
Adds a note that the default padding for publicDecrypt/privateEncrypt
is RSA_PKCS1_PADDING instead of RSA_PKCS1_OAEP_PADDING as it is for
privateDecrypt/publicEncrypt.

PR-URL: https://github.com/iojs/io.js/pull/659
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
2015-01-29 18:42:36 -08:00
Fedor Indutny
87e62bd4c8 crypto: implement privateEncrypt/publicDecrypt
PR-URL: https://github.com/iojs/io.js/pull/625
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Fix iojs/io.js#477
2015-01-28 02:02:52 +03:00
Calvin Metcalf
e5e598060e lib,src: make pseudoRandomBytes alias randomBytes
Previously pseudoRandomBytes worked similarly to randomBytes but in the
event of insufficient entropy would silently return non-secure values.

As of f68a116, the entropy pool blocks if there is insufficient entropy
instead of giving an error so there is now no longer a case where
pseudoRandomBytes would act differently than randomBytes.

Docs are updated to remove pseudoRandomBytes and to clarify that
randomBytes now does block instead of erring when entropy is low.

PR-URL: https://github.com/iojs/io.js/pull/557
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-01-22 23:08:36 +01:00
Calvin Metcalf
d481bb68c4 doc: more explicit crypto.pseudoRandomBytes docs
Updates the docs for the crypto.pseudoRandomBytes function
to more explicitly detail how it's the same as crypto.randomBytes
just without a safety net (e.g. it doesn't throw an error when
there is low entropy).

PR-URL: https://github.com/iojs/io.js/pull/545
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-22 15:47:41 +01:00
Calvin Metcalf
43226dd40e doc: add note about key derivation
adds a note to the crypto docs passing along
the advice that openssl gives about what
key derivation function they recommend.

PR-URL: https://github.com/joyent/node/pull/8580
Reviewed-by: Fedor Indutny <fedor@indutny.com>

Cherry-picked-from: 7dbc024c85
2015-01-10 22:15:48 +01:00
Wang Xinyong
db7df57e03 doc: correct createSecureContext
Remove incorrect stablity indication of tls.createSecureContext, and
format stablity indication of crypto.createCredentials.

Fixes: e50749 "doc: document `tls.createSecureContext`"
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-10-09 11:46:58 -07:00
Trevor Norris
f2a78de6ec doc: fix optional parameter parsing
The parameter parser specifically looked for the old bracket syntax.
This generated a lot of warnings when building the docs. Those warnings
have been fixed by changing the parsing logic.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-09-29 16:32:34 -07:00
Trevor Norris
51b6b6844e doc: fix brackets for optional parameters
Documentation incorrectly used bracket notation for optional parameters.
This caused inconsistencies in usage because of examples like the
following:

    fs.write(fd, data[, position[, encoding]], callback)

This simply fixes all uses of bracket notation in documentation.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
2014-09-25 11:26:15 -07:00
Fedor Indutny
6e453fad87 crypto: introduce ECDH 2014-08-29 00:27:09 +04:00
Fedor Indutny
6adf3ecebb crypto: allow padding in RSA methods
Reviewed-By: Trevor Norris <trevnorris@gmail.com>
2014-08-27 00:24:57 +04:00
seishun
42bda05af8 crypto: add RSA encryption
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-08-11 22:00:34 +04:00
Fedor Indutny
f310c0f16b Merge remote-tracking branch 'origin/v0.10' into master
Conflicts:
	doc/api/buffer.markdown
	lib/_stream_readable.js
	lib/assert.js
	lib/buffer.js
	lib/child_process.js
	lib/http.js
	lib/string_decoder.js
	lib/zlib.js
	node.gyp
	test/simple/test-buffer.js
	test/simple/test-https-foafssl.js
	test/simple/test-stream2-compatibility.js
	test/simple/test-tls-server-verify.js
2014-07-29 12:51:27 +04:00
Brian White
c7c904b1fc doc: fix createCipher description
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-07-02 13:02:46 -07:00
Fedor Indutny
e50749bb05
doc: document tls.createSecureContext 2014-06-25 14:11:09 +04:00
Brian White
31ce34887f crypto: allow setting add'l authenticated data 2014-03-04 12:42:03 +04:00
Brian White
a226be4f76 crypto: allow custom generator for DiffieHellman 2014-02-18 15:49:23 +04:00
Timothy J Fontaine
eadb4f5606 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	deps/v8/src/preparser.cc
	deps/v8/src/win32-math.h
	doc/api/http.markdown
	src/node_buffer.h
	src/node_crypto.cc
	src/node_file.cc
	src/node_http_parser.cc
2014-02-08 16:45:27 -08:00
Brian White
3595139b51 doc: fix diffieHellman.getGenerator() description 2014-02-09 02:42:41 +04:00
Ben Noordhuis
74d9aa49d5 crypto: support custom pbkdf2 digest methods
Make the HMAC digest method configurable.  Update crypto.pbkdf2() and
crypto.pbkdf2Sync() to take an extra, optional digest argument.

Before this commit, SHA-1 (admittedly the most common method) was used
exclusively.

Fixes #6553.
2014-01-22 15:58:07 +04:00
Fedor Indutny
92b6417098 crypto: introduce .setEngine(engine, [flags]) 2014-01-05 16:42:33 +04:00
Timothy J Fontaine
069dd07a17 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	AUTHORS
	ChangeLog
	deps/uv/.mailmap
	deps/uv/ChangeLog
	deps/uv/build.mk
	deps/uv/src/unix/darwin.c
	deps/uv/src/unix/udp.c
	deps/uv/src/version.c
	deps/uv/test/test-list.h
	src/node_version.h
2013-12-12 11:32:41 -08:00
Mathias Bynens
f89a7185b7 doc: mention binary as deafult for Hash strings 2013-12-11 20:39:22 -08:00
Ingmar Runge
e0d31ea2db crypto: support GCM authenticated encryption mode.
This adds two new member functions getAuthTag and setAuthTag that
are useful for AES-GCM encryption modes. Use getAuthTag after
Cipheriv.final, transmit the tag along with the data and use
Decipheriv.setAuthTag to have the encrypted data verified.
2013-12-08 00:00:02 +04:00
Timothy J Fontaine
eaba9417b1 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	lib/events.js
	src/udp_wrap.cc
2013-11-20 15:45:50 -08:00
Fedor Indutny
88dc1fcb62 crypto: randomBytes is non-blocking
Add NOTE section in documentation, mentioning that `randomBytes` won't
block when entropy sources are drained.

fix #6372
2013-11-19 13:15:50 +04:00
isaacs
a48b647162 Merge remote-tracking branch 'ry/v0.10' 2013-11-08 13:41:44 -08:00
Fedor Indutny
0be5a94c56 doc: encoding is ignored if input is a Buffer
NOTE: it wasn't in 0.8

fixes #6386
2013-11-07 11:02:19 -08:00
Thom Seddon
f755ecf484 src: accept passphrase when crypto signing with private key
Previous behaviour was to drop to an openssl prompt
("Enter PEM pass phrase:") when supplying a private key with a
passphrase. This change adds a fourth, optional, paramter that
will be used as the passphrase.
To include this parameter in a backwards compatible way it was
necessary to expose the previously undocumented (and unexposed)
feature of being able to explitly setting the output encoding.
2013-10-29 14:19:47 +04:00
Jason Gerfen
990141502d doc: crypto: document SPKAC additions
Document the SPKAC functionality that was added in commit 7bf46ba.
2013-10-16 09:44:46 -07:00
isaacs
a555992d5e Revert "doc: crypto: document SPKAC additions"
This reverts commit aa94450b31.
2013-10-15 15:59:05 -07:00
Jason Gerfen
aa94450b31 doc: crypto: document SPKAC additions
Document the SPKAC functionality that was added in commit 7f66e44.
2013-10-15 21:12:47 +02:00
Ben Noordhuis
cfd0dca9ae crypto: make getCiphers() return non-SSL ciphers
Commit f53441a added crypto.getCiphers() as a function that returns the
names of SSL ciphers.

Commit 14a6c4e then added crypto.getHashes(), which returns the names of
digest algorithms, but that creates a subtle inconsistency: the return
values of crypto.getHashes() are valid arguments to crypto.createHash()
but that is not true for crypto.getCiphers() - the returned values are
only valid for SSL/TLS functions.

Rectify that by adding tls.getCiphers() and making crypto.getCiphers()
return proper cipher names.
2013-03-25 18:42:07 +01:00
JeongHoon Byun
f217b5ed62 doc: fix typo in crypto docs 2013-03-17 13:45:14 +01:00
Aaron Cannon
0c57b31190 doc: Add crypto.pseudoRandomBytes, fix typo 2013-03-03 15:30:49 -08:00
isaacs
4a32d53155 doc: Crypto streaming interface 2012-12-14 10:52:27 -08:00
Tim Kuijsten
6f9ed28fac doc: fix typo in setPrivateKey function signature 2012-11-20 18:02:56 +01:00
isaacs
f3621359f4 doc: OpenSSL is bundled now. 2012-10-23 10:48:51 -07:00
isaacs
76b0bdf720 crypto: Add crypto.DEFAULT_ENCODING (defaults to 'buffer')
This is a flag to make it easier for users to upgrade through the
breaking crypto change, and easier for us to switch it back if it's a
problem.

Explicitly set default encoding to 'buffer' in other tests, in case it
ever changes back.
2012-10-23 10:48:51 -07:00
isaacs
bfb9d5bbe6 crypto: Binding only accepts buffers 2012-10-23 10:48:50 -07:00
isaacs
9901b69c8e crypto: Move encoding logic to JS, default=buffer
crypto: Hash and Hmac default to buffers

crypto: Move Cipher encoding logic to JS

crypto: Move Cipheriv encoding logic to JS

crypto: Move Decipher encoding logic to JS

crypto: Move Decipheriv into JS, default to buffers

crypto: Move Sign class to JS

crypto: Better encoding handling in Hash.update

crypto: Move Verify class to JS

crypto: Move DiffieHellman to JS, default to buffers

crypto: Move DiffieHellmanGroup to JS, default to buffers

Also, create a test for this feature
2012-10-23 10:22:42 -07:00
Ben Noordhuis
d0227b0308 Merge remote-tracking branch 'origin/v0.8'
Conflicts:
	deps/openssl/openssl.gyp
2012-10-21 23:06:48 +02:00
isaacs
627f0d27e8 doc: Typo. s/arguemnt/argument/ 2012-10-16 10:59:23 -07:00
Nathan Rajlich
4b238b4c2a Merge remote-tracking branch 'origin/v0.8'
Conflicts:
	AUTHORS
	ChangeLog
	deps/uv/test/runner-win.c
	doc/api/process.markdown
	lib/repl.js
	src/node_crypto.cc
	src/node_version.h
2012-10-13 16:16:56 -07:00
Ben Noordhuis
14a6c4efb8 crypto: add crypto.getHashes() 2012-10-13 02:55:14 +02:00
Ben Noordhuis
f53441ab1f crypto: add crypto.getCiphers()
Returns a list of, unsurprisingly, the available ciphers.
2012-10-13 01:49:57 +02:00
isaacs
99b2368a6c doc: Reduce crypto stability to 2-Unstable 2012-10-11 08:32:46 -07:00