Skip to content

Commit

Permalink
first version with chacha20-ietf-poly1305 aead, untable
Browse files Browse the repository at this point in the history
  • Loading branch information
Li ZHOU committed Apr 17, 2017
1 parent 75af829 commit 2e4053f
Show file tree
Hide file tree
Showing 10 changed files with 446 additions and 238 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ before_install:
- wget https://github.com/wolfSSL/wolfssl/archive/v3.6.0.tar.gz
- tar fvx v3.6.0.tar.gz
- pushd wolfssl-3.6.0
- ./autogen.sh && ./configure --disable-static --enable-ipv6 --enable-aesgcm --enable-aesccm --enable-aesni --enable-psk --disable-coding --enable-hkdf --enable-poly1305 --enable-camellia --disable-des3 --enable-hc128 --enable-rabbit --enable-chacha --disable-examples --enable-iopool --disable-oldtls --disable-asn --disable-rsa --enable-fastmath --disable-sha --disable-dh --enable-arc4 --disable-hashdrbg --disable-ecc --disable-sha512 && make
- ./autogen.sh && ./configure --disable-static --enable-ipv6 --enable-aesgcm --enable-aesccm --enable-aesni --enable-psk --disable-coding --enable-hkdf --enable-poly1305 --enable-camellia --disable-des3 --enable-hc128 --enable-rabbit --enable-chacha --disable-examples --disable-iopool --disable-oldtls --disable-asn --disable-rsa --enable-fastmath --enable-sha --disable-dh --enable-arc4 --disable-hashdrbg --disable-ecc --disable-sha512 && make
- sudo make install
- popd
- pip install --user cpp-coveralls
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
FROM alpine:3.3
MAINTAINER lzh <[email protected]>

ARG MYSOCKS_URL=https://github.com/zhou0/mysocks/archive/0.4.1.tar.gz
ARG MYSOCKS_URL=https://github.com/zhou0/mysocks/archive/0.4.2.tar.gz
ARG LIBUV_URL=https://github.com/libuv/libuv/archive/v1.11.0.tar.gz
ARG WOLFSSL_URL=https://github.com/wolfSSL/wolfssl/archive/v3.6.0.tar.gz
RUN set -ex && \
Expand All @@ -29,11 +29,11 @@ make install && cd .. && \
--enable-aesccm --enable-aesni --enable-psk --disable-coding \
--enable-hkdf --enable-poly1305 --enable-camellia --disable-des3 \
--enable-hc128 --enable-rabbit --enable-chacha --disable-examples \
--enable-iopool --disable-oldtls --disable-asn --disable-rsa \
--enable-fastmath --disable-sha --disable-dh --enable-arc4 \
--disable-iopool --disable-oldtls --disable-asn --disable-rsa \
--enable-fastmath --enable-sha --disable-dh --enable-arc4 \
--disable-hashdrbg --disable-ecc --disable-sha512 && \
make && make install && cd .. && \
curl -sSL $MYSOCKS_URL | tar xz && cd mysocks-0.4.1 && mkdir -p \
curl -sSL $MYSOCKS_URL | tar xz && cd mysocks-0.4.2 && mkdir -p \
build/release && cd build/release && \
cmake -DCMAKE_BUILD_TYPE=Release ../.. && \
make && make install && \
Expand All @@ -47,4 +47,4 @@ build/release && cd build/release && \
cd ../../.. && \
apk add --no-cache --virtual .run-deps $runDeps && \
apk del .build-deps && \
rm -fr libuv-1.11.0 && rm -fr wolfssl-3.6.0 && rm -fr mysocks-0.4.1
rm -fr libuv-1.11.0 && rm -fr wolfssl-3.6.0 && rm -fr mysocks-0.4.2
7 changes: 4 additions & 3 deletions src/cipher-openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ void initialize_cipher()
}
else
{
cleanup_cipher();
pr_err("%s is not supported.", config.method);
cleanup_cipher();
exit(1);
}
// return cipher;
Expand Down Expand Up @@ -205,6 +205,7 @@ void cipher_encrypt(conn* c, size_t * encryptl,
// dst = (uint8_t *) encrypt;
dst = (uint8_t *)c->process_text;
}
c->process_len = *encryptl;
#if OPENSSL_VERSION_NUMBER < 0x10100000L
EVP_CipherUpdate(&cipher.encrypt.ctx, dst, &outl, c->t.buf, (int) plainl);
#else
Expand Down Expand Up @@ -255,7 +256,7 @@ void cipher_decrypt(conn *c, size_t * plainl, const char * encrypt, size_t encry
memcpy(c->request + c->request_length, encrypt, encryptl);
c->request_length += encryptl;
// c->process_text = 0;
c->cipher_len = 0;
// c->process_len = 0;
return;
}
else
Expand Down Expand Up @@ -314,7 +315,7 @@ void cipher_decrypt(conn *c, size_t * plainl, const char * encrypt, size_t encry
// plain = malloc(*plainl);

}

c->process_len = *plainl;
#if OPENSSL_VERSION_NUMBER < 0x10100000L
EVP_CipherUpdate(&cipher.decrypt.ctx, (uint8_t *)c->process_text , &outl, src, (int) *plainl);
#else
Expand Down
Loading

0 comments on commit 2e4053f

Please sign in to comment.