Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/eckey.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ NAN_GETTER(ECKey::GetPublicKey) {
ECKey *eckey = ObjectWrap::Unwrap<ECKey>(args.Holder());
const EC_GROUP *group = EC_KEY_get0_group(eckey->mKey);
const EC_POINT *point = EC_KEY_get0_public_key(eckey->mKey);
unsigned int nReq = EC_POINT_point2oct(group, point, POINT_CONVERSION_COMPRESSED, NULL, 0, NULL);
unsigned int nReq = EC_POINT_point2oct(group, point, POINT_CONVERSION_UNCOMPRESSED, NULL, 0, NULL);
if (!nReq) {
return NanThrowError("EC_POINT_point2oct error");
}
unsigned char *buf, *buf2;
buf = buf2 = (unsigned char *)malloc(nReq);
if (EC_POINT_point2oct(group, point, POINT_CONVERSION_COMPRESSED, buf, nReq, NULL) != nReq) {
if (EC_POINT_point2oct(group, point, POINT_CONVERSION_UNCOMPRESSED, buf, nReq, NULL) != nReq) {
return NanThrowError("EC_POINT_point2oct didn't return correct size");
}
}
NanScope();
NanReturnValue(NanNewBufferHandle((char *)buf2, nReq, FreeBufferData, NULL));
}
Expand Down