digest 3.1.0.pre3 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/digest/bubblebabble/bubblebabble.c +1 -1
- data/ext/digest/digest.c +6 -6
- data/ext/digest/digest.h +1 -1
- data/ext/digest/digest_conf.rb +1 -1
- data/ext/digest/extconf.rb +4 -0
- data/ext/digest/sha2/sha2.c +1 -1
- data/ext/digest/sha2/sha2init.c +1 -1
- data/lib/digest/version.rb +1 -1
- data/lib/digest.rb +12 -14
- metadata +5 -7
- data/ext/digest/depend +0 -3
- data/ext/digest/install_headers.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 987de45a2894fa80f0d6ff23f3a70a7e813b9529b5ef4130b22be5e4c2f78020
|
4
|
+
data.tar.gz: 7241f2a350845b1478666dfbb0d6662a1b61e41a16e7504b064dd6eca6e3c0b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1f322b8fed96de4cde9b2b8cd2997f99a80998b5b671924cb6f3e3b6b28215c95021f2919ef8a5176823639e56ddb3cd05e2a154c59d9945f4770138ae4d941
|
7
|
+
data.tar.gz: f2a9f6d45f28fe9be2d140d9f99147669f9a0ab32fbeac724254eca036a89a364f222beac6eb3b38def4f395f961dc646a7780344e7eb13eff0759a39b7c6ce7
|
@@ -37,7 +37,7 @@ bubblebabble_str_new(VALUE str_digest)
|
|
37
37
|
digest_len = RSTRING_LEN(str_digest);
|
38
38
|
|
39
39
|
if ((LONG_MAX - 2) / 3 < (digest_len | 1)) {
|
40
|
-
|
40
|
+
rb_raise(rb_eRuntimeError, "digest string too long");
|
41
41
|
}
|
42
42
|
|
43
43
|
str = rb_str_new(0, (digest_len | 1) * 3 + 2);
|
data/ext/digest/digest.c
CHANGED
@@ -154,7 +154,7 @@ static void
|
|
154
154
|
rb_digest_instance_method_unimpl(VALUE self, const char *method)
|
155
155
|
{
|
156
156
|
rb_raise(rb_eRuntimeError, "%s does not implement %s()",
|
157
|
-
|
157
|
+
rb_obj_classname(self), method);
|
158
158
|
}
|
159
159
|
|
160
160
|
/*
|
@@ -383,8 +383,8 @@ rb_digest_instance_equal(VALUE self, VALUE other)
|
|
383
383
|
StringValue(str2);
|
384
384
|
|
385
385
|
if (RSTRING_LEN(str1) == RSTRING_LEN(str2) &&
|
386
|
-
|
387
|
-
|
386
|
+
rb_str_cmp(str1, str2) == 0) {
|
387
|
+
return Qtrue;
|
388
388
|
}
|
389
389
|
return Qfalse;
|
390
390
|
}
|
@@ -602,7 +602,7 @@ static inline void
|
|
602
602
|
algo_init(const rb_digest_metadata_t *algo, void *pctx)
|
603
603
|
{
|
604
604
|
if (algo->init_func(pctx) != 1) {
|
605
|
-
|
605
|
+
rb_raise(rb_eRuntimeError, "Digest initialization failed.");
|
606
606
|
}
|
607
607
|
}
|
608
608
|
|
@@ -614,7 +614,7 @@ rb_digest_base_alloc(VALUE klass)
|
|
614
614
|
void *pctx;
|
615
615
|
|
616
616
|
if (klass == rb_cDigest_Base) {
|
617
|
-
|
617
|
+
rb_raise(rb_eNotImpError, "Digest::Base is an abstract class");
|
618
618
|
}
|
619
619
|
|
620
620
|
algo = get_digest_base_metadata(klass);
|
@@ -639,7 +639,7 @@ rb_digest_base_copy(VALUE copy, VALUE obj)
|
|
639
639
|
|
640
640
|
algo = get_digest_obj_metadata(copy);
|
641
641
|
if (algo != get_digest_obj_metadata(obj))
|
642
|
-
|
642
|
+
rb_raise(rb_eTypeError, "different algorithms");
|
643
643
|
|
644
644
|
TypedData_Get_Struct(obj, void, &digest_type, pctx1);
|
645
645
|
TypedData_Get_Struct(copy, void, &digest_type, pctx2);
|
data/ext/digest/digest.h
CHANGED
@@ -38,7 +38,7 @@ rb_digest_##name##_update(void *ctx, unsigned char *ptr, size_t size) \
|
|
38
38
|
const unsigned int stride = 16384; \
|
39
39
|
\
|
40
40
|
for (; size > stride; size -= stride, ptr += stride) { \
|
41
|
-
|
41
|
+
name##_Update(ctx, ptr, stride); \
|
42
42
|
} \
|
43
43
|
if (size > 0) name##_Update(ctx, ptr, size); \
|
44
44
|
}
|
data/ext/digest/digest_conf.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
def digest_conf(name)
|
4
4
|
unless with_config("bundled-#{name}")
|
5
5
|
cc = with_config("common-digest")
|
6
|
-
if cc
|
6
|
+
if cc != false or /\b#{name}\b/ =~ cc
|
7
7
|
if File.exist?("#$srcdir/#{name}cc.h") and
|
8
8
|
have_header("CommonCrypto/CommonDigest.h")
|
9
9
|
$defs << "-D#{name.upcase}_USE_COMMONDIGEST"
|
data/ext/digest/extconf.rb
CHANGED
data/ext/digest/sha2/sha2.c
CHANGED
@@ -128,7 +128,7 @@ typedef u_int64_t sha2_word64; /* Exactly 8 bytes */
|
|
128
128
|
#define SHA512_SHORT_BLOCK_LENGTH (SHA512_BLOCK_LENGTH - 16)
|
129
129
|
|
130
130
|
|
131
|
-
#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || defined(__GNUC__) || defined(
|
131
|
+
#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || defined(__GNUC__) || defined(__IBMC__)
|
132
132
|
#define ULL(number) number##ULL
|
133
133
|
#else
|
134
134
|
#define ULL(number) (uint64_t)(number)
|
data/ext/digest/sha2/sha2init.c
CHANGED
@@ -47,7 +47,7 @@ Init_sha2(void)
|
|
47
47
|
cDigest_SHA##bitlen = rb_define_class_under(mDigest, "SHA" #bitlen, cDigest_Base); \
|
48
48
|
\
|
49
49
|
rb_ivar_set(cDigest_SHA##bitlen, id_metadata, \
|
50
|
-
|
50
|
+
rb_digest_make_metadata(&sha##bitlen));
|
51
51
|
|
52
52
|
FOREACH_BITLEN(DEFINE_ALGO_CLASS)
|
53
53
|
}
|
data/lib/digest/version.rb
CHANGED
data/lib/digest.rb
CHANGED
@@ -1,25 +1,23 @@
|
|
1
1
|
# frozen_string_literal: false
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
|
13
|
-
|
14
|
-
# %r{/(rubygems/gem_runner|bundler/cli)\.rb}.match?(l.path)
|
15
|
-
# }
|
3
|
+
if defined?(Digest) &&
|
4
|
+
/\A(?:2\.|3\.0\.[0-2]\z)/.match?(RUBY_VERSION) &&
|
5
|
+
caller_locations.any? { |l|
|
6
|
+
%r{/(rubygems/gem_runner|bundler/cli)\.rb}.match?(l.path)
|
7
|
+
}
|
8
|
+
# Before Ruby 3.0.3/3.1.0, the gem and bundle commands used to load
|
9
|
+
# the digest library before loading additionally installed gems, so
|
10
|
+
# you will get constant redefinition warnings and unexpected
|
11
|
+
# implementation overwriting if we proceed here. Avoid that.
|
12
|
+
return
|
13
|
+
end
|
16
14
|
|
17
15
|
require 'digest/version'
|
18
16
|
require 'digest/loader'
|
19
17
|
|
20
18
|
module Digest
|
21
19
|
# A mutex for Digest().
|
22
|
-
REQUIRE_MUTEX
|
20
|
+
REQUIRE_MUTEX = Thread::Mutex.new
|
23
21
|
|
24
22
|
def self.const_missing(name) # :nodoc:
|
25
23
|
case name
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: digest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akinori MUSHA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Provides a framework for message digest libraries.
|
14
14
|
email:
|
@@ -28,12 +28,10 @@ files:
|
|
28
28
|
- ext/digest/bubblebabble/bubblebabble.c
|
29
29
|
- ext/digest/bubblebabble/extconf.rb
|
30
30
|
- ext/digest/defs.h
|
31
|
-
- ext/digest/depend
|
32
31
|
- ext/digest/digest.c
|
33
32
|
- ext/digest/digest.h
|
34
33
|
- ext/digest/digest_conf.rb
|
35
34
|
- ext/digest/extconf.rb
|
36
|
-
- ext/digest/install_headers.rb
|
37
35
|
- ext/digest/lib/digest/loader.rb
|
38
36
|
- ext/digest/lib/digest/sha2/loader.rb
|
39
37
|
- ext/digest/md5/extconf.rb
|
@@ -76,11 +74,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
76
74
|
version: 2.5.0
|
77
75
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
76
|
requirements:
|
79
|
-
- - "
|
77
|
+
- - ">="
|
80
78
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
79
|
+
version: '0'
|
82
80
|
requirements: []
|
83
|
-
rubygems_version: 3.
|
81
|
+
rubygems_version: 3.4.0.dev
|
84
82
|
signing_key:
|
85
83
|
specification_version: 4
|
86
84
|
summary: Provides a framework for message digest libraries.
|
data/ext/digest/depend
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require "fileutils"
|
2
|
-
|
3
|
-
*files, dest = ARGV
|
4
|
-
|
5
|
-
if File.exist?(File.join(dest, "ruby.h"))
|
6
|
-
warn "installing header files"
|
7
|
-
|
8
|
-
files.each { |file|
|
9
|
-
FileUtils.install file, dest, mode: 0644, verbose: true
|
10
|
-
}
|
11
|
-
else
|
12
|
-
warn "not installing header files when installed as an external library"
|
13
|
-
end
|