Skip to content

Instantly share code, notes, and snippets.

@viktorium
viktorium / ruby-openssl-fix.diff
Created Jan 12, 2015
Ruby OpenSSL RSA sign patch
View ruby-openssl-fix.diff
diff --git ext/openssl/ossl_pkey.c ext/openssl/ossl_pkey.c
index f785e66..2384676 100644
--- ext/openssl/ossl_pkey.c
+++ ext/openssl/ossl_pkey.c
@@ -237,6 +237,7 @@ ossl_pkey_sign(VALUE self, VALUE digest, VALUE data)
EVP_MD_CTX ctx;
unsigned int buf_len;
VALUE str;
+ int result;
@viktorium
viktorium / gist:f032cdc8906f43dac94e
Created Jan 12, 2015
Ruby OpenSSL RSA sign leak
View gist:f032cdc8906f43dac94e
require 'openssl'
require 'base64'
PKEY =<<-EOS
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA6Q/xPIBPqiPawrdEO3WCRMTaKrnu29ulFDoFbjbMRhgT1aWG
vOIVP6vFfxCN0zJKuQFhxuxRAlM1mNcM38wc7m0P+6qvrEsI2SOGbUh/ozZnRuPP
hLm0tnBySmaLVVgktW8cQ0smILeL2u+n2ZyNs5F1G8VSNyGTdRsoyYs8I9Bi04Dy
2iS0g5a0ZuKGtbP/fn1/Z1gNV3aLjFKkYj7Dwyc67RTkRpcsW4MXrl7LUmV9YDNB
S/ro7YvhlwxeVZ8u54gB3Gz9g1os+YZ6ZMiQo8jgFXJP7gbJgyXHxh7mVzUmUrbU
You can’t perform that action at this time.