Skip to content

Instantly share code, notes, and snippets.

View public's full-sized avatar
🏠
Working from home

Alex Stapleton public

🏠
Working from home
View GitHub Profile
@public
public / gist:8999387
Last active August 29, 2015 13:56
X509 verification errors in OpenSSL
# IN 0.9.8y
static const int X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT;
static const int X509_V_ERR_UNABLE_TO_GET_CRL;
static const int X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE;
static const int X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE;
static const int X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY;
static const int X509_V_ERR_CERT_SIGNATURE_FAILURE;
static const int X509_V_ERR_CRL_SIGNATURE_FAILURE;
static const int X509_V_ERR_CERT_NOT_YET_VALID;
import pytest
print
print "VERSION", pytest.__version__
print "CONFIG --assert", pytest.config.getoption("--assert")
"""
=============================================================================== test session starts ===============================================================================
platform linux2 -- Python 2.7.5 -- pytest-2.5.1
plugins: xdist
CDEF = """
typedef ... ENGINE;
typedef ... ENGINE_CIPHERS_PTR;
int ENGINE_set_ciphers(ENGINE *, ENGINE_CIPHERS_PTR);
"""
f = cffi.FFI()
f.cdef(CDEF)
lib = f.verify("""
import pytest
import os
@pytest.fixture(scope="session")
def wut(request):
return repr(os.urandom(16))
def test_a(wut):
print wut
import os
from testmachine import TestMachine
from testmachine.common import basic_operations
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
machine = TestMachine()
@public
public / botan_idea_vectors
Created January 3, 2014 12:50
SHA256 62c70d7d38039fb66494e4e3e2616fec82df49618a0aaf3babbf9c27795b6c9a Created from https://gist.github.com/public/8237388/d6b92640d762b4bc29ac264388ddcb07f3315b83 using Botan HEAD 760e5268716c90692e4ceb37f6908d4ce98d3c51 on Ubuntu 13.10 x64.
COUNT = 0
KEY = 085b8af6788fa6bc1a0b47dcf50fbd35
IV = 58cb2b12bb52c6f1
PLAINTEXT = 4b5a872260293312eea1a570fd39c788
CIPHERTEXT = 5d9c48bf7dc115f28e153dc93dfcff96
COUNT = 1
KEY = 701ccc4c0e36e512ce077f5af6ccb957
IV = 5337ddeaf89a00dd
@public
public / botan_idea_vectors.py
Created January 3, 2014 12:48
SHA256 a8c806bfdbd6a30f21e42847caa5899426db5325a369ea4e429f0c7223224ac8
import binascii
import botan
BLOCK_SIZE = 64
def encrypt(key, iv, plaintext):
encryptor = botan.Cipher("IDEA/CFB", "encrypt",
binascii.unhexlify(key))
Index: openssl-0.9.8m/Configure
===================================================================
--- openssl-0.9.8m.orig/Configure 2010-02-27 12:28:32.000000000 +0100
+++ openssl-0.9.8m/Configure 2010-02-27 12:28:35.000000000 +0100
@@ -1512,6 +1512,8 @@
}
}
+$shared_ldflag .= " -Wl,--version-script=openssl.ld";
+
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEAmQmC6PkTnQmc/p/PsmJD7MUw2mREHemYDRF2a96W8bFmqxBIy6k8pwJCJHCYSqItQcRcEZxd/mpz7pFEvpcjSS8h09FZUmkgQ01r0KPfa2FiS0g7NxGzosaIm7etL9xtWnMB67zc9H/5C5Ch/NSxe3aosiSesATJi8M01MOJNTDpMG4IsUbZybRrFjWw8D3/ZYBk1rArvpQccJsixoNRDEw823j/CsjT4luC2r/GKkZtqXRANuTbzmEGFwMGhRGX+lowD4irZhmn948FrfNGZSwQ+MZ2/BMwALEe/SxFa2Rh/va8OEqKKeTwrR20r4z6Zt68qCeCS1NfsOMi8oJJgAowuM63da5aGn4UDHNmc55VjhVXD5+o8OO+io5188aszjKx/mI/fmthkoMaQf1boYtTp9ozf51RC1WELbfcHcrjIiDQb1tgNNtucwN2IYXcTgaJPGnOIsKwHLl1W/QeUPa1yd5Da7Vgdih0ttRN+BRnIQT8/ZxwJ/aLrS8v/6rZGM/+S+hxHbJl/Oj419OTaXvKZ1B17wSCSaA5RtYlb1P9Ukf6z/vs/Ow6u1g9mbYzsJ07EEX1TQLCpsDonSorhP5Nsko58sxR3AhkcmyrOmaKoQBQ/ZOh6tpr9WLk3B6VTroHwedBsm9zFEXKAVS0mOutYBFFtN0/FDU7R1SL+1c= [email protected]
OPENSSL_0.9.8 {
global:
*;
};