checking constraints
authorVolker Birk <vb@pep-project.org>
Sun, 29 May 2016 14:13:53 +0200
changeset 69167c247f1da64
parent 690 3ae86b68fdfe
child 692 6f7f1b7627bc
checking constraints
src/pEpEngine.h
src/sync_actions.c
     1.1 --- a/src/pEpEngine.h	Sun May 29 12:21:50 2016 +0200
     1.2 +++ b/src/pEpEngine.h	Sun May 29 14:13:53 2016 +0200
     1.3 @@ -68,7 +68,8 @@
     1.4      PEP_PHRASE_NOT_FOUND                            = 0x0701,
     1.5  
     1.6      PEP_SEND_FUNCTION_NOT_REGISTERED                = 0x0801,
     1.7 -    PEP_CANNOT_ENCODE                               = 0x0802,
     1.8 +    PEP_CONTRAINTS_VIOLATED                         = 0x0802,
     1.9 +    PEP_CANNOT_ENCODE                               = 0x0803,
    1.10  
    1.11      PEP_COMMIT_FAILED                               = 0xff01,
    1.12  
     2.1 --- a/src/sync_actions.c	Sun May 29 12:21:50 2016 +0200
     2.2 +++ b/src/sync_actions.c	Sun May 29 14:13:53 2016 +0200
     2.3 @@ -64,6 +64,11 @@
     2.4      if (Identity_from_Struct(me, &msg->me) == NULL)
     2.5          goto enomem;
     2.6  
     2.7 +    if (asn_check_constraints(&asn_DEF_HandshakeRequest, msg, NULL, NULL)) {
     2.8 +        status = PEP_CONTRAINTS_VIOLATED;
     2.9 +        goto error;
    2.10 +    }
    2.11 +
    2.12      ssize_t size = uper_encode_to_new_buffer(&asn_DEF_HandshakeRequest,
    2.13              NULL, msg, (void **) &payload);
    2.14      if (size == -1) {