-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
112 additions
and
29 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
#ifndef _INCLUDEOBFSOBFS_H | ||
#define _INCLUDEOBFSOBFS_H | ||
|
||
#include "obfs/auth.c" | ||
#include "obfs/tls1.2_ticket.c" | ||
#include "obfs/verify.c" | ||
#include "obfs/http_simple.c" | ||
#include "obfs/obfsutil.c" | ||
#include "obfs/base64.c" | ||
#include "obfs/crc32.c" | ||
#include "obfs/obfs.c" | ||
|
||
#endif // _INCLUDEOBFSOBFS_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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,10 @@ | |
* Copyright (C) 2015 - 2016, Break Wa11 <[email protected]> | ||
*/ | ||
|
||
#ifndef _AUTH_H | ||
#define _AUTH_H | ||
#ifndef _OBFS_AUTH_H | ||
#define _OBFS_AUTH_H | ||
|
||
struct obfs; | ||
|
||
void * auth_simple_init_data(); | ||
obfs * auth_simple_new_obfs(); | ||
|
@@ -27,4 +29,4 @@ int auth_sha1_v4_client_post_decrypt(obfs *self, char **pplaindata, int dataleng | |
int auth_aes128_sha1_client_pre_encrypt(obfs *self, char **pplaindata, int datalength, size_t* capacity); | ||
int auth_aes128_sha1_client_post_decrypt(obfs *self, char **pplaindata, int datalength, size_t* capacity); | ||
|
||
#endif // _AUTH_H | ||
#endif // _OBFS_AUTH_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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef _OBFS_CRC32_H | ||
#define _OBFS_CRC32_H | ||
|
||
void init_crc32_table(void); | ||
|
||
uint32_t crc32(unsigned char *buffer, unsigned int size); | ||
|
||
void fillcrc32to(unsigned char *buffer, unsigned int size, unsigned char *outbuffer); | ||
|
||
void fillcrc32(unsigned char *buffer, unsigned int size); | ||
|
||
void adler32_short(unsigned char *buffer, unsigned int size, uint32_t *a, uint32_t *b); | ||
|
||
uint32_t adler32(unsigned char *buffer, unsigned int size); | ||
|
||
void filladler32(unsigned char *buffer, unsigned int size); | ||
|
||
int checkadler32(unsigned char *buffer, unsigned int size); | ||
|
||
#endif // _OBFS_CRC32_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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,10 @@ | |
* Copyright (C) 2015 - 2016, Break Wa11 <[email protected]> | ||
*/ | ||
|
||
#ifndef _HTTP_SIMPLE_H | ||
#define _HTTP_SIMPLE_H | ||
#ifndef _OBFS_HTTP_SIMPLE_H | ||
#define _OBFS_HTTP_SIMPLE_H | ||
|
||
struct obfs; | ||
|
||
obfs * http_simple_new_obfs(); | ||
void http_simple_dispose(obfs *self); | ||
|
@@ -15,4 +17,4 @@ int http_simple_client_decode(obfs *self, char **pencryptdata, int datalength, s | |
|
||
int http_post_client_encode(obfs *self, char **pencryptdata, int datalength, size_t* capacity); | ||
|
||
#endif // _HTTP_SIMPLE_H | ||
#endif // _OBFS_HTTP_SIMPLE_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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,12 +4,14 @@ | |
* Copyright (C) 2015 - 2016, Break Wa11 <[email protected]> | ||
*/ | ||
|
||
#ifndef _OBFS_H | ||
#define _OBFS_H | ||
#ifndef _OBFS_OBFS_H | ||
#define _OBFS_OBFS_H | ||
|
||
#include <stdint.h> | ||
#include <unistd.h> | ||
|
||
#define OBFS_HMAC_SHA1_LEN 10 | ||
|
||
typedef struct server_info { | ||
char host[64]; | ||
uint16_t port; | ||
|
@@ -72,4 +74,4 @@ void get_server_info(obfs *self, server_info *server); | |
obfs * new_obfs(); | ||
void dispose_obfs(obfs *self); | ||
|
||
#endif // _OBFS_H | ||
#endif // _OBFS_OBFS_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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifndef _OBFS_OBFSUTIL_H | ||
#define _OBFS_OBFSUTIL_H | ||
|
||
int get_head_size(char *plaindata, int size, int def_size); | ||
|
||
void init_shift128plus(void); | ||
|
||
uint64_t xorshift128plus(void); | ||
|
||
#endif // _OBFS_OBFSUTIL_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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
/* | ||
* http_simple.h - Define shadowsocksR server's buffers and callbacks | ||
* tls1.2_ticket.h - Define shadowsocksR server's buffers and callbacks | ||
* | ||
* Copyright (C) 2015 - 2016, Break Wa11 <[email protected]> | ||
* Copyright (C) 2015 - 2017, Break Wa11 <[email protected]> | ||
*/ | ||
|
||
#ifndef _TLS1_2_TICKET_H | ||
#define _TLS1_2_TICKET_H | ||
#ifndef _OBFS_TLS1_2_TICKET_H | ||
#define _OBFS_TLS1_2_TICKET_H | ||
|
||
struct obfs; | ||
|
||
void * tls12_ticket_auth_init_data(); | ||
obfs * tls12_ticket_auth_new_obfs(); | ||
|
@@ -14,4 +16,4 @@ void tls12_ticket_auth_dispose(obfs *self); | |
int tls12_ticket_auth_client_encode(obfs *self, char **pencryptdata, int datalength, size_t* capacity); | ||
int tls12_ticket_auth_client_decode(obfs *self, char **pencryptdata, int datalength, size_t* capacity, int *needsendback); | ||
|
||
#endif // _TLS1_2_TICKET_H | ||
#endif // _OBFS_TLS1_2_TICKET_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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,13 +4,15 @@ | |
* Copyright (C) 2015 - 2016, Break Wa11 <[email protected]> | ||
*/ | ||
|
||
#ifndef _VERIFY_H | ||
#define _VERIFY_H | ||
#ifndef _OBFS_VERIFY_H | ||
#define _OBFS_VERIFY_H | ||
|
||
struct obfs; | ||
|
||
obfs * verify_simple_new_obfs(); | ||
void verify_simple_dispose(obfs *self); | ||
|
||
int verify_simple_client_pre_encrypt(obfs *self, char **pplaindata, int datalength, size_t* capacity); | ||
int verify_simple_client_post_decrypt(obfs *self, char **pplaindata, int datalength, size_t* capacity); | ||
|
||
#endif // _VERIFY_H | ||
#endif // _OBFS_VERIFY_H |