More scripted comment blocks injected

doxygen-key-id
parent 645ac77a4e
commit 7405f0eafc

@ -160,6 +160,15 @@ DYNAMIC_API int bloblist_length(const bloblist_t *bloblist);
DYNAMIC_API void set_blob_disposition(bloblist_t* blob,
content_disposition_type disposition);
/**
* <!-- bloblist_join() -->
*
* @brief TODO
*
* @param[in] *first bloblist_t
* @param[in] *second bloblist_t
*
*/
DYNAMIC_API bloblist_t* bloblist_join(bloblist_t* first, bloblist_t* second);
#ifdef __cplusplus

@ -9,4 +9,14 @@
#include "transport.h"
PEP_STATUS email_sendto(PEP_SESSION session, const message *msg);
/**
* <!-- email_readnext() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] **msg message
* @param[in] **via PEP_transport_t
*
*/
PEP_STATUS email_readnext(PEP_SESSION session, message **msg, PEP_transport_t **via);

@ -16,6 +16,17 @@
#include "stringpair.h"
#include "timestamp.h"
/**
* <!-- part_new_empty() -->
*
* @brief TODO
*
* @param[in] *content structmailmime_content
* @param[in] *mime_fields structmailmime_fields
* @param[in] *param_keyvals stringpair_list_t
* @param[in] force_single int
*
*/
struct mailmime * part_new_empty(
struct mailmime_content * content,
struct mailmime_fields * mime_fields,
@ -32,6 +43,18 @@ struct mailmime * part_new_empty(
*/
struct mailmime * get_pgp_encrypted_part(void);
/**
* <!-- get_text_part() -->
*
* @brief TODO
*
* @param[in] *resource pEp_rid_list_t
* @param[in] *mime_type constchar
* @param[in] *text constchar
* @param[in] length size_t
* @param[in] encoding_type int
*
*/
struct mailmime * get_text_part(
pEp_rid_list_t* resource,
const char * mime_type,
@ -40,6 +63,18 @@ struct mailmime * get_text_part(
int encoding_type
);
/**
* <!-- get_file_part() -->
*
* @brief TODO
*
* @param[in] *resource pEp_rid_list_t
* @param[in] *mime_type constchar
* @param[in] *data char
* @param[in] length size_t
* @param[in] set_attachment_forward_comment bool
*
*/
struct mailmime * get_file_part(
pEp_rid_list_t* resource,
const char * mime_type,
@ -48,18 +83,55 @@ struct mailmime * get_file_part(
bool set_attachment_forward_comment
);
/**
* <!-- part_multiple_new() -->
*
* @brief TODO
*
* @param[in] *type constchar
*
*/
struct mailmime * part_multiple_new(const char *type);
typedef void *(*_new_func_t)(void *);
/**
* <!-- _new_field() -->
*
* @brief TODO
*
* @param[in] type int
* @param[in] new_func _new_func_t
* @param[in] *value void
*
*/
struct mailimf_field * _new_field(
int type,
_new_func_t new_func,
void *value
);
/**
* <!-- _free_field() -->
*
* @brief TODO
*
* @param[in] *field structmailimf_field
*
*/
void _free_field(struct mailimf_field *field);
/**
* <!-- _append_field() -->
*
* @brief TODO
*
* @param[in] *list clist
* @param[in] type int
* @param[in] new_func _new_func_t
* @param[in] *value void
*
*/
int _append_field(
clist *list,
int type,
@ -67,37 +139,176 @@ int _append_field(
void *value
);
/**
* <!-- timestamp_to_etpantime() -->
*
* @brief TODO
*
* @param[in] *ts consttimestamp
*
*/
struct mailimf_date_time * timestamp_to_etpantime(const timestamp *ts);
/**
* <!-- etpantime_to_timestamp() -->
*
* @brief TODO
*
* @param[in] *et conststructmailimf_date_time
*
*/
timestamp * etpantime_to_timestamp(const struct mailimf_date_time *et);
/**
* <!-- mailbox_from_string() -->
*
* @brief TODO
*
* @param[in] *name constchar
* @param[in] *address constchar
*
*/
struct mailimf_mailbox * mailbox_from_string(
const char *name,
const char *address
);
/**
* <!-- create_optional_field() -->
*
* @brief TODO
*
* @param[in] *field constchar
* @param[in] *value constchar
*
*/
struct mailimf_field * create_optional_field(
const char *field,
const char *value
);
/**
* <!-- _append_optional_field() -->
*
* @brief TODO
*
* @param[in] *list clist
* @param[in] *field constchar
* @param[in] *value constchar
*
*/
int _append_optional_field(
clist *list,
const char *field,
const char *value
);
/**
* <!-- _get_fields() -->
*
* @brief TODO
*
* @param[in] *mime structmailmime
*
*/
clist * _get_fields(struct mailmime * mime);
/**
* <!-- _get_content() -->
*
* @brief TODO
*
* @param[in] *mime structmailmime
*
*/
struct mailmime_content * _get_content(struct mailmime * mime);
/**
* <!-- _get_filename_or_cid() -->
*
* @brief TODO
*
* @param[in] *mime structmailmime
*
*/
char * _get_filename_or_cid(struct mailmime *mime);
/**
* <!-- _get_resource_id_list() -->
*
* @brief TODO
*
* @param[in] *mime structmailmime
*
*/
pEp_rid_list_t* _get_resource_id_list(struct mailmime *mime);
/**
* <!-- _build_uri() -->
*
* @brief TODO
*
* @param[in] *uri_prefix char
* @param[in] *resource char
*
*/
char* _build_uri(char* uri_prefix, char* resource);
/**
* <!-- _is_multipart() -->
*
* @brief TODO
*
* @param[in] *content structmailmime_content
* @param[in] *subtype constchar
*
*/
bool _is_multipart(struct mailmime_content *content, const char *subtype);
/**
* <!-- _is_PGP_MIME() -->
*
* @brief TODO
*
* @param[in] *content structmailmime_content
*
*/
bool _is_PGP_MIME(struct mailmime_content *content);
/**
* <!-- _is_text_part() -->
*
* @brief TODO
*
* @param[in] *content structmailmime_content
* @param[in] *subtype constchar
*
*/
bool _is_text_part(struct mailmime_content *content, const char *subtype);
/**
* <!-- must_field_value_be_encoded() -->
*
* @brief TODO
*
* @param[in] *field_value constchar
*
*/
bool must_field_value_be_encoded(const char* field_value);
/**
* <!-- must_chunk_be_encoded() -->
*
* @brief TODO
*
* @param[in] *value constvoid
* @param[in] size size_t
* @param[in] ignore_fws bool
*
*/
bool must_chunk_be_encoded(const void* value, size_t size, bool ignore_fws);
/**
* <!-- _get_content_type() -->
*
* @brief TODO
*
* @param[in] *content conststructmailmime_content
* @param[in] **type char
* @param[in] **charset char
*
*/
int _get_content_type(
const struct mailmime_content *content,
char **type,

@ -106,6 +106,15 @@ DYNAMIC_API identity_list *identity_list_join(identity_list *first_list, identit
DYNAMIC_API int identity_list_length(const identity_list *id_list);
// Internal
/**
* <!-- set_all_userids_in_list() -->
*
* @brief TODO
*
* @param[in] *id_list identity_list
* @param[in] *user_id constchar
*
*/
PEP_STATUS set_all_userids_in_list(identity_list* id_list, const char* user_id);
#ifdef __cplusplus

@ -159,6 +159,18 @@ PEP_STATUS key_reset_own_and_deliver_revocations(PEP_SESSION session,
stringlist_t** keys);
*/
/**
* <!-- has_key_reset_been_sent() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *from_addr constchar
* @param[in] *user_id constchar
* @param[in] *revoked_fpr constchar
* @param[in] *contacted bool
*
*/
PEP_STATUS has_key_reset_been_sent(
PEP_SESSION session,
const char* from_addr,
@ -166,6 +178,17 @@ PEP_STATUS has_key_reset_been_sent(
const char* revoked_fpr,
bool* contacted);
/**
* <!-- set_reset_contact_notified() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *own_address constchar
* @param[in] *revoke_fpr constchar
* @param[in] *contact_id constchar
*
*/
PEP_STATUS set_reset_contact_notified(
PEP_SESSION session,
const char* own_address,
@ -173,9 +196,31 @@ PEP_STATUS set_reset_contact_notified(
const char* contact_id
);
/**
* <!-- receive_key_reset() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *reset_msg message
*
*/
PEP_STATUS receive_key_reset(PEP_SESSION session,
message* reset_msg);
/**
* <!-- create_standalone_key_reset_message() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] **dst message
* @param[in] *own_identity pEp_identity
* @param[in] *recip pEp_identity
* @param[in] *old_fpr constchar
* @param[in] *new_fpr constchar
*
*/
PEP_STATUS create_standalone_key_reset_message(PEP_SESSION session,
message** dst,
pEp_identity* own_identity,
@ -184,12 +229,43 @@ PEP_STATUS create_standalone_key_reset_message(PEP_SESSION session,
const char* new_fpr);
/**
* <!-- send_key_reset_to_recents() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *from_ident pEp_identity
* @param[in] *old_fpr constchar
* @param[in] *new_fpr constchar
*
*/
PEP_STATUS send_key_reset_to_recents(PEP_SESSION session,
pEp_identity* from_ident,
const char* old_fpr,
const char* new_fpr);
/**
* <!-- key_reset_commands_to_PER() -->
*
* @brief TODO
*
* @param[in] *command_list constkeyreset_command_list
* @param[in] **cmds char
* @param[in] *size size_t
*
*/
PEP_STATUS key_reset_commands_to_PER(const keyreset_command_list *command_list, char **cmds, size_t *size);
/**
* <!-- PER_to_key_reset_commands() -->
*
* @brief TODO
*
* @param[in] *cmds constchar
* @param[in] size size_t
* @param[in] **command_list keyreset_command_list
*
*/
PEP_STATUS PER_to_key_reset_commands(const char *cmds, size_t size, keyreset_command_list **command_list);
#ifdef __cplusplus

@ -122,6 +122,19 @@ DYNAMIC_API PEP_STATUS update_identity(
DYNAMIC_API PEP_STATUS myself(PEP_SESSION session, pEp_identity * identity);
/**
* <!-- _myself() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *identity pEp_identity
* @param[in] do_keygen bool
* @param[in] do_renew bool
* @param[in] ignore_flags bool
* @param[in] read_only bool
*
*/
PEP_STATUS _myself(PEP_SESSION session,
pEp_identity * identity,
bool do_keygen,
@ -367,6 +380,16 @@ DYNAMIC_API PEP_STATUS own_identities_retrieve(
identity_list **own_identities
);
/**
* <!-- contains_priv_key() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] *has_private bool
*
*/
PEP_STATUS contains_priv_key(PEP_SESSION session, const char *fpr,
bool *has_private);
@ -462,6 +485,16 @@ DYNAMIC_API PEP_STATUS set_own_key(
*/
DYNAMIC_API PEP_STATUS clean_own_key_defaults(PEP_SESSION session);
/**
* <!-- get_all_keys_for_user() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *user_id constchar
* @param[in] **keys stringlist_t
*
*/
PEP_STATUS get_all_keys_for_user(PEP_SESSION session,
const char* user_id,
stringlist_t** keys);
@ -469,9 +502,47 @@ PEP_STATUS get_all_keys_for_user(PEP_SESSION session,
//PEP_STATUS _myself(PEP_SESSION session, pEp_identity * identity, bool do_keygen, bool ignore_flags);
/**
* <!-- add_mistrusted_key() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
*
*/
PEP_STATUS add_mistrusted_key(PEP_SESSION session, const char* fpr);
/**
* <!-- delete_mistrusted_key() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
*
*/
PEP_STATUS delete_mistrusted_key(PEP_SESSION session, const char* fpr);
/**
* <!-- is_mistrusted_key() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] *mistrusted bool
*
*/
PEP_STATUS is_mistrusted_key(PEP_SESSION session, const char* fpr, bool* mistrusted);
/**
* <!-- get_user_default_key() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *user_id constchar
* @param[in] **default_key char
*
*/
PEP_STATUS get_user_default_key(PEP_SESSION session, const char* user_id,
char** default_key);
@ -482,6 +553,19 @@ PEP_STATUS get_user_default_key(PEP_SESSION session, const char* user_id,
// Also, we presume that if the stored_identity was sent in
// without an fpr, there wasn't one in the trust DB for this
// identity.
/**
* <!-- get_valid_pubkey() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *stored_identity pEp_identity
* @param[in] *is_identity_default bool
* @param[in] *is_user_default bool
* @param[in] *is_address_default bool
* @param[in] check_blacklist bool
*
*/
PEP_STATUS get_valid_pubkey(PEP_SESSION session,
pEp_identity* stored_identity,
bool* is_identity_default,

@ -27,12 +27,46 @@ typedef struct _labeled_int_list_t {
DYNAMIC_API labeled_int_list_t *new_labeled_int_list(int value, const char* label);
/**
* <!-- free_labeled_int_list() -->
*
* @brief TODO
*
* @param[in] *labeled_int_list labeled_int_list_t
*
*/
DYNAMIC_API void free_labeled_int_list(labeled_int_list_t *labeled_int_list);
/**
* <!-- labeled_int_list_dup() -->
*
* @brief TODO
*
* @param[in] *src constlabeled_int_list_t
*
*/
DYNAMIC_API labeled_int_list_t *labeled_int_list_dup(const labeled_int_list_t *src);
/**
* <!-- labeled_int_list_add() -->
*
* @brief TODO
*
* @param[in] *labeled_int_list labeled_int_list_t
* @param[in] value int
* @param[in] *label constchar
*
*/
DYNAMIC_API labeled_int_list_t *labeled_int_list_add(labeled_int_list_t *labeled_int_list, int value, const char* label);
/**
* <!-- labeled_int_list_length() -->
*
* @brief TODO
*
* @param[in] *labeled_int_list constlabeled_int_list_t
*
*/
DYNAMIC_API int labeled_int_list_length(const labeled_int_list_t *labeled_int_list);
#ifdef __cplusplus

@ -24,10 +24,37 @@ bool import_attached_keys(
uint64_t* changed_keys
);
/**
* <!-- attach_own_key() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *msg message
*
*/
void attach_own_key(PEP_SESSION session, message *msg);
/**
* <!-- determine_encryption_format() -->
*
* @brief TODO
*
* @param[in] *msg message
*
*/
PEP_cryptotech determine_encryption_format(message *msg);
/**
* <!-- add_opt_field() -->
*
* @brief TODO
*
* @param[in] *msg message
* @param[in] *name constchar
* @param[in] *value constchar
*
*/
void add_opt_field(message *msg, const char *name, const char *value);
typedef enum _PEP_encrypt_flags {
@ -602,6 +629,19 @@ DYNAMIC_API PEP_rating rating_from_comm_type(PEP_comm_type ct);
//
// do not use it in adapters
/**
* <!-- try_encrypt_message() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *src message
* @param[in] *extra stringlist_t
* @param[in] **dst message
* @param[in] enc_format PEP_enc_format
* @param[in] flags PEP_encrypt_flags_t
*
*/
PEP_STATUS try_encrypt_message(
PEP_SESSION session,
message *src,

@ -531,6 +531,18 @@ DYNAMIC_API PEP_STATUS log_event(
);
/**
* <!-- log_service() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *title constchar
* @param[in] *entity constchar
* @param[in] *description constchar
* @param[in] *comment constchar
*
*/
DYNAMIC_API PEP_STATUS log_service(PEP_SESSION session, const char *title,
const char *entity, const char *description, const char *comment);
@ -541,6 +553,17 @@ DYNAMIC_API PEP_STATUS log_service(PEP_SESSION session, const char *title,
#define SERVICE_LOG(session, title, entity, desc) \
log_service((session), (title), (entity), (desc), "service " __FILE__ ":" S_LINE)
/**
* <!-- _service_error_log() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *entity constchar
* @param[in] status PEP_STATUS
* @param[in] *where constchar
*
*/
DYNAMIC_API void _service_error_log(PEP_SESSION session, const char *entity,
PEP_STATUS status, const char *where);
@ -811,6 +834,16 @@ DYNAMIC_API PEP_STATUS get_identity(
pEp_identity **identity
);
/**
* <!-- replace_identities_fpr() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *old_fpr constchar
* @param[in] *new_fpr constchar
*
*/
PEP_STATUS replace_identities_fpr(PEP_SESSION session,
const char* old_fpr,
const char* new_fpr);
@ -1279,9 +1312,28 @@ DYNAMIC_API void *pEp_realloc(void *p, size_t size);
DYNAMIC_API PEP_STATUS get_trust(PEP_SESSION session, pEp_identity *identity);
/**
* <!-- set_trust() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *identity pEp_identity
*
*/
PEP_STATUS set_trust(PEP_SESSION session,
pEp_identity* identity);
/**
* <!-- update_trust_for_fpr() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] comm_type PEP_comm_type
*
*/
PEP_STATUS update_trust_for_fpr(PEP_SESSION session,
const char* fpr,
PEP_comm_type comm_type);
@ -1409,6 +1461,16 @@ DYNAMIC_API PEP_STATUS key_revoked(
bool *revoked
);
/**
* <!-- get_key_userids() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] **keylist stringlist_t
*
*/
PEP_STATUS get_key_userids(
PEP_SESSION session,
const char* fpr,
@ -1744,6 +1806,16 @@ DYNAMIC_API PEP_STATUS set_ident_enc_format(PEP_SESSION session,
PEP_enc_format format);
/**
* <!-- _generate_keypair() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *identity pEp_identity
* @param[in] suppress_event bool
*
*/
PEP_STATUS _generate_keypair(PEP_SESSION session,
pEp_identity *identity,
bool suppress_event);
@ -1761,6 +1833,17 @@ DYNAMIC_API PEP_STATUS reset_pEptest_hack(PEP_SESSION session);
// This is used internally when there is a temporary identity to be retrieved
// that may not yet have an FPR attached. See get_identity() for functionality,
// params and caveats.
/**
* <!-- get_identity_without_trust_check() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *address constchar
* @param[in] *user_id constchar
* @param[in] **identity pEp_identity
*
*/
PEP_STATUS get_identity_without_trust_check(
PEP_SESSION session,
const char *address,
@ -1768,38 +1851,127 @@ PEP_STATUS get_identity_without_trust_check(
pEp_identity **identity
);
/**
* <!-- get_identities_by_address() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *address constchar
* @param[in] **id_list identity_list
*
*/
PEP_STATUS get_identities_by_address(
PEP_SESSION session,
const char *address,
identity_list** id_list
);
/**
* <!-- get_identities_by_userid() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *user_id constchar
* @param[in] **identities identity_list
*
*/
PEP_STATUS get_identities_by_userid(
PEP_SESSION session,
const char *user_id,
identity_list **identities
);
/**
* <!-- is_own_address() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *address constchar
* @param[in] *is_own_addr bool
*
*/
PEP_STATUS is_own_address(PEP_SESSION session,
const char* address,
bool* is_own_addr);
/**
* <!-- replace_userid() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *old_uid constchar
* @param[in] *new_uid constchar
*
*/
PEP_STATUS replace_userid(PEP_SESSION session, const char* old_uid,
const char* new_uid);
/**
* <!-- remove_key() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
*
*/
PEP_STATUS remove_key(PEP_SESSION session, const char* fpr);
/**
* <!-- remove_fpr_as_default() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
*
*/
PEP_STATUS remove_fpr_as_default(PEP_SESSION session,
const char* fpr);
/**
* <!-- get_main_user_fpr() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *user_id constchar
* @param[in] **main_fpr char
*
*/
PEP_STATUS get_main_user_fpr(PEP_SESSION session,
const char* user_id,
char** main_fpr);
/**
* <!-- replace_main_user_fpr() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *user_id constchar
* @param[in] *new_fpr constchar
*
*/
PEP_STATUS replace_main_user_fpr(PEP_SESSION session, const char* user_id,
const char* new_fpr);
/**
* <!-- replace_main_user_fpr_if_equal() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *user_id constchar
* @param[in] *new_fpr constchar
* @param[in] *compare_fpr constchar
*
*/
PEP_STATUS replace_main_user_fpr_if_equal(PEP_SESSION session, const char* user_id,
const char* new_fpr, const char* compare_fpr);
@ -1810,24 +1982,93 @@ DYNAMIC_API PEP_STATUS get_replacement_fpr(
uint64_t *revocation_date
);
/**
* <!-- refresh_userid_default_key() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *user_id constchar
*
*/
PEP_STATUS refresh_userid_default_key(PEP_SESSION session, const char* user_id);
// This ONLY sets the *user* flag, and creates a shell identity if necessary.
/**
* <!-- set_as_pEp_user() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *user pEp_identity
*
*/
DYNAMIC_API PEP_STATUS set_as_pEp_user(PEP_SESSION session, pEp_identity* user);
// returns true (by reference) if a person with this user_id exists;
// Also replaces aliased user_ids by defaults in identity.
/**
* <!-- exists_person() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *identity pEp_identity
* @param[in] *exists bool
*
*/
PEP_STATUS exists_person(PEP_SESSION session, pEp_identity* identity, bool* exists);
/**
* <!-- set_pgp_keypair() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
*
*/
PEP_STATUS set_pgp_keypair(PEP_SESSION session, const char* fpr);
/**
* <!-- set_pEp_version() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *ident pEp_identity
* @param[in] new_ver_major unsignedint
* @param[in] new_ver_minor unsignedint
*
*/
PEP_STATUS set_pEp_version(PEP_SESSION session, pEp_identity* ident, unsigned int new_ver_major, unsigned int new_ver_minor);
/**
* <!-- clear_trust_info() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *user_id constchar
* @param[in] *fpr constchar
*
*/
PEP_STATUS clear_trust_info(PEP_SESSION session,
const char* user_id,
const char* fpr);
// Generally ONLY called by set_as_pEp_user, and ONLY from < 2.0 to 2.0.
/**
* <!-- upgrade_pEp_version_by_user_id() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *ident pEp_identity
* @param[in] new_ver_major unsignedint
* @param[in] new_ver_minor unsignedint
*
*/
PEP_STATUS upgrade_pEp_version_by_user_id(PEP_SESSION session,
pEp_identity* ident,
unsigned int new_ver_major,
@ -1835,31 +2076,113 @@ PEP_STATUS upgrade_pEp_version_by_user_id(PEP_SESSION session,
);
// exposed for testing
/**
* <!-- set_person() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *identity pEp_identity
* @param[in] guard_transaction bool
*
*/
PEP_STATUS set_person(PEP_SESSION session, pEp_identity* identity,
bool guard_transaction);
/**
* <!-- bind_own_ident_with_contact_ident() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *own_ident pEp_identity
* @param[in] *contact_ident pEp_identity
*
*/
PEP_STATUS bind_own_ident_with_contact_ident(PEP_SESSION session,
pEp_identity* own_ident,
pEp_identity* contact_ident);
/**
* <!-- get_last_contacted() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] **id_list identity_list
*
*/
PEP_STATUS get_last_contacted(
PEP_SESSION session,
identity_list** id_list
);
/**
* <!-- get_own_ident_for_contact_id() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *contact constpEp_identity
* @param[in] **own_ident pEp_identity
*
*/
PEP_STATUS get_own_ident_for_contact_id(PEP_SESSION session,
const pEp_identity* contact,
pEp_identity** own_ident);
/**
* <!-- exists_trust_entry() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *identity pEp_identity
* @param[in] *exists bool
*
*/
PEP_STATUS exists_trust_entry(PEP_SESSION session, pEp_identity* identity,
bool* exists);
/**
* <!-- is_own_key() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] *own_key bool
*
*/
PEP_STATUS is_own_key(PEP_SESSION session, const char* fpr, bool* own_key);
/**
* <!-- get_identities_by_main_key_id() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] **identities identity_list
*
*/
PEP_STATUS get_identities_by_main_key_id(
PEP_SESSION session,
const char *fpr,
identity_list **identities);
/**
* <!-- sign_only() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *data constchar
* @param[in] data_size size_t
* @param[in] *fpr constchar
* @param[in] **sign char
* @param[in] *sign_size size_t
*
*/
PEP_STATUS sign_only(PEP_SESSION session,
const char *data,
size_t data_size,
@ -1867,9 +2190,29 @@ PEP_STATUS sign_only(PEP_SESSION session,
char **sign,
size_t *sign_size);
/**
* <!-- set_all_userids_to_own() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *id_list identity_list
*
*/
PEP_STATUS set_all_userids_to_own(PEP_SESSION session,
identity_list* id_list);
/**
* <!-- has_partner_contacted_address() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *partner_id constchar
* @param[in] *own_address constchar
* @param[in] *was_contacted bool
*
*/
PEP_STATUS has_partner_contacted_address(PEP_SESSION session, const char* partner_id,
const char* own_address, bool* was_contacted);

@ -305,11 +305,36 @@ PEP_STATUS init_transport_system(PEP_SESSION session, bool in_first);
void release_transport_system(PEP_SESSION session, bool out_last);
/* NOT to be exposed to the outside!!! */
/**
* <!-- encrypt_only() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *keylist conststringlist_t
* @param[in] *ptext constchar
* @param[in] psize size_t
* @param[in] **ctext char
* @param[in] *csize size_t
*
*/
PEP_STATUS encrypt_only(
PEP_SESSION session, const stringlist_t *keylist, const char *ptext,
size_t psize, char **ctext, size_t *csize
);
/**
* <!-- decorate_message() -->
*
* @brief TODO
*
* @param[in] *msg message
* @param[in] rating PEP_rating
* @param[in] *keylist stringlist_t
* @param[in] add_version bool
* @param[in] clobber bool
*
*/
void decorate_message(
message *msg,
PEP_rating rating,
@ -339,6 +364,14 @@ typedef enum _normalize_hex_rest_t {
reject_hex
} normalize_hex_res_t;
/**
* <!-- _normalize_hex() -->
*
* @brief TODO
*
* @param[in] *hex char
*
*/
static inline normalize_hex_res_t _normalize_hex(char *hex)
{
if (*hex >= '0' && *hex <= '9')
@ -359,6 +392,18 @@ static inline normalize_hex_res_t _normalize_hex(char *hex)
}
// Space tolerant and case insensitive fingerprint string compare
/**
* <!-- _compare_fprs() -->
*
* @brief TODO
*
* @param[in] *fpra constchar
* @param[in] fpras size_t
* @param[in] *fprb constchar
* @param[in] fprbs size_t
* @param[in] *comparison int
*
*/
static inline PEP_STATUS _compare_fprs(
const char* fpra,
size_t fpras,
@ -436,6 +481,17 @@ static inline PEP_STATUS _compare_fprs(
return PEP_STATUS_OK;
}
/**
* <!-- _same_fpr() -->
*
* @brief TODO
*
* @param[in] *fpra constchar
* @param[in] fpras size_t
* @param[in] *fprb constchar
* @param[in] fprbs size_t
*
*/
static inline int _same_fpr(
const char* fpra,
size_t fpras,
@ -454,6 +510,16 @@ static inline int _same_fpr(
// size is the length of the bytestr that's coming in. This is really only intended
// for comparing two full strings. If charstr's length is different from bytestr_size,
// we'll return a non-zero value.
/**
* <!-- _unsigned_signed_strcmp() -->
*
* @brief TODO
*
* @param[in] *bytestr constunsignedchar
* @param[in] *charstr constchar
* @param[in] bytestr_size int
*
*/
static inline int _unsigned_signed_strcmp(const unsigned char* bytestr, const char* charstr, int bytestr_size) {
int charstr_len = strlen(charstr);
if (charstr_len != bytestr_size)
@ -473,6 +539,15 @@ static inline char* _pEp_subj_copy() {
#endif
}
/**
* <!-- is_me() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *test_ident constpEp_identity
*
*/
static inline bool is_me(PEP_SESSION session, const pEp_identity* test_ident) {
bool retval = false;
if (test_ident && test_ident->user_id) {
@ -487,6 +562,14 @@ static inline bool is_me(PEP_SESSION session, const pEp_identity* test_ident) {
return retval;
}
/**
* <!-- pEp_version_numeric() -->
*
* @brief TODO
*
* @param[in] *version_str constchar
*
*/
static inline float pEp_version_numeric(const char* version_str) {
float retval = 0;
@ -496,6 +579,16 @@ static inline float pEp_version_numeric(const char* version_str) {
return retval;
}
/**
* <!-- pEp_version_major_minor() -->
*
* @brief TODO
*
* @param[in] *version_str constchar
* @param[in] *major unsignedint
* @param[in] *minor unsignedint
*
*/
static inline void pEp_version_major_minor(const char* version_str, unsigned int* major, unsigned int* minor) {
if (!major || !minor)
return;
@ -532,6 +625,19 @@ static inline int compare_versions(unsigned int first_maj, unsigned int first_mi
return 0;
}
/**
* <!-- set_min_version() -->
*
* @brief TODO
*
* @param[in] first_maj unsignedint
* @param[in] first_minor unsignedint
* @param[in] second_maj unsignedint
* @param[in] second_minor unsignedint
* @param[in] *result_maj unsignedint
* @param[in] *result_minor unsignedint
*
*/
static inline void set_min_version(unsigned int first_maj, unsigned int first_minor,
unsigned int second_maj, unsigned int second_minor,
unsigned int* result_maj, unsigned int* result_minor) {
@ -546,6 +652,19 @@ static inline void set_min_version(unsigned int first_maj, unsigned int first_mi
}
}
/**
* <!-- set_max_version() -->
*
* @brief TODO
*
* @param[in] first_maj unsignedint
* @param[in] first_minor unsignedint
* @param[in] second_maj unsignedint
* @param[in] second_minor unsignedint
* @param[in] *result_maj unsignedint
* @param[in] *result_minor unsignedint
*
*/
static inline void set_max_version(unsigned int first_maj, unsigned int first_minor,
unsigned int second_maj, unsigned int second_minor,
unsigned int* result_maj, unsigned int* result_minor) {

@ -29,6 +29,22 @@ PEP_STATUS pgp_init(PEP_SESSION session, bool in_first);
*/
void pgp_release(PEP_SESSION session, bool out_last);
/**
* <!-- pgp_decrypt_and_verify() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *ctext constchar
* @param[in] csize size_t
* @param[in] *dsigtext constchar
* @param[in] dsigsize size_t
* @param[in] **ptext char
* @param[in] *psize size_t
* @param[in] **keylist stringlist_t
* @param[in] **filename_ptr char
*
*/
PEP_STATUS pgp_decrypt_and_verify(
PEP_SESSION session, const char *ctext, size_t csize,
const char *dsigtext, size_t dsigsize,
@ -36,46 +52,158 @@ PEP_STATUS pgp_decrypt_and_verify(
char** filename_ptr
);
/**
* <!-- pgp_encrypt_and_sign() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *keylist conststringlist_t
* @param[in] *ptext constchar
* @param[in] psize size_t
* @param[in] **ctext char
* @param[in] *csize size_t
*
*/
PEP_STATUS pgp_encrypt_and_sign(
PEP_SESSION session, const stringlist_t *keylist, const char *ptext,
size_t psize, char **ctext, size_t *csize
);
/**
* <!-- pgp_sign_only() -->
*