rnp 1.0.5 → 1.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ebe16f6b1b161add02098e6bdb70f5401026a0cb31c695c44943d3432b0a1e85
4
- data.tar.gz: 10a352991a433807dcd8484931bfc3d6745c86202d23d22b1cc8aa09dd9e848a
3
+ metadata.gz: ee45589cbb06b8850960bc6450e11bbd268aba93943a47483e8d4fb65c211273
4
+ data.tar.gz: 3de5947adc06bcbf90ceb86e8f2bb63dc7497e3661dce87b25fedade394066fd
5
5
  SHA512:
6
- metadata.gz: f5bace27a94afc5fa1c39e25e4c52f020ff3256279f420bf9f0e56010799e10200202afaaebb4fec054e7c7f327e09eac0a10212c08ef4acf0c0251c589873db
7
- data.tar.gz: 9cbdb7ec9bc7f6db9ee0ad237fc66b37aae56712aff023cee2c508b502ccec86027867e39dd8e6b134160a94178c56b0e244f9cfdfbae67434c7f075b15ad5cd
6
+ metadata.gz: b93e326b7b56eeec4c57e35c564896611e833dfe2695e02426d4b4a8aa75213d38f49beaf749c24c5114232ace19fe1d6a71c9f885d79c3463ea32dc7e9f0d13
7
+ data.tar.gz: 316e9dc83694d289f3f9ecb9b231241bef3ce05e574377859d2250398e832ef32b501646bf8571af6205622f1e3faf633dc715ada6bbd66c64edf0892b95149a
data/CHANGELOG.adoc CHANGED
@@ -1,5 +1,14 @@
1
1
  == Changelog
2
2
 
3
+ === 1.1.0 [19-07-2026]
4
+ * Support librnp 0.17.x/0.18.x; CI tests against v0.18.1
5
+ (CVE-2025-13470) and the rnp main branch
6
+ * Add Rnp::Signature#errors and Rnp::Op::Verify::Signature#handle
7
+ bindings for rnp_signature_error_count()/rnp_signature_error_at()
8
+ (librnp 0.18.0)
9
+ * Modernize CI (Ruby 3.1-3.4, current actions) and development
10
+ dependencies
11
+
3
12
  === 1.0.5 [20-03-2023]
4
13
  * Rub GHA tests for Ruby 2.7, 3.0, 3.1, 3.2, head
5
14
  and different rnp versions
data/README.adoc CHANGED
@@ -1,16 +1,21 @@
1
1
  = Ruby RNP bindings
2
2
 
3
- image:https://github.com/rnpgp/ruby-rnp/actions/workflows/tests.yml/badge.svg["Build Status", link="https://github.com/rnpgp/ruby-rnp/actions/workflows/tests.yml"]
4
- image:https://codecov.io/github/rnpgp/ruby-rnp/coverage.svg["Code Coverage", link="https://codecov.io/github/rnpgp/ruby-rnp?branch=master"]
3
+ image:https://github.com/rnpgp/ruby-rnp/actions/workflows/test-and-release.yml/badge.svg["Build Status", link="https://github.com/rnpgp/ruby-rnp/actions/workflows/test-and-release.yml"]
4
+ image:https://codecov.io/gh/rnpgp/ruby-rnp/branch/main/graph/badge.svg["Code Coverage", link="https://codecov.io/gh/rnpgp/ruby-rnp"]
5
5
 
6
6
  The `rnp` gem provides Ruby bindings to the
7
7
  https://github.com/rnpgp/rnp[librnp OpenPGP library].
8
8
 
9
- Documentation is available on https://www.rubydoc.info/github/rnpgp/ruby-rnp/master/[RubyDoc].
9
+ Documentation is available on https://www.rubydoc.info/github/rnpgp/ruby-rnp/main/[RubyDoc].
10
10
 
11
11
  == Requirements
12
12
 
13
- This gem currently requires https://github.com/rnpgp/rnp[librnp] 0.10.0 or newer.
13
+ This gem currently requires https://github.com/rnpgp/rnp[librnp] 0.15.2 or newer.
14
+
15
+ NOTE: librnp 0.18.1 or newer is strongly recommended: librnp 0.18.0 is
16
+ affected by https://open.ribose.com/advisories/ra-2025-11-20/[CVE-2025-13470],
17
+ where PKESK session keys were generated without cryptographically random
18
+ values (older releases are not affected).
14
19
 
15
20
  == Installation
16
21
 
@@ -109,6 +109,9 @@ module LibRnp
109
109
  rnp_signature_packet_to_json: [%i[pointer uint32 pointer], :uint32],
