Skip to content

Instantly share code, notes, and snippets.

@dirkx
dirkx / gist:636f0ed0efa790806116f2f10bd701bd
Created July 19, 2023 14:30
quick hack to let asterisk deal with wild cards and still verify
#ifdef DO_SSL
static int check_tcptls_cert_name(ASN1_STRING *cert_str, const char *hostname, const char *desc)
{
unsigned char *str; char *dot;
int ret;
ret = ASN1_STRING_to_UTF8(&str, cert_str);
if (ret < 0 || !str) {
return -1;
}
/* Copyright © 2020 Dirk-Willem van Gulik. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@dirkx
dirkx / test.c
Last active April 9, 2020 10:31
attempt at C version
#include <stdio.h>
#include <unistd.h>
#include <strings.h>
#include <openssl/sha.h>
#include <openssl/err.h>
#include <openssl/rand.h>
#include <openssl/hmac.h>
#include <openssl/aes.h>
@dirkx
dirkx / test.c
Created April 8, 2020 19:30
attempt at C version
#include <stdio.h>
#include <unistd.h>
#include <strings.h>
#include <openssl/sha.h>
#include <openssl/err.h>
#include <openssl/rand.h>
#include <openssl/hmac.h>
#include <openssl/aes.h>
@dirkx
dirkx / default.nix
Created December 31, 2019 08:23
updated example - more in line with other tests
# Note -- this assumes bash - not the bourne shell.
#
import ../nixpkgs-test/nixos/tests/make-test-python.nix ({ pkgs, ... }:
let
tsWebRoot = "/data/http/ts";
in
{
name = "redwax";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ dirkx ];
@dirkx
dirkx / gist:6f45aa59b565a899c344
Created June 3, 2015 11:53
Hersey font (san serif) as move/draws.
// GenerateTurtle[45857:8179967] Hersey lib: Hershey
// Glyph < > (0x20, 32)
// Glyph <!> (0x21, 33)
MoveTo(0.000000,12.000000);
DrawTo(0.000000,-2.000000);
DrawTo(1.000000,-2.000000);
MoveTo(0.000000,12.000000);
DrawTo(1.000000,12.000000);
@dirkx
dirkx / gist:37c29dc5a82b6deb0bf0
Last active August 29, 2015 14:21
arbitrary length string comparisons with rudimentary protection against timing.
/* Copyright 2012,2015 Dirk-Willem van Gulik <dirkx(at)webweaving.org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,

Keybase proof

I hereby claim:

  • I am dirkx on github.
  • I am dirkx (https://keybase.io/dirkx) on keybase.
  • I have a public key whose fingerprint is 997C 3C06 E3B2 4CA4 74D5 642F FD6F 88C6 21D0 A71B

To claim this, I am signing this object: