src/message_api.h
author Roker <roker@pep-project.org>
Mon, 28 Jan 2019 16:50:29 +0100
branchsync
changeset 3248 2918ebb00283
parent 3243 09257addf431
child 3250 32211c0ba931
permissions -rw-r--r--
make it const.
     1 // This file is under GNU General Public License 3.0
     2 // see LICENSE.txt
     3 
     4 #pragma once
     5 
     6 #include "pEpEngine.h"
     7 #include "keymanagement.h"
     8 #include "message.h"
     9 #include "cryptotech.h"
    10 
    11 #ifdef __cplusplus
    12 extern "C" {
    13 #endif
    14 
    15 bool import_attached_keys(
    16         PEP_SESSION session, 
    17         const message *msg,
    18         identity_list **private_idents
    19     );
    20 
    21 void attach_own_key(PEP_SESSION session, message *msg);
    22 
    23 PEP_cryptotech determine_encryption_format(message *msg);
    24 
    25 void add_opt_field(message *msg, const char *name, const char *value);
    26 
    27 typedef enum _PEP_encrypt_flags {
    28     // "default" means whatever the default behaviour for the function is.
    29     PEP_encrypt_flag_default = 0x0,
    30     PEP_encrypt_flag_force_encryption = 0x1,
    31 
    32     // This flag is for special use cases and should not be used
    33     // by normal pEp clients!
    34     PEP_encrypt_flag_force_unsigned = 0x2,
    35     PEP_encrypt_flag_force_no_attached_key = 0x4,
    36     
    37     // This is used for outer messages (used to wrap the real message)
    38     // This is only used internally and (eventually) by transport functions
    39     PEP_encrypt_flag_inner_message = 0x8,
    40     
    41     // This is mainly used by pEp clients to send private keys to 
    42     // their own PGP-only device
    43     PEP_encrypt_flag_force_version_1 = 0x10,
    44     
    45     PEP_encrypt_flag_key_reset_only = 0x20
    46     
    47 } PEP_encrypt_flags; 
    48 
    49 typedef unsigned int PEP_encrypt_flags_t;
    50 
    51 typedef enum _message_wrap_type {
    52     PEP_message_default,    // typical inner/outer message 2.0
    53     PEP_message_transport,  // e.g. for onion layers
    54     PEP_message_key_reset   // for wrapped key reset information
    55 } message_wrap_type;
    56 
    57 // encrypt_message() - encrypt message in memory
    58 //
    59 //  parameters:
    60 //      session (in)        session handle
    61 //      src (inout)         message to encrypt - usually in-only, but can be 
    62 //                          in-out for unencrypted messages; in that case, 
    63 //                          we may attach the key and decorate the message
    64 //      extra (in)          extra keys for encryption
    65 //      dst (out)           pointer to new encrypted message or NULL if no
    66 //                          encryption could take place
    67 //      enc_format (in)     encrypted format
    68 //      flags (in)          flags to set special encryption features
    69 //
    70 //  return value:
    71 //      PEP_STATUS_OK                   on success
    72 //      PEP_KEY_HAS_AMBIG_NAME          at least one of the receipient keys has
    73 //                                      an ambiguous name
    74 //      PEP_UNENCRYPTED                 on demand or no recipients with usable
    75 //                                      key, is left unencrypted, and key is
    76 //                                      attached to it
    77 //
    78 //  caveat:
    79 //      the ownership of src remains with the caller
    80 //      the ownership of dst goes to the caller
    81 
    82 DYNAMIC_API PEP_STATUS encrypt_message(
    83         PEP_SESSION session,
    84         message *src,
    85         stringlist_t *extra,
    86         message **dst,
    87         PEP_enc_format enc_format,
    88         PEP_encrypt_flags_t flags
    89     );
    90 
    91 
    92 // encrypt_message_and_add_priv_key() - encrypt message in memory, adding an encrypted private
    93 //                                      key (encrypted separately and sent within the inner message)
    94 //
    95 //  parameters:
    96 //      session (in)        session handle
    97 //      src (in)            message to encrypt
    98 //      dst (out)           pointer to new encrypted message or NULL if no
    99 //                          encryption could take place
   100 //      to_fpr              fingerprint of the recipient key to which the private key
   101 //                          should be encrypted
   102 //      enc_format (in)     encrypted format
   103 //      flags (in)          flags to set special encryption features
   104 //
   105 //  return value:
   106 //      PEP_STATUS_OK                   on success
   107 //      PEP_KEY_HAS_AMBIG_NAME          at least one of the receipient keys has
   108 //                                      an ambiguous name
   109 //      PEP_UNENCRYPTED                 on demand or no recipients with usable
   110 //                                      key, is left unencrypted, and key is
   111 //                                      attached to it
   112 //
   113 //  caveat:
   114 //      the ownershop of src remains with the caller
   115 //      the ownership of dst goes to the caller
   116 DYNAMIC_API PEP_STATUS encrypt_message_and_add_priv_key(
   117         PEP_SESSION session,
   118         message *src,
   119         message **dst,
   120         const char* to_fpr,
   121         PEP_enc_format enc_format,
   122         PEP_encrypt_flags_t flags
   123     );
   124 
   125 
   126 // encrypt_message_for_self() - encrypt message in memory for user's identity only,
   127 //                              ignoring recipients and other identities from
   128 //                              the message
   129 //  parameters:
   130 //      session (in)        session handle
   131 //      target_id (in)      self identity this message should be encrypted for
   132 //      src (in)            message to encrypt
   133 //      extra (in)          extra keys for encryption
   134 //      dst (out)           pointer to new encrypted message or NULL on failure
   135 //      enc_format (in)     encrypted format
   136 //      flags (in)          flags to set special encryption features
   137 //
   138 //  return value:       (FIXME: This may not be correct or complete)
   139 //      PEP_STATUS_OK            on success
   140 //      PEP_KEY_NOT_FOUND        at least one of the receipient keys
   141 //                               could not be found
   142 //      PEP_KEY_HAS_AMBIG_NAME   at least one of the receipient keys has
   143 //                               an ambiguous name
   144 //      PEP_GET_KEY_FAILED       cannot retrieve key
   145 //
   146 //  caveat:
   147 //      the ownership of src remains with the caller
   148 //      the ownership of target_id remains w/ caller            
   149 //      the ownership of dst goes to the caller
   150 //      message is NOT encrypted for identities other than the target_id (and then,
   151 //      only if the target_id refers to self!)
   152 DYNAMIC_API PEP_STATUS encrypt_message_for_self(
   153         PEP_SESSION session,
   154         pEp_identity* target_id,
   155         message *src,
   156         stringlist_t* extra,
   157         message **dst,
   158         PEP_enc_format enc_format,
   159         PEP_encrypt_flags_t flags
   160     );
   161 
   162 
   163 // MIME_encrypt_message() - encrypt a MIME message, with MIME output
   164 //
   165 //  parameters:
   166 //      session (in)            session handle
   167 //      mimetext (in)           MIME encoded text to encrypt
   168 //      size (in)               size of input mime text
   169 //      extra (in)              extra keys for encryption
   170 //      mime_ciphertext (out)   encrypted, encoded message
   171 //      enc_format (in)         encrypted format
   172 //      flags (in)              flags to set special encryption features
   173 //
   174 //  return value:
   175 //      PEP_STATUS_OK           if everything worked
   176 //      PEP_BUFFER_TOO_SMALL    if encoded message size is too big to handle
   177 //      PEP_CANNOT_CREATE_TEMP_FILE
   178 //                              if there are issues with temp files; in
   179 //                              this case errno will contain the underlying
   180 //                              error
   181 //      PEP_OUT_OF_MEMORY       if not enough memory could be allocated
   182 //
   183 //  caveat:
   184 //      the encrypted, encoded mime text will go to the ownership of the caller; mimetext
   185 //      will remain in the ownership of the caller
   186 DYNAMIC_API PEP_STATUS MIME_encrypt_message(
   187     PEP_SESSION session,
   188     const char *mimetext,
   189     size_t size,
   190     stringlist_t* extra,
   191     char** mime_ciphertext,
   192     PEP_enc_format enc_format,
   193     PEP_encrypt_flags_t flags
   194 );
   195 
   196 
   197 // MIME_encrypt_message_for_self() - encrypt MIME message for user's identity only,
   198 //                              ignoring recipients and other identities from
   199 //                              the message, with MIME output
   200 //  parameters:
   201 //      session (in)            session handle
   202 //      target_id (in)          self identity this message should be encrypted for
   203 //      mimetext (in)           MIME encoded text to encrypt
   204 //      size (in)               size of input mime text
   205 //      extra (in)              extra keys for encryption
   206 //      mime_ciphertext (out)   encrypted, encoded message
   207 //      enc_format (in)         encrypted format
   208 //      flags (in)              flags to set special encryption features
   209 //
   210 //  return value:
   211 //      PEP_STATUS_OK           if everything worked
   212 //      PEP_BUFFER_TOO_SMALL    if encoded message size is too big to handle
   213 //      PEP_CANNOT_CREATE_TEMP_FILE
   214 //                              if there are issues with temp files; in
   215 //                              this case errno will contain the underlying
   216 //                              error
   217 //      PEP_OUT_OF_MEMORY       if not enough memory could be allocated
   218 //
   219 //  caveat:
   220 //      the encrypted, encoded mime text will go to the ownership of the caller; mimetext
   221 //      will remain in the ownership of the caller
   222 DYNAMIC_API PEP_STATUS MIME_encrypt_message_for_self(
   223     PEP_SESSION session,
   224     pEp_identity* target_id,
   225     const char *mimetext,
   226     size_t size,
   227     stringlist_t* extra,
   228     char** mime_ciphertext,
   229     PEP_enc_format enc_format,
   230     PEP_encrypt_flags_t flags
   231 );
   232 
   233 
   234 typedef enum _PEP_rating {
   235     PEP_rating_undefined = 0,
   236     PEP_rating_cannot_decrypt,
   237     PEP_rating_have_no_key,
   238     PEP_rating_unencrypted,
   239     PEP_rating_unencrypted_for_some,
   240     PEP_rating_unreliable,
   241     PEP_rating_reliable,
   242     PEP_rating_trusted,
   243     PEP_rating_trusted_and_anonymized,
   244     PEP_rating_fully_anonymous,   
   245 
   246     PEP_rating_mistrust = -1,
   247     PEP_rating_b0rken = -2,
   248     PEP_rating_under_attack = -3
   249 } PEP_rating;
   250 
   251 typedef enum _PEP_color {
   252     PEP_color_no_color = 0,
   253     PEP_color_yellow,
   254     PEP_color_green,
   255     PEP_color_red = -1,
   256 } PEP_color;
   257 
   258 
   259 // color_from_rating - calculate color from rating
   260 //
   261 //  parameters:
   262 //      rating (in)         rating
   263 //
   264 //  return value:           color representing that rating
   265 DYNAMIC_API PEP_color color_from_rating(PEP_rating rating);
   266 
   267 typedef enum _PEP_decrypt_flags {
   268     PEP_decrypt_flag_own_private_key = 0x1,
   269     PEP_decrypt_flag_consume = 0x2,
   270     PEP_decrypt_flag_ignore = 0x4,
   271     PEP_decrypt_flag_src_modified = 0x8,
   272     // input flags    
   273     PEP_decrypt_flag_untrusted_server = 0x100
   274 } PEP_decrypt_flags; 
   275 
   276 typedef unsigned int PEP_decrypt_flags_t;
   277 
   278 
   279 // decrypt_message() - decrypt message in memory
   280 //
   281 //  parameters:
   282 //      session (in)        session handle
   283 //      src (inout)         message to decrypt
   284 //      dst (out)           pointer to new decrypted message or NULL on failure
   285 //      keylist (inout)     in: stringlist with additional keyids for reencryption if needed
   286 //                              (will be freed and replaced with output keylist) 
   287 //                          out: stringlist with keyids used for signing and encryption. first
   288 //                               first key is signer, additional keys are the ones it was encrypted
   289 //                               to. Only signer and whichever of the user's keys was used are 
   290 //                               reliable
   291 //      rating (out)        rating for the message
   292 //      flags (inout)       flags to signal special decryption features
   293 //
   294 //  return value:
   295 //      error status 
   296 //      or PEP_DECRYPTED if message decrypted but not verified
   297 //      or PEP_CANNOT_REENCRYPT if message was decrypted (and possibly
   298 //         verified) but a reencryption operation is expected by the caller
   299 //         and failed
   300 //      or PEP_STATUS_OK on success
   301 //
   302 //  flag values:
   303 //      in:
   304 //          PEP_decrypt_flag_untrusted_server
   305 //              used to signal that decrypt function should engage in behaviour
   306 //              specified for when the server storing the source is untrusted
   307 //      out:
   308 //          PEP_decrypt_flag_own_private_key
   309 //              private key was imported for one of our addresses (NOT trusted
   310 //              or set to be used - handshake/trust is required for that)
   311 //          PEP_decrypt_flag_src_modified
   312 //              indicates that the src object has been modified. At the moment,
   313 //              this is always as a direct result of the behaviour driven
   314 //              by the input flags. This flag is the ONLY value that should be
   315 //              relied upon to see if such changes have taken place.
   316 //          PEP_decrypt_flag_consume
   317 //              used by sync 
   318 //          PEP_decrypt_flag_ignore
   319 //              used by sync 
   320 //
   321 //
   322 // caveat:
   323 //      the ownership of src remains with the caller - however, the contents 
   324 //          might be modified (strings freed and allocated anew or set to NULL,
   325 //          etc) intentionally; when this happens, PEP_decrypt_flag_src_modified
   326 //          is set.
   327 //      the ownership of dst goes to the caller
   328 //      the ownership of keylist goes to the caller
   329 //      if src is unencrypted this function returns PEP_UNENCRYPTED and sets
   330 //         dst to NULL
   331 DYNAMIC_API PEP_STATUS decrypt_message(
   332         PEP_SESSION session,
   333         message *src,
   334         message **dst,
   335         stringlist_t **keylist,
   336         PEP_rating *rating,
   337         PEP_decrypt_flags_t *flags
   338 );
   339 
   340 
   341 // MIME_decrypt_message() - decrypt a MIME message, with MIME output
   342 //
   343 //  parameters:
   344 //      session (in)            session handle
   345 //      mimetext (in)           MIME encoded text to decrypt
   346 //      size (in)               size of mime text to decode (in order to decrypt)
   347 //      mime_plaintext (out)    decrypted, encoded message
   348 //      keylist (inout)         in: stringlist with additional keyids for reencryption if needed
   349 //                                  (will be freed and replaced with output keylist)
   350 //                              out: stringlist with keyids
   351 //      rating (out)            rating for the message
   352 //      flags (inout)           flags to signal special decryption features (see below)
   353 //      modified_src (out)      modified source string, if decrypt had reason to change it
   354 //
   355 //  return value:
   356 //      decrypt status          if everything worked with MIME encode/decode, 
   357 //                              the status of the decryption is returned 
   358 //                              (PEP_STATUS_OK or decryption error status)
   359 //      PEP_BUFFER_TOO_SMALL    if encoded message size is too big to handle
   360 //      PEP_CANNOT_CREATE_TEMP_FILE
   361 //                              if there are issues with temp files; in
   362 //                              this case errno will contain the underlying
   363 //                              error
   364 //      PEP_OUT_OF_MEMORY       if not enough memory could be allocated
   365 //
   366 //  flag values:
   367 //      in:
   368 //          PEP_decrypt_flag_untrusted_server
   369 //              used to signal that decrypt function should engage in behaviour
   370 //              specified for when the server storing the source is untrusted.
   371 //      out:
   372 //          PEP_decrypt_flag_own_private_key
   373 //              private key was imported for one of our addresses (NOT trusted
   374 //              or set to be used - handshake/trust is required for that)
   375 //          PEP_decrypt_flag_src_modified
   376 //              indicates that the modified_src field should contain a modified
   377 //              version of the source, at the moment always as a result of the
   378 //              input flags. 
   379 //          PEP_decrypt_flag_consume
   380 //              used by sync 
   381 //          PEP_decrypt_flag_ignore
   382 //              used by sync 
   383 // 
   384 //  caveat:
   385 //      the decrypted, encoded mime text will go to the ownership of the caller; mimetext
   386 //      will remain in the ownership of the caller
   387 DYNAMIC_API PEP_STATUS MIME_decrypt_message(
   388     PEP_SESSION session,
   389     const char *mimetext,
   390     size_t size,
   391     char** mime_plaintext,
   392     stringlist_t **keylist,
   393     PEP_rating *rating,
   394     PEP_decrypt_flags_t *flags,
   395     char** modified_src
   396 );
   397 
   398 
   399 // own_message_private_key_details() - details on own key in own message
   400 //
   401 //  parameters:
   402 //      session (in)        session handle
   403 //      msg (in)            message to decrypt
   404 //      ident (out)         identity containing uid, address and fpr of key
   405 //
   406 //  note:
   407 //      In order to obtain details about key to be possibly imported
   408 //      as a replacement of key currently used as own identity, 
   409 //      application passes message that have been previously flagged by 
   410 //      decrypt_message() as own message containing own key to this function
   411 //
   412 //  return value:
   413 //      error status or PEP_STATUS_OK on success
   414 //
   415 //  caveat:
   416 //      the ownership of msg remains with the caller
   417 //      the ownership of ident goes to the caller
   418 //      msg MUST be encrypted so that this function can check own signature
   419 DYNAMIC_API PEP_STATUS own_message_private_key_details(
   420         PEP_SESSION session,
   421         message *msg,
   422         pEp_identity **ident 
   423 );
   424 
   425 
   426 // outgoing_message_rating() - get rating for an outgoing message
   427 //
   428 //  parameters:
   429 //      session (in)        session handle
   430 //      msg (in)            message to get the rating for
   431 //      rating (out)        rating for the message
   432 //
   433 //  return value:
   434 //      error status or PEP_STATUS_OK on success
   435 //
   436 //  caveat:
   437 //      msg->from must point to a valid pEp_identity
   438 //      msg->dir must be PEP_dir_outgoing
   439 //      the ownership of msg remains with the caller
   440 DYNAMIC_API PEP_STATUS outgoing_message_rating(
   441         PEP_SESSION session,
   442         message *msg,
   443         PEP_rating *rating
   444     );
   445 
   446 
   447 // outgoing_message_rating_preview() - get rating preview
   448 //
   449 //  parameters:
   450 //      session (in)        session handle
   451 //      msg (in)            message to get the rating for
   452 //      rating (out)        rating preview for the message
   453 //
   454 //  return value:
   455 //      error status or PEP_STATUS_OK on success
   456 //
   457 //  caveat:
   458 //      msg->from must point to a valid pEp_identity
   459 //      msg->dir must be PEP_dir_outgoing
   460 //      the ownership of msg remains with the caller
   461 DYNAMIC_API PEP_STATUS outgoing_message_rating_preview(
   462         PEP_SESSION session,
   463         message *msg,
   464         PEP_rating *rating
   465     );
   466 
   467 // identity_rating() - get rating for a single identity
   468 //
   469 //  parameters:
   470 //      session (in)        session handle
   471 //      ident (in)          identity to get the rating for
   472 //      rating (out)        rating for the identity
   473 //
   474 //  return value:
   475 //      error status or PEP_STATUS_OK on success
   476 //
   477 //  caveat:
   478 //      the ownership of ident remains with the caller
   479 DYNAMIC_API PEP_STATUS identity_rating(
   480         PEP_SESSION session,
   481         pEp_identity *ident,
   482         PEP_rating *rating
   483     );
   484 
   485 
   486 // get_binary_path() - retrieve path of cryptotech binary if available
   487 //
   488 //  parameters:
   489 //      tech (in)           cryptotech to get the binary for
   490 //      path (out)          path to cryptotech binary or NULL if not available
   491 //                          **path is owned by the library, do not change it!
   492 DYNAMIC_API PEP_STATUS get_binary_path(PEP_cryptotech tech, const char **path);
   493 
   494 
   495 // get_trustwords() - get full trustwords string for a *pair* of identities
   496 //
   497 //    parameters:
   498 //        session (in)        session handle
   499 //        id1 (in)            identity of first party in communication - fpr can't be NULL  
   500 //        id2 (in)            identity of second party in communication - fpr can't be NULL
   501 //        lang (in)           C string with ISO 639-1 language code
   502 //        words (out)         pointer to C string with all trustwords UTF-8 encoded,
   503 //                            separated by a blank each
   504 //                            NULL if language is not supported or trustword
   505 //                            wordlist is damaged or unavailable
   506 //        wsize (out)         length of full trustwords string
   507 //        full (in)           if true, generate ALL trustwords for these identities.
   508 //                            else, generate a fixed-size subset. (TODO: fixed-minimum-entropy
   509 //                            subset in next version)
   510 //
   511 //    return value:
   512 //        PEP_STATUS_OK            trustwords retrieved
   513 //        PEP_OUT_OF_MEMORY        out of memory
   514 //        PEP_TRUSTWORD_NOT_FOUND  at least one trustword not found
   515 //
   516 //    caveat:
   517 //        the word pointer goes to the ownership of the caller
   518 //        the caller is responsible to free() it (on Windoze use pEp_free())
   519 //
   520 DYNAMIC_API PEP_STATUS get_trustwords(
   521     PEP_SESSION session, const pEp_identity* id1, const pEp_identity* id2,
   522     const char* lang, char **words, size_t *wsize, bool full
   523 );
   524 
   525 
   526 // get_message_trustwords() - get full trustwords string for message sender and reciever identities 
   527 //
   528 //    parameters:
   529 //        session (in)        session handle
   530 //        msg (in)            message to get sender identity from
   531 //        keylist (in)        NULL if message to be decrypted,
   532 //                            keylist returned by decrypt_message() otherwise
   533 //        received_by (in)    identity for account receiving message can't be NULL
   534 //        lang (in)           C string with ISO 639-1 language code
   535 //        words (out)         pointer to C string with all trustwords UTF-8 encoded,
   536 //                            separated by a blank each
   537 //                            NULL if language is not supported or trustword
   538 //                            wordlist is damaged or unavailable
   539 //        full (in)           if true, generate ALL trustwords for these identities.
   540 //                            else, generate a fixed-size subset. (TODO: fixed-minimum-entropy
   541 //                            subset in next version)
   542 //
   543 //    return value:
   544 //        PEP_STATUS_OK            trustwords retrieved
   545 //        PEP_OUT_OF_MEMORY        out of memory
   546 //        PEP_TRUSTWORD_NOT_FOUND  at least one trustword not found
   547 //        error status of decrypt_message() if decryption fails.
   548 //
   549 //    caveat:
   550 //        the word pointer goes to the ownership of the caller
   551 //        the caller is responsible to free() it (on Windoze use pEp_free())
   552 //
   553 DYNAMIC_API PEP_STATUS get_message_trustwords(
   554     PEP_SESSION session, 
   555     message *msg,
   556     stringlist_t *keylist,
   557     pEp_identity* received_by,
   558     const char* lang, char **words, bool full
   559 );
   560 
   561 // re_evaluate_message_rating() - re-evaluate already decrypted message rating
   562 //
   563 //  parameters:
   564 //      session (in)            session handle
   565 //      msg (in)                message to get the rating for
   566 //      x_keylist (in)          decrypted message recipients keys fpr
   567 //      x_enc_status (in)       original rating for the decrypted message
   568 //      rating (out)            rating for the message
   569 //
   570 //  return value:
   571 //      PEP_ILLEGAL_VALUE       if decrypted message doesn't contain 
   572 //                              X-EncStatus optional field and x_enc_status is 
   573 //                              pEp_rating_udefined
   574 //                              or if decrypted message doesn't contain 
   575 //                              X-Keylist optional field and x_keylist is NULL
   576 //      PEP_OUT_OF_MEMORY       if not enough memory could be allocated
   577 //
   578 //  caveat:
   579 //      msg->from must point to a valid pEp_identity
   580 //      the ownership of msg remains with the caller
   581 //	    the ownership of x_keylist remains with to the caller
   582 
   583 DYNAMIC_API PEP_STATUS re_evaluate_message_rating(
   584     PEP_SESSION session,
   585     message *msg,
   586     stringlist_t *x_keylist,
   587     PEP_rating x_enc_status,
   588     PEP_rating *rating
   589 );
   590 
   591 // get_key_rating_for_user() - get the rating of a certain key for a certain user
   592 //
   593 //  parameters:
   594 //
   595 //      session (in)            session handle
   596 //      user_id (in)            string with user ID
   597 //      fpr (in)                string with fingerprint
   598 //      rating (out)            rating of key for this user
   599 //
   600 //  returns:
   601 //      PEP_RECORD_NOT_FOUND if no trust record for user_id and fpr can be found
   602 
   603 DYNAMIC_API PEP_STATUS get_key_rating_for_user(
   604         PEP_SESSION session,
   605         const char *user_id,
   606         const char *fpr,
   607         PEP_rating *rating
   608     );
   609 
   610 #ifdef __cplusplus
   611 }
   612 #endif