gpgme 2.0.26 → 2.0.27
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/gpgme/extconf.rb +2 -2
- data/lib/gpgme/io_callbacks.rb +4 -6
- data/lib/gpgme/version.rb +1 -1
- data/ports/archives/gpgme-2.3.1.tar.bz2 +0 -0
- data/test/io_callbacks_test.rb +28 -9
- metadata +7 -4
- data/ports/archives/gpgme-2.0.0.tar.bz2 +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '093297484bc11143d4e8975436edf17204eeb030977cd8d2574c1c243d3e5141'
|
|
4
|
+
data.tar.gz: 40eace30d5728a62fc95ca9f2f5d573cf300fc41c3fcf130e2bfd361dbb1b0f3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d819decb7dcfb09954abadedb48c05d6930b8581d8dc6cd4ba1fffbec8e732289b8765918eedd8c0881e0ef2875f465de7df24824b3f210585458fda8f3f3650
|
|
7
|
+
data.tar.gz: b69af5dccc9e681a0d6c931ee1f6ab3e94a686457c73cd772c6b5d08bf70753fb6f585c57895275d0ad640040a7eacac0f1ab066a1a6c345d2424c11c80d45a5
|
data/ext/gpgme/extconf.rb
CHANGED
|
@@ -116,11 +116,11 @@ EOS
|
|
|
116
116
|
# if PKG_CONFIG_PATH is not set properly.
|
|
117
117
|
ENV["PKG_CONFIG_PATH"] = [*pkg_config_paths, ENV["PKG_CONFIG_PATH"]].compact.join(File::PATH_SEPARATOR)
|
|
118
118
|
|
|
119
|
-
gpgme_recipe = MiniPortile.new('gpgme', '2.
|
|
119
|
+
gpgme_recipe = MiniPortile.new('gpgme', '2.3.1').tap do |recipe|
|
|
120
120
|
recipe.target = File.join(ROOT, "ports")
|
|
121
121
|
recipe.files = [{
|
|
122
122
|
:url => "https://www.gnupg.org/ftp/gcrypt/#{recipe.name}/#{recipe.name}-#{recipe.version}.tar.bz2",
|
|
123
|
-
:sha256 => '
|
|
123
|
+
:sha256 => '2bf94e0e677e5a8fc31f79dd323f91c5416b36fb851058bc1e8bce39f2642434'
|
|
124
124
|
}]
|
|
125
125
|
recipe.configure_options = [
|
|
126
126
|
'--disable-shared',
|
data/lib/gpgme/io_callbacks.rb
CHANGED
|
@@ -9,12 +9,10 @@ module GPGME
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def write(hook, buffer, length)
|
|
12
|
-
data
|
|
13
|
-
#
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
end
|
|
17
|
-
@io.write(data)
|
|
12
|
+
# GPGME output can be arbitrary binary data (for example, an OpenPGP
|
|
13
|
+
# message). Do not transcode it to the IO's encoding: conversion can
|
|
14
|
+
# replace invalid byte sequences and corrupt the output.
|
|
15
|
+
@io.write(buffer.byteslice(0, length))
|
|
18
16
|
end
|
|
19
17
|
|
|
20
18
|
def seek(hook, offset, whence)
|
data/lib/gpgme/version.rb
CHANGED
|
Binary file
|
data/test/io_callbacks_test.rb
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
|
2
2
|
require 'test_helper'
|
|
3
3
|
require 'stringio'
|
|
4
|
+
require 'tempfile'
|
|
4
5
|
|
|
5
6
|
describe GPGME::IOCallbacks do
|
|
6
7
|
describe "encoding handling" do
|
|
@@ -43,21 +44,16 @@ describe GPGME::IOCallbacks do
|
|
|
43
44
|
assert_equal "Hello World", io.read
|
|
44
45
|
end
|
|
45
46
|
|
|
46
|
-
it "
|
|
47
|
+
it "preserves invalid UTF-8 bytes when writing to a binary IO" do
|
|
47
48
|
io = StringIO.new
|
|
48
|
-
io.set_encoding(Encoding::
|
|
49
|
+
io.set_encoding(Encoding::ASCII_8BIT)
|
|
49
50
|
callbacks = GPGME::IOCallbacks.new(io)
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
invalid_data = "Hello\xC3\x28World".b
|
|
52
|
+
invalid_data = "Hello\xC3\x28World".dup.force_encoding(Encoding::UTF_8)
|
|
53
53
|
|
|
54
|
-
# Should not raise, should replace invalid chars
|
|
55
54
|
callbacks.write(nil, invalid_data, invalid_data.bytesize)
|
|
56
55
|
io.rewind
|
|
57
|
-
|
|
58
|
-
# The invalid sequence should be replaced
|
|
59
|
-
refute_nil result
|
|
60
|
-
assert result.valid_encoding?
|
|
56
|
+
assert_equal invalid_data.bytes, io.read.bytes
|
|
61
57
|
end
|
|
62
58
|
|
|
63
59
|
it "reads data from IO" do
|
|
@@ -133,6 +129,29 @@ describe GPGME::IOCallbacks do
|
|
|
133
129
|
result.force_encoding(Encoding::UTF_8)
|
|
134
130
|
assert_equal utf8_text, result
|
|
135
131
|
end
|
|
132
|
+
|
|
133
|
+
it "preserves encrypted output when default internal encoding is UTF-8" do
|
|
134
|
+
original_internal = Encoding.default_internal
|
|
135
|
+
output = Tempfile.new('gpgme-ciphertext')
|
|
136
|
+
output.binmode
|
|
137
|
+
plaintext = 'encryption output must remain binary-safe'
|
|
138
|
+
|
|
139
|
+
begin
|
|
140
|
+
Encoding.default_internal = Encoding::UTF_8
|
|
141
|
+
|
|
142
|
+
crypto = GPGME::Crypto.new(always_trust: true)
|
|
143
|
+
crypto.encrypt(plaintext, recipients: KEYS.first[:sha], output: output)
|
|
144
|
+
output.close
|
|
145
|
+
|
|
146
|
+
ciphertext = File.binread(output.path)
|
|
147
|
+
refute_empty ciphertext
|
|
148
|
+
assert_equal 0x80, ciphertext.getbyte(0) & 0x80
|
|
149
|
+
ensure
|
|
150
|
+
output.close unless output.closed?
|
|
151
|
+
output.unlink
|
|
152
|
+
Encoding.default_internal = original_internal
|
|
153
|
+
end
|
|
154
|
+
end
|
|
136
155
|
end
|
|
137
156
|
|
|
138
157
|
describe "default internal encoding support" do
|
metadata
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gpgme
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.27
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daiki Ueno
|
|
8
8
|
- Albert Llop
|
|
9
|
+
autorequire:
|
|
9
10
|
bindir: bin
|
|
10
11
|
cert_chain: []
|
|
11
|
-
date:
|
|
12
|
+
date: 2026-11-23 00:00:00.000000000 Z
|
|
12
13
|
dependencies:
|
|
13
14
|
- !ruby/object:Gem::Dependency
|
|
14
15
|
name: mini_portile2
|
|
@@ -130,7 +131,7 @@ files:
|
|
|
130
131
|
- lib/gpgme/sub_key.rb
|
|
131
132
|
- lib/gpgme/user_id.rb
|
|
132
133
|
- lib/gpgme/version.rb
|
|
133
|
-
- ports/archives/gpgme-2.
|
|
134
|
+
- ports/archives/gpgme-2.3.1.tar.bz2
|
|
134
135
|
- ports/archives/libassuan-3.0.2.tar.bz2
|
|
135
136
|
- ports/archives/libgpg-error-1.55.tar.bz2
|
|
136
137
|
- test/crypto_test.rb
|
|
@@ -152,6 +153,7 @@ homepage: http://github.com/ueno/ruby-gpgme
|
|
|
152
153
|
licenses:
|
|
153
154
|
- LGPL-2.1+
|
|
154
155
|
metadata: {}
|
|
156
|
+
post_install_message:
|
|
155
157
|
rdoc_options: []
|
|
156
158
|
require_paths:
|
|
157
159
|
- lib
|
|
@@ -167,7 +169,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
167
169
|
- !ruby/object:Gem::Version
|
|
168
170
|
version: '0'
|
|
169
171
|
requirements: []
|
|
170
|
-
rubygems_version: 3.
|
|
172
|
+
rubygems_version: 3.0.3.1
|
|
173
|
+
signing_key:
|
|
171
174
|
specification_version: 4
|
|
172
175
|
summary: Ruby binding of GPGME.
|
|
173
176
|
test_files: []
|
|
Binary file
|