src/message_api.h
author Krista Bennett <krista@pep-project.org>
Thu, 05 Apr 2018 14:13:20 +0200
changeset 2588 858909bcf85b
parent 2477 45e8ed722fec
child 2592 d1cb6fd3ded2
permissions -rw-r--r--
ENGINE-416: added argument for extra key fprs to encrypt_message_for_self and MIME_encrypt_message_for_self
vb@1513
     1
// This file is under GNU General Public License 3.0
vb@1513
     2
// see LICENSE.txt
vb@1513
     3
vb@39
     4
#pragma once
vb@39
     5
vb@102
     6
#include "pEpEngine.h"
vb@102
     7
#include "keymanagement.h"
vb@101
     8
#include "message.h"
vb@259
     9
#include "cryptotech.h"
vb@101
    10
vb@37
    11
#ifdef __cplusplus
vb@37
    12
extern "C" {
vb@37
    13
#endif
vb@37
    14
vb@39
    15
Edouard@734
    16
bool import_attached_keys(
Edouard@728
    17
        PEP_SESSION session, 
Edouard@728
    18
        const message *msg,
Edouard@728
    19
        identity_list **private_idents
Edouard@728
    20
    );
roker@1869
    21
vb@236
    22
void attach_own_key(PEP_SESSION session, message *msg);
roker@1869
    23
vb@258
    24
PEP_cryptotech determine_encryption_format(message *msg);
roker@1869
    25
vb@952
    26
void add_opt_field(message *msg, const char *name, const char *value);
Edouard@736
    27
vb@939
    28
typedef enum _PEP_encrypt_flags {
krista@1639
    29
    // "default" means whatever the default behaviour for the function is.
krista@1639
    30
    PEP_encrypt_flag_default = 0x0,
markus@1633
    31
    PEP_encrypt_flag_force_encryption = 0x1,
markus@1633
    32
markus@1633
    33
    // This flag is for special use cases and should not be used
markus@1633
    34
    // by normal pEp clients!
krista@1640
    35
    PEP_encrypt_flag_force_unsigned = 0x2,
krista@2121
    36
    PEP_encrypt_flag_force_no_attached_key = 0x4,
krista@2121
    37
    
krista@2121
    38
    // This is used for outer messages (used to wrap the real message)
krista@2121
    39
    // This is only used internally and (eventually) by transport functions
krista@2147
    40
    PEP_encrypt_flag_inner_message = 0x8
vb@939
    41
} PEP_encrypt_flags; 
vb@939
    42
vb@939
    43
typedef unsigned int PEP_encrypt_flags_t;
vb@235
    44
roker@1869
    45
vb@39
    46
// encrypt_message() - encrypt message in memory
vb@39
    47
//
vb@39
    48
//  parameters:
vb@48
    49
//      session (in)        session handle
vb@48
    50
//      src (in)            message to encrypt
vb@48
    51
//      extra (in)          extra keys for encryption
vb@2338
    52
//      dst (out)           pointer to new encrypted message or NULL if no
vb@2338
    53
//                          encryption could take place
vb@84
    54
//      enc_format (in)     encrypted format
vb@939
    55
//      flags (in)          flags to set special encryption features
vb@39
    56
//
vb@39
    57
//  return value:
vb@48
    58
//      PEP_STATUS_OK                   on success
edouard@1854
    59
//      PEP_KEY_HAS_AMBIG_NAME          at least one of the receipient keys has
edouard@1854
    60
//                                      an ambiguous name
vb@2338
    61
//      PEP_UNENCRYPTED                 on demand or no recipients with usable
vb@2338
    62
//                                      key, is left unencrypted, and key is
vb@2338
    63
//                                      attached to it
vb@83
    64
//
roker@1869
    65
//  caveat:
roker@1869
    66
//      the ownershop of src remains with the caller
roker@1869
    67
//      the ownership of dst goes to the caller
vb@44
    68
DYNAMIC_API PEP_STATUS encrypt_message(
vb@37
    69
        PEP_SESSION session,
vb@113
    70
        message *src,
vb@37
    71
        stringlist_t *extra,
vb@38
    72
        message **dst,
vb@939
    73
        PEP_enc_format enc_format,
vb@939
    74
        PEP_encrypt_flags_t flags
vb@37
    75
    );
vb@37
    76
roker@1869
    77
krista@1034
    78
// encrypt_message_for_self() - encrypt message in memory for user's identity only,
krista@1034
    79
//                              ignoring recipients and other identities from
krista@1034
    80
//                              the message
krista@994
    81
//  parameters:
krista@994
    82
//      session (in)        session handle
krista@995
    83
//      target_id (in)      self identity this message should be encrypted for
krista@994
    84
//      src (in)            message to encrypt
krista@2588
    85
//      extra (in)          extra keys for encryption
krista@994
    86
//      dst (out)           pointer to new encrypted message or NULL on failure
krista@994
    87
//      enc_format (in)     encrypted format
markus@1634
    88
//      flags (in)          flags to set special encryption features
krista@994
    89
//
krista@994
    90
//  return value:       (FIXME: This may not be correct or complete)
roker@1869
    91
//      PEP_STATUS_OK            on success
roker@1869
    92
//      PEP_KEY_NOT_FOUND        at least one of the receipient keys
roker@1869
    93
//                               could not be found
roker@1869
    94
//      PEP_KEY_HAS_AMBIG_NAME   at least one of the receipient keys has
roker@1869
    95
//                               an ambiguous name
roker@1869
    96
//      PEP_GET_KEY_FAILED       cannot retrieve key
krista@994
    97
//
roker@1869
    98
//  caveat:
roker@1869
    99
//      the ownership of src remains with the caller
krista@994
   100
//      the ownership of target_id remains w/ caller            
roker@1869
   101
//      the ownership of dst goes to the caller
krista@995
   102
//      message is NOT encrypted for identities other than the target_id (and then,
roker@1869
   103
//      only if the target_id refers to self!)
krista@995
   104
DYNAMIC_API PEP_STATUS encrypt_message_for_self(
krista@994
   105
        PEP_SESSION session,
krista@994
   106
        pEp_identity* target_id,
krista@994
   107
        message *src,
krista@2588
   108
        stringlist_t* extra,
krista@994
   109
        message **dst,
markus@1633
   110
        PEP_enc_format enc_format,
markus@1633
   111
        PEP_encrypt_flags_t flags
krista@994
   112
    );
vb@39
   113
roker@1869
   114
krista@1325
   115
// MIME_encrypt_message() - encrypt a MIME message, with MIME output
krista@1325
   116
//
krista@1325
   117
//  parameters:
krista@1325
   118
//      session (in)            session handle
krista@1325
   119
//      mimetext (in)           MIME encoded text to encrypt
krista@1331
   120
//      size (in)               size of input mime text
krista@1325
   121
//      extra (in)              extra keys for encryption
krista@1325
   122
//      mime_ciphertext (out)   encrypted, encoded message
krista@1325
   123
//      enc_format (in)         encrypted format
krista@1325
   124
//      flags (in)              flags to set special encryption features
krista@1325
   125
//
krista@1325
   126
//  return value:
krista@1325
   127
//      PEP_STATUS_OK           if everything worked
krista@1325
   128
//      PEP_BUFFER_TOO_SMALL    if encoded message size is too big to handle
krista@1325
   129
//      PEP_CANNOT_CREATE_TEMP_FILE
krista@1325
   130
//                              if there are issues with temp files; in
krista@1325
   131
//                              this case errno will contain the underlying
krista@1325
   132
//                              error
krista@1325
   133
//      PEP_OUT_OF_MEMORY       if not enough memory could be allocated
krista@1325
   134
//
krista@1325
   135
//  caveat:
krista@1325
   136
//      the encrypted, encoded mime text will go to the ownership of the caller; mimetext
krista@1325
   137
//      will remain in the ownership of the caller
krista@1325
   138
DYNAMIC_API PEP_STATUS MIME_encrypt_message(
krista@1325
   139
    PEP_SESSION session,
krista@1325
   140
    const char *mimetext,
krista@1325
   141
    size_t size,
krista@1325
   142
    stringlist_t* extra,
krista@1325
   143
    char** mime_ciphertext,
krista@1325
   144
    PEP_enc_format enc_format,
krista@1325
   145
    PEP_encrypt_flags_t flags
krista@1325
   146
);
krista@1325
   147
roker@1869
   148
krista@1641
   149
// MIME_encrypt_message_for_self() - encrypt MIME message for user's identity only,
krista@1641
   150
//                              ignoring recipients and other identities from
krista@1641
   151
//                              the message, with MIME output
krista@1641
   152
//  parameters:
krista@1641
   153
//      session (in)            session handle
roker@1869
   154
//      target_id (in)          self identity this message should be encrypted for
krista@1641
   155
//      mimetext (in)           MIME encoded text to encrypt
krista@1641
   156
//      size (in)               size of input mime text
krista@2588
   157
//      extra (in)              extra keys for encryption
krista@1641
   158
//      mime_ciphertext (out)   encrypted, encoded message
krista@1641
   159
//      enc_format (in)         encrypted format
krista@1641
   160
//      flags (in)              flags to set special encryption features
krista@1641
   161
//
krista@1641
   162
//  return value:
krista@1641
   163
//      PEP_STATUS_OK           if everything worked
krista@1641
   164
//      PEP_BUFFER_TOO_SMALL    if encoded message size is too big to handle
krista@1641
   165
//      PEP_CANNOT_CREATE_TEMP_FILE
krista@1641
   166
//                              if there are issues with temp files; in
krista@1641
   167
//                              this case errno will contain the underlying
krista@1641
   168
//                              error
krista@1641
   169
//      PEP_OUT_OF_MEMORY       if not enough memory could be allocated
krista@1641
   170
//
krista@1641
   171
//  caveat:
krista@1641
   172
//      the encrypted, encoded mime text will go to the ownership of the caller; mimetext
krista@1641
   173
//      will remain in the ownership of the caller
krista@1641
   174
DYNAMIC_API PEP_STATUS MIME_encrypt_message_for_self(
krista@1641
   175
    PEP_SESSION session,
krista@1641
   176
    pEp_identity* target_id,
krista@1641
   177
    const char *mimetext,
krista@1641
   178
    size_t size,
krista@2588
   179
    stringlist_t* extra,
krista@1641
   180
    char** mime_ciphertext,
krista@1641
   181
    PEP_enc_format enc_format,
krista@1641
   182
    PEP_encrypt_flags_t flags
krista@1641
   183
);
krista@1641
   184
krista@1641
   185
vb@1004
   186
typedef enum _PEP_rating {
vb@237
   187
    PEP_rating_undefined = 0,
vb@256
   188
    PEP_rating_cannot_decrypt,
vb@267
   189
    PEP_rating_have_no_key,
vb@237
   190
    PEP_rating_unencrypted,
vb@486
   191
    PEP_rating_unencrypted_for_some,
vb@237
   192
    PEP_rating_unreliable,
vb@237
   193
    PEP_rating_reliable,
vb@237
   194
    PEP_rating_trusted,
vb@237
   195
    PEP_rating_trusted_and_anonymized,
vb@237
   196
    PEP_rating_fully_anonymous,   
vb@189
   197
Edouard@442
   198
    PEP_rating_mistrust = -1,
Edouard@442
   199
    PEP_rating_b0rken = -2,
vb@436
   200
    PEP_rating_under_attack = -3
vb@1004
   201
} PEP_rating;
vb@1004
   202
vb@1004
   203
typedef enum _PEP_color {
vb@1004
   204
    PEP_color_no_color = 0,
vb@1004
   205
    PEP_color_yellow,
vb@1004
   206
    PEP_color_green,
vb@1004
   207
    PEP_color_red = -1,
vb@232
   208
} PEP_color;
vb@189
   209
roker@1869
   210
vb@1007
   211
// color_from_rating - calculate color from rating
vb@1007
   212
//
vb@1007
   213
//  parameters:
vb@1007
   214
//      rating (in)         rating
vb@1007
   215
//
vb@1007
   216
//  return value:           color representing that rating
vb@1004
   217
DYNAMIC_API PEP_color color_from_rating(PEP_rating rating);
vb@1004
   218
Edouard@728
   219
typedef enum _PEP_decrypt_flags {
edouard@1355
   220
    PEP_decrypt_flag_own_private_key = 0x1,
edouard@1369
   221
    PEP_decrypt_flag_consume = 0x2,
edouard@1369
   222
    PEP_decrypt_flag_ignore = 0x4
Edouard@728
   223
} PEP_decrypt_flags; 
Edouard@728
   224
vb@939
   225
typedef unsigned int PEP_decrypt_flags_t;
Edouard@728
   226
roker@1869
   227
vb@251
   228
// decrypt_message() - decrypt message in memory
vb@251
   229
//
vb@251
   230
//  parameters:
vb@251
   231
//      session (in)        session handle
vb@251
   232
//      src (in)            message to decrypt
vb@251
   233
//      dst (out)           pointer to new decrypted message or NULL on failure
vb@251
   234
//      keylist (out)       stringlist with keyids
roker@1218
   235
//      rating (out)        rating for the message
vb@939
   236
//      flags (out)         flags to signal special decryption features
vb@251
   237
//
vb@251
   238
//  return value:
edouard@1858
   239
//      error status 
edouard@1858
   240
//      or PEP_DECRYPTED if message decrypted but not verified
edouard@1858
   241
//      or PEP_STATUS_OK on success
vb@251
   242
//
roker@1869
   243
// caveat:
roker@1869
   244
//      the ownership of src remains with the caller
roker@1869
   245
//      the ownership of dst goes to the caller
roker@1869
   246
//      the ownership of keylist goes to the caller
roker@1869
   247
//      if src is unencrypted this function returns PEP_UNENCRYPTED and sets
roker@1869
   248
//      dst to NULL
vb@251
   249
DYNAMIC_API PEP_STATUS decrypt_message(
vb@251
   250
        PEP_SESSION session,
vb@251
   251
        message *src,
vb@251
   252
        message **dst,
vb@251
   253
        stringlist_t **keylist,
vb@1004
   254
        PEP_rating *rating,
vb@939
   255
        PEP_decrypt_flags_t *flags
Edouard@728
   256
);
vb@251
   257
roker@1869
   258
krista@1325
   259
// MIME_decrypt_message() - decrypt a MIME message, with MIME output
krista@1325
   260
//
krista@1325
   261
//  parameters:
krista@1325
   262
//      session (in)            session handle
krista@1325
   263
//      mimetext (in)           MIME encoded text to decrypt
krista@1331
   264
//      size (in)               size of mime text to decode (in order to decrypt)
krista@1325
   265
//      mime_plaintext (out)    decrypted, encoded message
krista@1325
   266
//      keylist (out)           stringlist with keyids
krista@1325
   267
//      rating (out)            rating for the message
krista@1325
   268
//      flags (out)             flags to signal special decryption features
krista@1325
   269
//
krista@1325
   270
//  return value:
krista@1644
   271
//      decrypt status          if everything worked with MIME encode/decode, 
krista@1644
   272
//                              the status of the decryption is returned 
krista@1644
   273
//                              (PEP_STATUS_OK or decryption error status)
krista@1325
   274
//      PEP_BUFFER_TOO_SMALL    if encoded message size is too big to handle
krista@1325
   275
//      PEP_CANNOT_CREATE_TEMP_FILE
krista@1325
   276
//                              if there are issues with temp files; in
krista@1325
   277
//                              this case errno will contain the underlying
krista@1325
   278
//                              error
krista@1325
   279
//      PEP_OUT_OF_MEMORY       if not enough memory could be allocated
krista@1325
   280
//
krista@1325
   281
//  caveat:
krista@1325
   282
//      the decrypted, encoded mime text will go to the ownership of the caller; mimetext
krista@1325
   283
//      will remain in the ownership of the caller
krista@1325
   284
DYNAMIC_API PEP_STATUS MIME_decrypt_message(
krista@1325
   285
    PEP_SESSION session,
krista@1325
   286
    const char *mimetext,
krista@1325
   287
    size_t size,
krista@1325
   288
    char** mime_plaintext,
krista@1325
   289
    stringlist_t **keylist,
krista@1325
   290
    PEP_rating *rating,
krista@1325
   291
    PEP_decrypt_flags_t *flags
krista@1325
   292
);
krista@1325
   293
krista@1325
   294
Edouard@728
   295
// own_message_private_key_details() - details on own key in own message
Edouard@728
   296
//
Edouard@728
   297
//  parameters:
Edouard@728
   298
//      session (in)        session handle
Edouard@728
   299
//      msg (in)            message to decrypt
Edouard@728
   300
//      ident (out)         identity containing uid, address and fpr of key
Edouard@728
   301
//
Edouard@728
   302
//  note:
Edouard@728
   303
//      In order to obtain details about key to be possibly imported
Edouard@728
   304
//      as a replacement of key currently used as own identity, 
Edouard@728
   305
//      application passes message that have been previously flagged by 
Edouard@728
   306
//      decrypt_message() as own message containing own key to this function
Edouard@728
   307
//
Edouard@728
   308
//  return value:
Edouard@728
   309
//      error status or PEP_STATUS_OK on success
Edouard@728
   310
//
roker@1869
   311
//  caveat:
roker@1869
   312
//      the ownership of msg remains with the caller
roker@1869
   313
//      the ownership of ident goes to the caller
roker@1869
   314
//      msg MUST be encrypted so that this function can check own signature
Edouard@728
   315
DYNAMIC_API PEP_STATUS own_message_private_key_details(
Edouard@728
   316
        PEP_SESSION session,
Edouard@728
   317
        message *msg,
Edouard@728
   318
        pEp_identity **ident 
Edouard@728
   319
);
vb@251
   320
roker@1869
   321
vb@1009
   322
// outgoing_message_rating() - get rating for an outgoing message
vb@189
   323
//
vb@189
   324
//  parameters:
vb@189
   325
//      session (in)        session handle
vb@1009
   326
//      msg (in)            message to get the rating for
vb@1009
   327
//      rating (out)        rating for the message
vb@189
   328
//
vb@189
   329
//  return value:
vb@189
   330
//      error status or PEP_STATUS_OK on success
vb@190
   331
//
vb@190
   332
//  caveat:
vb@190
   333
//      msg->from must point to a valid pEp_identity
vb@251
   334
//      msg->dir must be PEP_dir_outgoing
vb@251
   335
//      the ownership of msg remains with the caller
vb@1009
   336
DYNAMIC_API PEP_STATUS outgoing_message_rating(
vb@189
   337
        PEP_SESSION session,
vb@190
   338
        message *msg,
vb@1004
   339
        PEP_rating *rating
vb@189
   340
    );
vb@189
   341
vb@239
   342
vb@1009
   343
// identity_rating() - get rating for a single identity
vb@239
   344
//
vb@239
   345
//  parameters:
vb@239
   346
//      session (in)        session handle
vb@1009
   347
//      ident (in)          identity to get the rating for
vb@1009
   348
//      rating (out)        rating for the identity
vb@239
   349
//
vb@239
   350
//  return value:
vb@239
   351
//      error status or PEP_STATUS_OK on success
vb@251
   352
//
vb@251
   353
//  caveat:
vb@251
   354
//      the ownership of ident remains with the caller
vb@1009
   355
DYNAMIC_API PEP_STATUS identity_rating(
vb@239
   356
        PEP_SESSION session,
vb@239
   357
        pEp_identity *ident,
vb@1004
   358
        PEP_rating *rating
vb@239
   359
    );
vb@239
   360
vb@239
   361
vb@507
   362
// get_binary_path() - retrieve path of cryptotech binary if available
vb@507
   363
//
vb@507
   364
//  parameters:
vb@507
   365
//      tech (in)           cryptotech to get the binary for
vb@507
   366
//      path (out)          path to cryptotech binary or NULL if not available
roker@540
   367
//                          **path is owned by the library, do not change it!
vb@507
   368
DYNAMIC_API PEP_STATUS get_binary_path(PEP_cryptotech tech, const char **path);
vb@507
   369
roker@1869
   370
krista@1307
   371
// get_trustwords() - get full trustwords string for a *pair* of identities
krista@1307
   372
//
krista@1307
   373
//    parameters:
krista@1307
   374
//        session (in)        session handle
krista@1307
   375
//        id1 (in)            identity of first party in communication - fpr can't be NULL  
krista@1307
   376
//        id2 (in)            identity of second party in communication - fpr can't be NULL
krista@1307
   377
//        lang (in)           C string with ISO 639-1 language code
krista@1307
   378
//        words (out)         pointer to C string with all trustwords UTF-8 encoded,
krista@1307
   379
//                            separated by a blank each
krista@1307
   380
//                            NULL if language is not supported or trustword
krista@1307
   381
//                            wordlist is damaged or unavailable
krista@1307
   382
//        wsize (out)         length of full trustwords string
krista@1307
   383
//        full (in)           if true, generate ALL trustwords for these identities.
krista@1307
   384
//                            else, generate a fixed-size subset. (TODO: fixed-minimum-entropy
krista@1307
   385
//                            subset in next version)
krista@1307
   386
//
krista@1307
   387
//    return value:
krista@1307
   388
//        PEP_STATUS_OK            trustwords retrieved
krista@1307
   389
//        PEP_OUT_OF_MEMORY        out of memory
krista@1307
   390
//        PEP_TRUSTWORD_NOT_FOUND  at least one trustword not found
krista@1307
   391
//
krista@1307
   392
//    caveat:
krista@1307
   393
//        the word pointer goes to the ownership of the caller
krista@1307
   394
//        the caller is responsible to free() it (on Windoze use pEp_free())
krista@1307
   395
//
krista@1307
   396
DYNAMIC_API PEP_STATUS get_trustwords(
roker@1509
   397
    PEP_SESSION session, const pEp_identity* id1, const pEp_identity* id2,
krista@1307
   398
    const char* lang, char **words, size_t *wsize, bool full
krista@1307
   399
);
vb@507
   400
roker@1869
   401
edouard@1553
   402
// get_message_trustwords() - get full trustwords string for message sender and reciever identities 
edouard@1553
   403
//
edouard@1553
   404
//    parameters:
edouard@1553
   405
//        session (in)        session handle
edouard@1553
   406
//        msg (in)            message to get sender identity from
edouard@1553
   407
//        keylist (in)        NULL if message to be decrypted,
edouard@1553
   408
//                            keylist returned by decrypt_message() otherwise
edouard@1553
   409
//        received_by (in)    identity for account receiving message can't be NULL
edouard@1553
   410
//        lang (in)           C string with ISO 639-1 language code
edouard@1553
   411
//        words (out)         pointer to C string with all trustwords UTF-8 encoded,
edouard@1553
   412
//                            separated by a blank each
edouard@1553
   413
//                            NULL if language is not supported or trustword
edouard@1553
   414
//                            wordlist is damaged or unavailable
edouard@1553
   415
//        full (in)           if true, generate ALL trustwords for these identities.
edouard@1553
   416
//                            else, generate a fixed-size subset. (TODO: fixed-minimum-entropy
edouard@1553
   417
//                            subset in next version)
edouard@1553
   418
//
edouard@1553
   419
//    return value:
edouard@1553
   420
//        PEP_STATUS_OK            trustwords retrieved
edouard@1553
   421
//        PEP_OUT_OF_MEMORY        out of memory
edouard@1553
   422
//        PEP_TRUSTWORD_NOT_FOUND  at least one trustword not found
edouard@1553
   423
//        error status of decrypt_message() if decryption fails.
edouard@1553
   424
//
edouard@1553
   425
//    caveat:
edouard@1553
   426
//        the word pointer goes to the ownership of the caller
edouard@1553
   427
//        the caller is responsible to free() it (on Windoze use pEp_free())
edouard@1553
   428
//
edouard@1553
   429
DYNAMIC_API PEP_STATUS get_message_trustwords(
edouard@1553
   430
    PEP_SESSION session, 
edouard@1553
   431
    message *msg,
edouard@1553
   432
    stringlist_t *keylist,
edouard@1553
   433
    pEp_identity* received_by,
edouard@1553
   434
    const char* lang, char **words, bool full
edouard@1553
   435
);
edouard@1553
   436
edouard@1815
   437
// re_evaluate_message_rating() - re-evaluate already decrypted message rating
edouard@1815
   438
//
edouard@1815
   439
//  parameters:
edouard@1815
   440
//      session (in)            session handle
edouard@1815
   441
//      msg (in)                message to get the rating for
edouard@1815
   442
//      x_keylist (in)          decrypted message recipients keys fpr
edouard@1815
   443
//      x_enc_status (in)       original rating for the decrypted message
edouard@1815
   444
//      rating (out)            rating for the message
edouard@1815
   445
//
edouard@1815
   446
//  return value:
edouard@1815
   447
//      PEP_ILLEGAL_VALUE       if decrypted message doesn't contain 
edouard@1815
   448
//                              X-EncStatus optional field and x_enc_status is 
edouard@1815
   449
//                              pEp_rating_udefined
edouard@1815
   450
//                              or if decrypted message doesn't contain 
edouard@1815
   451
//                              X-Keylist optional field and x_keylist is NULL
edouard@1815
   452
//      PEP_OUT_OF_MEMORY       if not enough memory could be allocated
edouard@1815
   453
//
edouard@1815
   454
//  caveat:
edouard@1815
   455
//      msg->from must point to a valid pEp_identity
edouard@1815
   456
//      the ownership of msg remains with the caller
edouard@1815
   457
//	    the ownership of x_keylist remains with to the caller
edouard@1815
   458
edouard@1815
   459
DYNAMIC_API PEP_STATUS re_evaluate_message_rating(
edouard@1815
   460
    PEP_SESSION session,
edouard@1815
   461
    message *msg,
edouard@1815
   462
    stringlist_t *x_keylist,
edouard@1815
   463
    PEP_rating x_enc_status,
edouard@1815
   464
    PEP_rating *rating
edouard@1815
   465
);
vb@37
   466
#ifdef __cplusplus
vb@37
   467
}
vb@37
   468
#endif