This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdint.h> | |
#include <sys/ioctl.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <fcntl.h> | |
#include <errno.h> | |
#include <dirent.h> | |
#include <linux/input.h> | |
#include <event.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, hashlib | |
for line in file(sys.argv[2]): | |
if hashlib.md5(line.rstrip()).hexdigest() == sys.argv[1]: print line, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (s->servername_done == 0) { | |
switch (servname_type) { | |
case TLSEXT_NAMETYPE_host_name: | |
if (s->session->tlsext_hostname == NULL) { | |
if (len > TLSEXT_MAXLEN_host_name || | |
((s->session->tlsext_hostname = OPENSSL_malloc(len + 1)) == NULL)) { | |
*al = TLS1_AD_UNRECOGNIZED_NAME; | |
return 0; | |
} | |
memcpy(s->session->tlsext_hostname, sdata, len); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pthread_mutex_t *thread_locks; | |
unsigned long | |
openssl_thread_id(void) { | |
return (unsigned long) pthread_self(); | |
} | |
void | |
openssl_thread_lock( int mode, int lock_id, const char* file, int line ) { | |
if ( mode & CRYPTO_LOCK ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int ssl3_get_client_hello(SSL *s) { | |
/* bunch of crap here */ | |
/* remember, ssl_get_prev_session properly locks s->session */ | |
i = ssl_get_prev_session(s, p, j, d + n); | |
if (i == 1) { /* previous session */ | |
s->hit=1; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# determines number of proccessors, splits a large file into sizes that | |
# can be consumed by n-1 sort processes (where n is the number of processors) | |
# | |
# After the file has been split up properly, it will run a sort on each split | |
# file in parallel. Once all processes have completed, a merge sort is executed. | |
# | |
# mthomas@n2o:~/words [100%] $ du -h big | |
# 1.7G big |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdint.h> | |
#include <errno.h> | |
#include <time.h> | |
#include <inttypes.h> | |
enum evhttp_cmd_type { | |
EVHTTP_REQ_GET = 1 << 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* usage: openssl s_client -connect localhost:8081 -sess_out outfile -ssl3 */ | |
/* ab -I outfile ... */ | |
--- support/ab.c 2010-07-12 05:26:29.000000000 -0400 | |
+++ support/ab.c 2011-06-21 15:29:21.961972191 -0400 | |
@@ -340,6 +340,7 @@ | |
char *ssl_cipher = NULL; | |
char *ssl_info = NULL; | |
BIO *bio_out,*bio_err; | |
+char * sess_in = NULL; | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdint.h> | |
#include <errno.h> | |
#include <time.h> | |
#include <event.h> | |
static void | |
test_evbuffers(int iter) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdint.h> | |
#include <errno.h> | |
#include <event.h> | |
struct _targs { | |
struct bufferevent ** pair; | |
struct event * ev; |