Comments (8)
Indeed. The native interface has not updated for a while. Pushed a fix: 84b4934
from ruby-gpgme.
Wow, cool, that was fast, thanks a lot!
from ruby-gpgme.
Unfortunately when trying to use it, I always end up with gpgme_op_decrypt_result': NULL pointer given (ArgumentError)
. The code works fine without the GPGME::gpgme_op_decrypt_result(ctx)
call.
Here's what I'm trying to use:
options = {}
plain_data = GPGME::Data.new(options[:output])
cipher_data = GPGME::Data.new(encrypted)
rctx = []
err = GPGME::gpgme_new(rctx)
exc = GPGME::error_to_exception(err)
raise exc if exc
ctx = rctx[0]
err = GPGME::gpgme_op_decrypt_verify(ctx, cipher_data, plain_data)
exc = GPGME::error_to_exception(err)
raise exc if exc
GPGME::gpgme_op_decrypt_result(ctx)
GPGME::gpgme_release(ctx)
plain_data.seek(0)
decrypted_val = plain_data.read
from ruby-gpgme.
Well, the code works here. Could you provide the complete error message? By the way, a simpler test case can be something like:
require 'gpgme'
ctx = GPGME::Ctx.new
cipher = GPGME::Data.new(ARGF)
ctx.decrypt(cipher)
p ctx.decrypt_result
and you will get:
$ ruby decrypt.rb test.txt.gpg
#<GPGME::DecryptResult:0x0000000186bbd0 @wrong_key_usage=0, @recipients=[#<GPGME::Recipient:0x0000000186bb58 @pubkey_algo=1, @keyid="50AD4600C8C530D6", @status=0>], @file_name="test.txt">
from ruby-gpgme.
I've tried on different machine, and very same code seems to work fine (both machines are OS X Mavericks, with ruby 2.0.0p247, used same way to create & install gem). I'll try to find out more what's the issue when I'll get back home to the other machine.
from ruby-gpgme.
hey, I've added tests for this (and missing attr_readers):
https://github.com/ueno/ruby-gpgme/blob/master/test/ctx_test.rb#L44
and they seems to be ok on travis:
https://travis-ci.org/ueno/ruby-gpgme
Closing this for now. If you find anything more, please reopen.
from ruby-gpgme.
Thanks, I wasn't able to reliably reproduce this. It's somehow related to the version of compiler used to build the native extension, but as ruby & gcc weren't consistent across my machines, I've simply fixed this by rebuilding the gem using gcc48 provided by homebrew and I wasn't able to reproduce same error again since.
from ruby-gpgme.
Hello
I can reliably reproduce this on OSX, Ubuntu, Debian, and Travis I've added a failing test on my fork to demonstrate the behaviour.
See : https://travis-ci.org/davout/ruby-gpgme/jobs/45167445
from ruby-gpgme.
Related Issues (20)
- how to set "personal-compress-preferences": 'ZIP' HOT 2
- Cannot allocate memory Error
- Building v2.0.20 fails on ubuntu 21.10 HOT 4
- How to get ID / email after import? HOT 1
- Nokigiri 1.12.5 compatibility HOT 3
- How do I set compression method as a ZIP by default? HOT 1
- GPGME performance issue, running too slow
- Ruby 3.2 warning: undefining the allocator of T_DATA class GPGME::Ctx
- Tests failing with multiple NoMethodError HOT 2
- The mini_portile2 required version blocks updating if 2.8.0 is installed HOT 1
- Possible to update `mini_portile2` dependency? HOT 1
- v2.0.22 ignores `pkg-config` failures and creates a shared library that cannot load symbols
- GPGME::Error::NoData when using Heroku
- Build failure with Clang 16 (`-Wincompatible-function-pointer-types`) HOT 2
- Exporting private key returns a public key
- the config.guess in libassuan-2.5.5.tar.bz2 is too old,and it cannot guess build type HOT 3
- Build error with Alpine >= 3.18.0 and musl >= 1.2.4 HOT 2
- new release? HOT 2
- Current warnings
- [macOS] Build with bundled libs fails with GCC due to unsupported flags HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ruby-gpgme.