Skip to content

Commit

Permalink
main/nodejs: fix crypto hash error handling
Browse files Browse the repository at this point in the history
fixes #4999

Upstream regression. Cherry-pick fix from
nodejs/node#4221

(cherry picked from commit 351bd62)
  • Loading branch information
fabled committed Jan 15, 2016
1 parent 1861641 commit 30beca0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
14 changes: 9 additions & 5 deletions main/nodejs/APKBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
# Maintainer: Eivind Uggedal <[email protected]>
pkgname=nodejs
pkgver=4.2.4
pkgrel=0
pkgrel=1
pkgdesc='Evented I/O for V8 javascript'
url='http://nodejs.org/'
arch='all'
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() {
Expand Down Expand Up @@ -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"
14 changes: 14 additions & 0 deletions main/nodejs/issue-4221.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
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;

0 comments on commit 30beca0

Please sign in to comment.