Commit ebda39a2 authored by David Benjamin's avatar David Benjamin Committed by Daniel Bevenius
Browse files

crypto: fix malloc mixing in X509ToObject

EC_KEY_key2buf returns an OPENSSL_malloc'd pointer so it shouldn't be
passed into Buffer::New, which expect a libc malloc'd pointer. Instead,
factor out the ECDH::GetPublicKey code which uses EC_POINT_point2oct.

This preserves the existing behavior where encoding failures are
silently ignored, but it is probably safe to CHECK fail them instead.

PR-URL: https://github.com/nodejs/node/pull/25717


Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
parent 793c6307
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment