ENGINE-214: shelving some changes ENGINE-214
authorKrista Bennett <krista@pep-project.org>
Tue, 05 Sep 2017 13:47:36 +0200
branchENGINE-214
changeset 2031b87314b30061
parent 2030 4df2470d9eb2
child 2033 84eefe72aa40
ENGINE-214: shelving some changes
build-config/Linux.conf
src/message_api.c
     1.1 --- a/build-config/Linux.conf	Mon Sep 04 10:08:10 2017 +0200
     1.2 +++ b/build-config/Linux.conf	Tue Sep 05 13:47:36 2017 +0200
     1.3 @@ -7,7 +7,7 @@
     1.4  TARGET=libpEpEngine.so
     1.5  
     1.6  ######### C #########
     1.7 -CC=gcc -std=c99 -pthread -g
     1.8 +CC=gcc -std=c99 -pthread -g -O0
     1.9  CFLAGS=-fPIC -fstrict-aliasing -fdiagnostics-color=always
    1.10  ifdef WARN
    1.11      CFLAGS+= -Wall -pedantic -Wstrict-aliasing=3
    1.12 @@ -17,13 +17,13 @@
    1.13  ifdef DEBUG
    1.14      CFLAGS+= -Og -ggdb -DDEBUG_ERRORSTACK
    1.15  else
    1.16 -    CFLAGS+= -O3 -DNDEBUG
    1.17 +    CFLAGS+= -DNDEBUG
    1.18  endif
    1.19  # The '_DEFAULT_SOURCE' feature test macro is required to suppress the warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" otherwise printed during the compilation of every asn1c-generated C file. It's a glibc specific warning, only present in few versions around ~2.19. See https://lwn.net/Articles/590381/ for a discussion.
    1.20  CFLAGS_GENERATED=-D_DEFAULT_SOURCE
    1.21  
    1.22  ######### C++ #########
    1.23 -CXX=g++ -std=gnu++11 -pthread -g
    1.24 +CXX=g++ -std=gnu++11 -pthread -g -O0
    1.25  CXXFLAGS=-fdiagnostics-color=always -I../src -I../asn.1 $(ETPAN_INC)
    1.26  ifdef WARN
    1.27      CXXFLAGS+=
    1.28 @@ -33,7 +33,7 @@
    1.29  ifdef DEBUG
    1.30      CXXFLAGS+= -Og -ggdb
    1.31  else
    1.32 -    CXXFLAGS+= -O3 -DNDEBUG
    1.33 +    CXXFLAGS+= -DNDEBUG
    1.34  endif
    1.35  
    1.36  ######### C and C++ #########
     2.1 --- a/src/message_api.c	Mon Sep 04 10:08:10 2017 +0200
     2.2 +++ b/src/message_api.c	Tue Sep 05 13:47:36 2017 +0200
     2.3 @@ -424,6 +424,8 @@
     2.4      
     2.5      if (!envelope) {
     2.6          _envelope = extract_minimal_envelope(attachment, PEP_dir_outgoing);
     2.7 +        if (!_envelope)
     2.8 +            return PEP_UNKNOWN_ERROR;
     2.9          envelope = _envelope;
    2.10      }
    2.11      
    2.12 @@ -1376,7 +1378,15 @@
    2.13              _src = src;
    2.14          }
    2.15          else {
    2.16 -            _src = wrap_message_as_attachment(NULL, src);
    2.17 +            // encrypt inner message
    2.18 +            message* inner_message = NULL;
    2.19 +            status = encrypt_message(session, src, extra, &inner_message,
    2.20 +                                     enc_format, flags | PEP_encrypt_flag_dont_raise_headers);                         
    2.21 +            _src = wrap_message_as_attachment(NULL, inner_message);
    2.22 +            if (_src == NULL) {
    2.23 +                status = PEP_UNKNOWN_ERROR;
    2.24 +                goto pep_error;
    2.25 +            }
    2.26              msg = clone_to_empty_message(_src);
    2.27          }
    2.28          if (msg == NULL)