Skip to content

Commit d54b1c5

Browse files
authored
Merge pull request #13 from h2o/master
Aligning with H2O
2 parents b83cae9 + b8020b7 commit d54b1c5

File tree

5 files changed

+388
-289
lines changed

5 files changed

+388
-289
lines changed

include/picotls.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,11 @@ int ptls_hkdf_extract(ptls_hash_algorithm_t *hash, void *output, ptls_iovec_t sa
709709
*
710710
*/
711711
int ptls_hkdf_expand(ptls_hash_algorithm_t *hash, void *output, size_t outlen, ptls_iovec_t prk, ptls_iovec_t info);
712+
/**
713+
*
714+
*/
715+
int ptls_hkdf_expand_label(ptls_hash_algorithm_t *algo, void *output, size_t outlen, ptls_iovec_t secret, const char *label,
716+
ptls_iovec_t hash_value);
712717
/**
713718
* instantiates an AEAD cipher given a secret, which is expanded using hkdf to a set of key and iv
714719
* @param aead

lib/openssl.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@
4141
#include "picotls.h"
4242
#include "picotls/openssl.h"
4343

44-
#define OPENSSL_1_0_API (OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER))
44+
#if (OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER))
45+
#define OPENSSL_1_0_API 1
46+
#else
47+
#define OPENSSL_1_0_API 0
48+
#endif
4549

4650
#if OPENSSL_1_0_API
4751

@@ -901,7 +905,7 @@ int ptls_openssl_encrypt_ticket(ptls_buffer_t *buf, ptls_iovec_t src,
901905
goto Exit;
902906
}
903907
dst += clen;
904-
if (!EVP_EncryptFinal(cctx, dst, &clen)) {
908+
if (!EVP_EncryptFinal_ex(cctx, dst, &clen)) {
905909
ret = PTLS_ERROR_LIBRARY;
906910
goto Exit;
907911
}
@@ -980,7 +984,7 @@ int ptls_openssl_decrypt_ticket(ptls_buffer_t *buf, ptls_iovec_t src,
980984
goto Exit;
981985
}
982986
buf->off += clen;
983-
if (!EVP_DecryptFinal(cctx, buf->base + buf->off, &clen)) {
987+
if (!EVP_DecryptFinal_ex(cctx, buf->base + buf->off, &clen)) {
984988
ret = PTLS_ERROR_LIBRARY;
985989
goto Exit;
986990
}

0 commit comments

Comments
 (0)