Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Revert "crypto: use better memory BIO implementation"
Browse files Browse the repository at this point in the history
This change shouldn't have landed in the stable branch. It's a feature,
not a bug fix.

This reverts commit 58f93ff.
This reverts commit 8c8ebe4.
This reverts commit ba0f7b8.
This reverts commit 21f3c5c.
  • Loading branch information
bnoordhuis committed Apr 10, 2013
1 parent c665b8e commit 0d5595a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 421 deletions.
3 changes: 1 addition & 2 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@
'src/node_buffer.h',
'src/node_constants.h',
'src/node_crypto.h',
'src/node_crypto_bio.h',
'src/node_extensions.h',
'src/node_file.h',
'src/node_http_parser.h',
Expand Down Expand Up @@ -148,7 +147,7 @@
'conditions': [
[ 'node_use_openssl=="true"', {
'defines': [ 'HAVE_OPENSSL=1' ],
'sources': [ 'src/node_crypto.cc', 'src/node_crypto_bio.cc' ],
'sources': [ 'src/node_crypto.cc' ],
'conditions': [
[ 'node_shared_openssl=="false"', {
'dependencies': [ './deps/openssl/openssl.gyp:openssl' ],
Expand Down
9 changes: 4 additions & 5 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.

#include "node_crypto.h"
#include "node_crypto_bio.h"
#include "node_crypto_groups.h"
#include "v8.h"

Expand Down Expand Up @@ -292,7 +291,7 @@ int SecureContext::NewSessionCallback(SSL* s, SSL_SESSION* sess) {
// Takes a string or buffer and loads it into a BIO.
// Caller responsible for BIO_free-ing the returned object.
static BIO* LoadBIO (Handle<Value> v) {
BIO *bio = BIO_new(NodeBIO::GetMethod());
BIO *bio = BIO_new(BIO_s_mem());
if (!bio) return NULL;

HandleScope scope;
Expand Down Expand Up @@ -545,7 +544,7 @@ Handle<Value> SecureContext::AddRootCerts(const Arguments& args) {
root_cert_store = X509_STORE_new();

for (int i = 0; root_certs[i]; i++) {
BIO *bp = BIO_new(NodeBIO::GetMethod());
BIO *bp = BIO_new(BIO_s_mem());

if (!BIO_write(bp, root_certs[i], strlen(root_certs[i]))) {
BIO_free(bp);
Expand Down Expand Up @@ -1202,8 +1201,8 @@ Handle<Value> Connection::New(const Arguments& args) {
bool is_server = args[1]->BooleanValue();

p->ssl_ = SSL_new(sc->ctx_);
p->bio_read_ = BIO_new(NodeBIO::GetMethod());
p->bio_write_ = BIO_new(NodeBIO::GetMethod());
p->bio_read_ = BIO_new(BIO_s_mem());
p->bio_write_ = BIO_new(BIO_s_mem());

SSL_set_app_data(p->ssl_, p);

Expand Down
321 changes: 0 additions & 321 deletions src/node_crypto_bio.cc

This file was deleted.

Loading

0 comments on commit 0d5595a

Please sign in to comment.