Skip to content

Instantly share code, notes, and snippets.

View hlandau's full-sized avatar

Hugo Landau hlandau

View GitHub Profile
@hlandau
hlandau / ossl.nix
Last active November 7, 2023 14:00
NixOS package for OpenSSL committers
{ config, pkgs, ... }:
let
stdenv = pkgs.stdenv;
URIEncode = pkgs.perlPackages.buildPerlPackage {
pname = "URI-Encode";
version = "1.1.1";
src = pkgs.fetchurl {
url = "mirror://cpan/authors/id/M/MI/MITHUN/URI-Encode-v1.1.1.tar.gz";
sha256 = "0fr410f2hiscm9dv85fwr2hyz1jjb445ady2z6617h0nf17cxfab";
@hlandau
hlandau / Makefile
Created September 10, 2023 10:13
LD_PRELOAD implementation of SSLKEYLOGFILE in OpenSSL
ldkeylog.so: ldkeylog.c
gcc -Wall -shared -fPIC -O3 "$<" -o "$@"
@hlandau
hlandau / pnor-info.py
Last active August 2, 2018 23:02
PNOR info dumping script (dumps partition table of OpenPOWER PNOR firmware images)
#!/usr/bin/env python3
import sys, struct, io
def read_hdr(f):
d = f.read(12*4)
dMagic = d[0:4]
magic, version, size, entrySize, entryCount, blockSize, blockCount, resv0, resv1, resv2, resv3, checksum = struct.unpack('>' + 'I'*12, d)
print('''
PNOR Header
Magic: {magic:#010x} ({dMagic})
@hlandau
hlandau / rough-design.md
Last active April 24, 2016 19:00
Rough design for acmed

This is a rough sketch I've put together in my mind of how an 'ACME daemon' might end up looking.

API

acmetool is designed for batch operation which works well for small use cases but large scale deployments will work better with a daemon. This will probably expose a service via an HTTP API, so that arbitrary parts of a service provider's stack can request certificates.

This API will need to be asynchronous as it may take arbitrarily long for 'acmed'

@hlandau
hlandau / to3597.go
Last active January 24, 2016 18:22
Convert any DNS record to generic RFC3597 syntax
// Reads DNS records in zone file format on stdin and outputs them in generic
// RFC3597 format. This is useful if you need to configure DNS records for a
// nameserver which doesn't support the rrtypes you're trying to configure.
//
// Supports whatever rrtypes that github.com/miekg/dns supports, which tends to
// be pretty exhaustive.
package main
import (
"fmt"