Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@geofft
geofft / Makefile
Last active February 9, 2018 02:59
all: uvsysc.so
uvsysc.so: uvsysc.c
$(CC) -fPIC -shared -o $@ $< -ldl
clean:
rm uvsysc.so
.PHONY: clean
#include <linux/seccomp.h>
#include <linux/filter.h>
#include <linux/audit.h>
#include <sys/prctl.h>
#include <asm/unistd.h>
#include <stddef.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
@geofft
geofft / Makefile
Last active September 18, 2015 19:05
LD_PRELOAD + RTLD_LOCAL
all: intermediate.so preload.so main
intermediate.so: intermediate.c
cc -o $@ -fPIC -shared $< -lgnutls
preload.so: preload.c
cc -o $@ -fPIC -shared $< -ldl
main: main.c
cc -o $@ $< -ldl
@geofft
geofft / a.rs
Last active September 2, 2015 23:00
#[no_mangle] is unsafe
extern crate b;
extern crate c;
fn main() {
println!("{} {}", b::identity(), c::identity());
}
@geofft
geofft / eggman.rs
Last active August 29, 2015 14:21
Rust-ABI calls across dynamic libraries
#![crate_type="dylib"]
#[no_mangle]
pub fn foo(x: std::fmt::Arguments) -> i32 {
println!("{:?}", x);
3
}
@geofft
geofft / main.rs
Last active August 29, 2015 14:20 — forked from alexcrichton/main.rs
#![allow(unused_must_use)]
//extern crate debug;
extern crate syntax;
extern crate rustc;
extern crate rustc_driver;
extern crate rustc_typeck;
extern crate rustc_resolve;
//extern crate collections;
(e)geofft@cactuar:~/src/ssl/cryptography$ git diff
diff --git a/tests/hazmat/primitives/test_asym_utils.py b/tests/hazmat/primitives/test_asym_utils.py
index c3fbedf..e4fd4f2 100644
--- a/tests/hazmat/primitives/test_asym_utils.py
+++ b/tests/hazmat/primitives/test_asym_utils.py
@@ -68,3 +68,11 @@ def test_decode_rfc6979_invalid_asn1():
# This is the BER "end-of-contents octets," which pyasn1 is
# wrongly willing to return from top-level DER decoding.
decode_rfc6979_signature(b"\x00\x00")
+
@geofft
geofft / write.c
Last active August 29, 2015 14:15
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/ip.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void
handler(int signal)