Skip to content

Commit

Permalink
fix building with MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
U-LiZHOU-PC\Li ZHOU committed Apr 21, 2017
1 parent 5eeb507 commit d8adb5e
Show file tree
Hide file tree
Showing 5 changed files with 4,310 additions and 12 deletions.
4,304 changes: 4,304 additions & 0 deletions OpenSSL_1_1_0/makefile

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/cipher-openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ void cipher_encrypt(conn* c, size_t * encryptl,
const char * plain, size_t plainl)
#endif
{
uint8_t * dst;
int outl;
ASSERT( plain == c->t.buf);
// pr_info("%s %lu", __FUNCTION__, plainl);
// cipher_t * cipher = shadow->cipher;
// unsigned char * encrypt = 0;

uint8_t * dst;
int outl;
// if (!cipher.encrypt.init) {
if (c->request_length)
{
Expand Down
5 changes: 1 addition & 4 deletions src/cipher-wolfssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,12 +395,9 @@ void cipher_decrypt(conn *c, ULONG * plainl, const char * encrypt, size_t encryp
void cipher_decrypt(conn *c, size_t * plainl, const char * encrypt, size_t encryptl)
#endif
{
uint8_t * src;
ASSERT(encrypt == c->t.buf);
//pr_info("%s %u %lu", __FUNCTION__, __LINE__,encryptl);


uint8_t * src;

//if (!cipher.decrypt.init) {
//if (!c->init) {

Expand Down
7 changes: 2 additions & 5 deletions src/cipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,19 @@ void cipher_encrypt(conn* c, size_t * encryptl,
const unsigned char * plain, size_t plainl)
#endif
{

uint8_t *dst;
ASSERT( plain == c->t.buf);
// pr_info("%s %lu", __FUNCTION__, plainl);
// cipher_t * cipher = shadow->cipher;
//unsigned char * encrypt = 0;

// uint8_t * plainptr;
uint8_t *dst;
// int l;
// if (!cipher.encrypt.init) {
if (c->request_length)
{

// int ivl;
size_t prepend;
char * true_key = malloc(MD5_DIGEST_LENGTH);
//#if defined (_MSC_VER)
// uint8_t * src, * ptr;
//#else
Expand All @@ -120,7 +118,6 @@ void cipher_encrypt(conn* c, size_t * encryptl,
memcpy(cipher.encrypt.iv + sizeof (d1), &d2, sizeof (d2));
#endif
#endif
char *true_key = malloc(MD5_DIGEST_LENGTH);
create_key(cipher.encrypt.iv, cipher.ivl,true_key);
arcfour_setkey(&cipher.encrypt.ctx, true_key, cipher.keyl);
free(true_key);
Expand Down
2 changes: 1 addition & 1 deletion src/client.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* * File: client.h
* * Author: lzhou
* *
Expand Down

0 comments on commit d8adb5e

Please sign in to comment.