Commit 351bd62f authored by Timo Teräs's avatar Timo Teräs

main/nodejs: fix crypto hash error handling

fixes #4999

Upstream regression. Cherry-pick fix from
https://github.com/nodejs/node/issues/4221
parent faf85ab2
......@@ -2,7 +2,7 @@
# Maintainer: Eivind Uggedal <eivind@uggedal.com>
pkgname=nodejs
pkgver=4.2.4
pkgrel=0
pkgrel=1
pkgdesc='Evented I/O for V8 javascript'
url='http://nodejs.org/'
arch='all'
......@@ -10,7 +10,8 @@ license='MIT'
makedepends="$depends_dev python openssl-dev zlib-dev libuv-dev
linux-headers paxmark"
subpackages="$pkgname-dev $pkgname-doc"
source="http://nodejs.org/dist/v$pkgver/node-v$pkgver.tar.gz"
source="http://nodejs.org/dist/v$pkgver/node-v$pkgver.tar.gz
issue-4221.patch"
_builddir="$srcdir"/node-v$pkgver
prepare() {
......@@ -48,6 +49,9 @@ package() {
done
}
md5sums="86e4d0d8b626f6e60ca7bef02f2543d2 node-v4.2.4.tar.gz"
sha256sums="4ee244ffede7328d9fa24c3024787e71225b7abaac49fe2b30e68b27460c10ec node-v4.2.4.tar.gz"
sha512sums="78f216e8d8a3d7af4b75e091a6c1426073e1d089a67a19bbc71a4494f5a2f22275dfc68fd7341c3d60971c37098f3455e243486289c15b69b8e74537c7da1fa0 node-v4.2.4.tar.gz"
md5sums="86e4d0d8b626f6e60ca7bef02f2543d2 node-v4.2.4.tar.gz
d5e343fc9d1da1718ec15280b290b4a1 issue-4221.patch"
sha256sums="4ee244ffede7328d9fa24c3024787e71225b7abaac49fe2b30e68b27460c10ec node-v4.2.4.tar.gz
4e241e38c96629a4d96b19c99bd9c82da86a766aa53a08f4b1bb3d90a7ec7eee issue-4221.patch"
sha512sums="78f216e8d8a3d7af4b75e091a6c1426073e1d089a67a19bbc71a4494f5a2f22275dfc68fd7341c3d60971c37098f3455e243486289c15b69b8e74537c7da1fa0 node-v4.2.4.tar.gz
36f91895bb339e0e386b4c2da9bca7eb5051083761ff66a61483fcc76b75e76b5e1a405e56ab4b39e53e3ee47d9cac5b7d949c42c1e7d919ee279fe8505dc58e issue-4221.patch"
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index 63d767a..1b4cc1a 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -3556,8 +3556,7 @@ bool Hash::HashInit(const char* hash_type) {
if (md_ == nullptr)
return false;
EVP_MD_CTX_init(&mdctx_);
- EVP_DigestInit_ex(&mdctx_, md_, nullptr);
- if (0 != ERR_peek_error()) {
+ if (EVP_DigestInit_ex(&mdctx_, md_, nullptr) <= 0) {
return false;
}
initialised_ = true;
Markdown is supported
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