110
110
  rnp_signature_handle_destroy: [%i[pointer], :uint32],
111
111
  rnp_op_verify_signature_get_handle: [%i[pointer pointer], :uint32],
112
+ # signature validation errors
113
+ rnp_signature_error_count: [%i[pointer pointer], :uint32],
114
+ rnp_signature_error_at: [%i[pointer size_t pointer], :uint32],
112
115
  # key uids
113
116
  rnp_key_get_uid_handle_at: [%i[pointer size_t pointer], :uint32],
114
117
  rnp_uid_is_revoked: [%i[pointer pointer], :uint32],
data/lib/rnp/op/verify.rb CHANGED
@@ -83,6 +83,8 @@ class Rnp
83
83
 
84
84
  # @api private
85
85
  def initialize(ptr)
86
+ @ptr = ptr
87
+
86
88
  # status
87
89
  @status = LibRnp.rnp_op_verify_signature_get_status(ptr)
88
90
  pptr = FFI::MemoryPointer.new(:pointer)
@@ -133,6 +135,17 @@ class Rnp
133
135
  def expired?
134
136
  @status == LibRnp::RNP_ERROR_SIGNATURE_EXPIRED
135
137
  end
138
+
139
+ # Get the full signature handle, providing access to extended
140
+ # information (verification errors, JSON dump, etc).
141
+ #
142
+ # @see Rnp::Signature
143
+ # @return [Rnp::Signature]
144
+ def handle
145
+ pptr = FFI::MemoryPointer.new(:pointer)
146
+ Rnp.call_ffi(:rnp_op_verify_signature_get_handle, @ptr, pptr)
147
+ Rnp::Signature.new(pptr.read_pointer)
148
+ end
136
149
  end
137
150
 
138
151
  private
data/lib/rnp/signature.rb CHANGED
@@ -90,6 +90,23 @@ class Rnp
90
90
  end
91
91
  end
92
92
 
93
+ # Verification errors recorded for this signature.
94
+ #
95
+ # @note Requires librnp 0.18.0 or newer.
96
+ #
97
+ # @return [Array<Integer>] a list of error codes (rnp_result_t values)
98
+ # describing why the signature failed verification. An empty array
99
+ # means no errors were recorded.
100
+ def errors
101
+ pcount = FFI::MemoryPointer.new(:size_t)
102
+ Rnp.call_ffi(:rnp_signature_error_count, @ptr, pcount)
103
+ perror = FFI::MemoryPointer.new(:uint32)
104
+ (0...pcount.read(:size_t)).map do |idx|
105
+ Rnp.call_ffi(:rnp_signature_error_at, @ptr, idx, perror)
106
+ perror.read(:uint32)
107
+ end
108
+ end
109
+
93
110
  private
94
111
 
95
112
  def string_property(func)
data/lib/rnp/version.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  # (c) 2018-2023 Ribose Inc.
4
4
 
5
5
  class Rnp
6
- VERSION = "1.0.5"
6
+ VERSION = "1.1.0"
7
7
  end # class
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rnp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-03-25 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: asciidoctor
@@ -30,124 +29,112 @@ dependencies:
30
29
  requirements:
31
30
  - - ">="
32
31
  - !ruby/object:Gem::Version
33
- version: '1.14'
34
- - - "<"
35
- - !ruby/object:Gem::Version
36
- version: '3'
32
+ version: '2'
37
33
  type: :development
38
34
  prerelease: false
39
35
  version_requirements: !ruby/object:Gem::Requirement
40
36
  requirements:
41
37
  - - ">="
42
38
  - !ruby/object:Gem::Version
43
- version: '1.14'
44
- - - "<"
45
- - !ruby/object:Gem::Version
46
- version: '3'
39
+ version: '2'
47
40
  - !ruby/object:Gem::Dependency
48
- name: codecov
41
+ name: rake
49
42
  requirement: !ruby/object:Gem::Requirement
50
43
  requirements:
51
44
  - - "~>"
52
45
  - !ruby/object:Gem::Version
53
- version: '0.1'
46
+ version: '13.0'
54
47
  type: :development
55
48
  prerelease: false
56
49
  version_requirements: !ruby/object:Gem::Requirement
57
50
  requirements:
58
51
  - - "~>"
59
52
  - !ruby/object:Gem::Version
60
- version: '0.1'
53
+ version: '13.0'
61
54
  - !ruby/object:Gem::Dependency
62
- name: rake
55
+ name: redcarpet
63
56
  requirement: !ruby/object:Gem::Requirement
64
57
  requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- version: '10'
68
- - - "<"
58
+ - - "~>"
69
59
  - !ruby/object:Gem::Version
