add version number sync
authorVolker Birk <vb@pep-project.org>
Sat, 14 Dec 2019 00:10:26 +0100
branchsync
changeset 42758e1a09dbad16
parent 4274 04ad08686053
child 4276 10975e6e75c7
add version number
src/key_reset.c
     1.1 --- a/src/key_reset.c	Fri Dec 13 21:13:32 2019 +0100
     1.2 +++ b/src/key_reset.c	Sat Dec 14 00:10:26 2019 +0100
     1.3 @@ -12,6 +12,11 @@
     1.4  #include <string.h>
     1.5  #include <stdlib.h>
     1.6  
     1.7 +// FIXME: these should be taken from sync/Distribution.fsm
     1.8 +
     1.9 +#define KEY_RESET_MAJOR_VERSION 1L
    1.10 +#define KEY_RESET_MINOR_VERSION 0L
    1.11 +
    1.12  PEP_STATUS has_key_reset_been_sent(
    1.13          PEP_SESSION session, 
    1.14          const char* user_id, 
    1.15 @@ -730,6 +735,20 @@
    1.16      dist->present = Distribution_PR_keyreset;
    1.17      dist->choice.keyreset.present = KeyReset_PR_commands;
    1.18  
    1.19 +    long *major = malloc(sizeof(long));
    1.20 +    assert(major);
    1.21 +    if (!major)
    1.22 +        goto enomem;
    1.23 +    *major = KEY_RESET_MAJOR_VERSION;
    1.24 +    dist->choice.keyreset.choice.commands.version.major = major;
    1.25 +
    1.26 +    long *minor = malloc(sizeof(long));
    1.27 +    assert(minor);
    1.28 +    if (!minor)
    1.29 +        goto enomem;
    1.30 +    *minor = KEY_RESET_MINOR_VERSION;
    1.31 +    dist->choice.keyreset.choice.commands.version.minor = minor;
    1.32 +
    1.33      for (const keyreset_command_list *cl = command_list; cl && cl->command; cl = cl->next) {
    1.34          Command_t *c = (Command_t *) calloc(1, sizeof(Command_t));
    1.35          assert(c);