guardtime 0.0.4 → 0.0.5
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.
- data/ext/guardtime.c +6 -6
- data/test/importantdata.txt +1 -0
- data/test/importantdata.txt.gtts +0 -0
- data/test/tc_guardtime.rb +2 -2
- metadata +7 -7
- data/test/cat.gif +0 -0
- data/test/cat.gif.gtts +0 -0
data/ext/guardtime.c
CHANGED
@@ -270,7 +270,7 @@ guardtime_sign(int argc, VALUE *argv, VALUE obj)
|
|
270
270
|
Data_Get_Struct(obj, GuardTimeData, gt);
|
271
271
|
res = GTHTTP_createTimestampHash(&dh, gt->signeruri, &ts);
|
272
272
|
if (res != GT_OK)
|
273
|
-
rb_raise(rb_eRuntimeError, "%s",
|
273
|
+
rb_raise(rb_eRuntimeError, "%s", GTHTTP_getErrorString(res));
|
274
274
|
|
275
275
|
res = GTTimestamp_getDEREncoded(ts, &data, &data_length);
|
276
276
|
if (res != GT_OK)
|
@@ -315,7 +315,7 @@ guardtime_extend(VALUE obj, VALUE in)
|
|
315
315
|
res = GTHTTP_extendTimestamp(ts, gt->verifieruri, &ts2);
|
316
316
|
GTTimestamp_free(ts);
|
317
317
|
if (res != GT_OK)
|
318
|
-
rb_raise(rb_eRuntimeError, "%s",
|
318
|
+
rb_raise(rb_eRuntimeError, "%s", GTHTTP_getErrorString(res));
|
319
319
|
|
320
320
|
res = GTTimestamp_getDEREncoded(ts2, &data, &data_length);
|
321
321
|
if (res != GT_OK)
|
@@ -373,7 +373,7 @@ static void loadpubs(VALUE self)
|
|
373
373
|
rb_raise(rb_eArgError, "'loadpubs' parameter must be either 'auto', 'once', 'no', or 'always'");
|
374
374
|
|
375
375
|
if (res != GT_OK)
|
376
|
-
rb_raise(rb_eRuntimeError, "Error downloading/validating publishing data: %s",
|
376
|
+
rb_raise(rb_eRuntimeError, "Error downloading/validating publishing data: %s", GTHTTP_getErrorString(res));
|
377
377
|
}
|
378
378
|
|
379
379
|
static VALUE
|
@@ -515,7 +515,7 @@ guardtime_verify(int argc, VALUE *argv, VALUE obj)
|
|
515
515
|
|
516
516
|
if (res != GT_OK) {
|
517
517
|
GTTimestamp_free(ts);
|
518
|
-
rb_raise(rb_eRuntimeError, "%s",
|
518
|
+
rb_raise(rb_eRuntimeError, "%s", GTHTTP_getErrorString(res));
|
519
519
|
}
|
520
520
|
|
521
521
|
#define RBNILSTR(n, i) \
|
@@ -787,9 +787,9 @@ void Init_guardtime()
|
|
787
787
|
res = GT_init();
|
788
788
|
if (res != GT_OK)
|
789
789
|
rb_raise(rb_eRuntimeError, "%s", GT_getErrorString(res));
|
790
|
-
res = GTHTTP_init("ruby api 0.0.
|
790
|
+
res = GTHTTP_init("ruby api 0.0.5", 1);
|
791
791
|
if (res != GT_OK)
|
792
|
-
rb_raise(rb_eRuntimeError, "%s",
|
792
|
+
rb_raise(rb_eRuntimeError, "%s", GTHTTP_getErrorString(res));
|
793
793
|
|
794
794
|
rb_cGuardTime = rb_define_class("GuardTime", rb_cObject);
|
795
795
|
rb_define_alloc_func(rb_cGuardTime, guardtime_allocate);
|
@@ -0,0 +1 @@
|
|
1
|
+
This is a test data file.
|
Binary file
|
data/test/tc_guardtime.rb
CHANGED
@@ -5,7 +5,7 @@ require 'test/unit'
|
|
5
5
|
class TestGuardTime < Test::Unit::TestCase
|
6
6
|
|
7
7
|
def test_old
|
8
|
-
ts = File.open( File.dirname(__FILE__) + File::SEPARATOR + '
|
8
|
+
ts = File.open( File.dirname(__FILE__) + File::SEPARATOR + 'importantdata.txt.gtts', 'rb' ) do |f|
|
9
9
|
f.read
|
10
10
|
end
|
11
11
|
gt3 = GuardTime.new
|
@@ -26,7 +26,7 @@ class TestGuardTime < Test::Unit::TestCase
|
|
26
26
|
r[:verification_errors] == GuardTime::NO_FAILURES
|
27
27
|
end
|
28
28
|
end
|
29
|
-
h3 = Digest::SHA2.new << File.read(File.dirname(__FILE__) + File::SEPARATOR + '
|
29
|
+
h3 = Digest::SHA2.new << File.read(File.dirname(__FILE__) + File::SEPARATOR + 'importantdata.txt')
|
30
30
|
assert( gt3.verify(ts, h3) )
|
31
31
|
assert( gt3.verify(ts, h3) do |r|
|
32
32
|
assert_equal( GuardTime::PUBLICATION_CHECKED | GuardTime::PUBLICATION_REFERENCE_PRESENT |
|
metadata
CHANGED
@@ -5,22 +5,22 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 5
|
9
|
+
version: 0.0.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
|
-
-
|
12
|
+
- Guardtime AS
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2013-
|
17
|
+
date: 2013-10-02 00:00:00 +03:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|
21
21
|
description: |
|
22
22
|
Keyless Signatures are a combination of hash function based server-side signatures and hash-linking based digital timestamping delivered using a distributed and hierarchical infrastructure.
|
23
|
-
This extension provides high-level API to access KSI.
|
23
|
+
This extension provides high-level API to access the KSI.
|
24
24
|
|
25
25
|
email: info@guardtime.com
|
26
26
|
executables: []
|
@@ -36,8 +36,8 @@ files:
|
|
36
36
|
- ChangeLog
|
37
37
|
- ext/guardtime.c
|
38
38
|
- ext/extconf.rb
|
39
|
-
- test/
|
40
|
-
- test/
|
39
|
+
- test/importantdata.txt
|
40
|
+
- test/importantdata.txt.gtts
|
41
41
|
- test/tc_guardtime.rb
|
42
42
|
has_rdoc: true
|
43
43
|
homepage: https://github.com/ristik/ruby-guardtime
|
data/test/cat.gif
DELETED
Binary file
|
data/test/cat.gif.gtts
DELETED
Binary file
|