70
- version: '14'
60
+ version: '3.6'
71
61
  type: :development
72
62
  prerelease: false
73
63
  version_requirements: !ruby/object:Gem::Requirement
74
64
  requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- version: '10'
78
- - - "<"
65
+ - - "~>"
79
66
  - !ruby/object:Gem::Version
80
- version: '14'
67
+ version: '3.6'
81
68
  - !ruby/object:Gem::Dependency
82
- name: redcarpet
69
+ name: rspec
83
70
  requirement: !ruby/object:Gem::Requirement
84
71
  requirements:
85
72
  - - "~>"
86
73
  - !ruby/object:Gem::Version
87
- version: '3.4'
74
+ version: '3.13'
88
75
  type: :development
89
76
  prerelease: false
90
77
  version_requirements: !ruby/object:Gem::Requirement
91
78
  requirements:
92
79
  - - "~>"
93
80
  - !ruby/object:Gem::Version
94
- version: '3.4'
81
+ version: '3.13'
95
82
  - !ruby/object:Gem::Dependency
96
- name: rspec
83
+ name: rubocop
97
84
  requirement: !ruby/object:Gem::Requirement
98
85
  requirements:
99
86
  - - "~>"
100
87
  - !ruby/object:Gem::Version
101
- version: '3.5'
88
+ version: 0.75.0
102
89
  type: :development
103
90
  prerelease: false
104
91
  version_requirements: !ruby/object:Gem::Requirement
105
92
  requirements:
106
93
  - - "~>"
107
94
  - !ruby/object:Gem::Version
108
- version: '3.5'
95
+ version: 0.75.0
109
96
  - !ruby/object:Gem::Dependency
110
- name: rubocop
97
+ name: simplecov
111
98
  requirement: !ruby/object:Gem::Requirement
112
99
  requirements:
113
100
  - - "~>"
114
101
  - !ruby/object:Gem::Version
115
- version: 0.75.0
102
+ version: '0.22'
116
103
  type: :development
117
104
  prerelease: false
118
105
  version_requirements: !ruby/object:Gem::Requirement
119
106
  requirements:
120
107
  - - "~>"
121
108
  - !ruby/object:Gem::Version
122
- version: 0.75.0
109
+ version: '0.22'
123
110
  - !ruby/object:Gem::Dependency
124
- name: simplecov
111
+ name: simplecov-json
125
112
  requirement: !ruby/object:Gem::Requirement
126
113
  requirements:
127
114
  - - "~>"
128
115
  - !ruby/object:Gem::Version
129
- version: '0.14'
116
+ version: '0.2'
130
117
  type: :development
131
118
  prerelease: false
132
119
  version_requirements: !ruby/object:Gem::Requirement
133
120
  requirements:
134
121
  - - "~>"
135
122
  - !ruby/object:Gem::Version
136
- version: '0.14'
123
+ version: '0.2'
137
124
  - !ruby/object:Gem::Dependency
138
125
  name: yard
139
126
  requirement: !ruby/object:Gem::Requirement
140
127
  requirements:
141
128
  - - "~>"
142
129
  - !ruby/object:Gem::Version
143
- version: 0.9.12
130
+ version: '0.9'
144
131
  type: :development
145
132
  prerelease: false
146
133
  version_requirements: !ruby/object:Gem::Requirement
147
134
  requirements:
148
135
  - - "~>"
149
136
  - !ruby/object:Gem::Version
150
- version: 0.9.12
137
+ version: '0.9'
151
138
  - !ruby/object:Gem::Dependency
152
139
  name: ffi
153
140
  requirement: !ruby/object:Gem::Requirement
@@ -168,9 +155,9 @@ email:
168
155
  executables: []
169
156
  extensions: []
170
157
  extra_rdoc_files:
171
- - README.adoc
172
158
  - CHANGELOG.adoc
173
159
  - LICENSE.txt
160
+ - README.adoc
174
161
  files:
175
162
  - CHANGELOG.adoc
176
163
  - LICENSE.txt
@@ -196,7 +183,6 @@ licenses:
196
183
  - MIT
197
184
  metadata:
198
185
  yard.run: yard
199
- post_install_message:
200
186
  rdoc_options: []
201
187
  require_paths:
202
188
  - lib
@@ -211,8 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
211
197
  - !ruby/object:Gem::Version
212
198
  version: '0'
213
199
  requirements: []
214
- rubygems_version: 3.4.6
215
- signing_key:
200
+ rubygems_version: 3.6.9
216
201
  specification_version: 4
217
202
  summary: Ruby bindings for the rnp OpenPGP library
218
203
  test_files: []