Skip to content

Commit

Permalink
Added TLS_REEXPORTABLE
Browse files Browse the repository at this point in the history
Making possible to re-export imported TLS context
  • Loading branch information
eduardsui authored Dec 12, 2017
1 parent 6f5e5d8 commit b55a5dd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tlse.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
Copyright (c) 2016, Eduard Suica
Copyright (c) 2016-2017, Eduard Suica
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -7850,7 +7850,11 @@ struct TLSContext *tls_import_context(unsigned char *buffer, unsigned int buf_le
TLS_IMPORT_CHECK_SIZE(buf_pos, key_lengths, buf_len)
memcpy(temp, &buffer[buf_pos], key_lengths);
buf_pos += key_lengths;

#ifdef TLS_REEXPORTABLE
context->exportable_keys = (unsigned char *)TLS_MALLOC(key_lengths);
memcpy(context->exportable_keys, temp, key_lengths);
context->exportable_size = key_lengths;
#endif
int is_aead = __private_tls_is_aead(context);
#ifdef TLS_WITH_CHACHA20_POLY1305
if (is_aead == 2) {
Expand Down

0 comments on commit b55a5dd

Please sign in to comment.