!2 deprecate md4 function due to nodejs and openssl updated

From: @wang--ge 
Reviewed-by: @lyn1001 
Signed-off-by: @lyn1001
This commit is contained in:
openeuler-ci-bot 2023-02-10 08:46:13 +00:00 committed by Gitee
commit c4eba69749
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 64 additions and 1 deletions

View File

@ -0,0 +1,58 @@
From 5f9eb49ab02822c3f8dd9012b41dd74ec1e2cb17 Mon Sep 17 00:00:00 2001
From: wang--ge <wang__ge@126.com>
Date: Fri, 10 Feb 2023 14:50:01 +0800
Subject: [PATCH] deprecated md4 function
---
test/test.js | 35 -----------------------------------
1 file changed, 35 deletions(-)
diff --git a/test/test.js b/test/test.js
index 4c99a4d..51c40bc 100644
--- a/test/test.js
+++ b/test/test.js
@@ -33,41 +33,6 @@ describe('hash_file module', function(){
fs.unlink(filePath, done)
})
- describe('md4', function() {
- it('should generate a md4 hash without error', function(done){
- console.time('md4')
- hash_file(filePath, 'md4', function(err, hash) {
- console.timeEnd('md4')
- assert.ok(!err, err)
- assert.ok(hash)
- assert.equal(32, hash.length)
- done()
- })
- })
- it('should generate the same md4 hash multiple times for the same file', function(done) {
- hash_file(filePath, 'md4', function(err, hash_first) {
- assert.ok(!err, err)
- hash_file(filePath, 'md4', function(err, hash_second) {
- assert.ok(!err, err)
- assert.equal(hash_first, hash_second)
- done()
- })
- })
- })
- it('should generate a different hash for a modified file', function(done) {
- hash_file(filePath, 'md4', function(err, hash_first) {
- assert.ok(!err, err)
- fs.writeFile(filePath, 'md4 data', function(err) {
- assert.ok(!err, err)
- hash_file(filePath, 'md4', function(err, hash_second) {
- assert.ok(!err, err)
- assert.notEqual(hash_first, hash_second)
- done()
- })
- })
- })
- })
- })
describe('md5', function() {
it('should generate a md5 hash without error', function(done){
console.time('md5')
--
2.27.0

View File

@ -2,11 +2,12 @@
%global srcname hash_file
Name: nodejs-%{srcname}
Version: 0.1.1
Release: 1
Release: 2
Summary: A simple utility for getting a hash of a file
License: MIT
URL: https://github.com/timoxley/hash_file
Source0: https://registry.npmjs.org/%{srcname}/-/%{srcname}-%{version}.tgz
Patch1: deprecated-md4-function.patch
BuildArch: noarch
ExclusiveArch: %{nodejs_arches} noarch
BuildRequires: nodejs-packaging
@ -18,6 +19,7 @@ BuildRequires: npm(mocha)
%prep
%setup -q -n package
%patch1 -p1
rm -rf node_modules/
%build
@ -38,5 +40,8 @@ mocha -t 60000 ./test/test.js
%{nodejs_sitelib}/%{srcname}
%changelog
* Fri Feb 10 2023 Ge Wang <wangge20@h-partners.com> - 0.1.1-2
- Deprected md4 function due to openssl updated to verson 3.0.8
* Thu Aug 20 2020 wangxiao <wangxiao65@huawei.com> - 0.1.1-1
- Package init