Browse Source

Hopefully rest of generated function blocks in. It's definitely a mess and not well-formatted at this point, so don't freak out. It's just the placeholders to fill in.

doxygen-key-id
parent
commit
42e6bee7fb
10 changed files with 591 additions and 132 deletions
  1. +1
    -1
      engine_doxygen.conf
  2. +11
    -0
      src/base64.c
  3. +88
    -0
      src/message_api.c
  4. +12
    -0
      src/message_api.h
  5. +108
    -0
      src/pEpEngine.c
  6. +11
    -0
      src/pEpEngine.h
  7. +14
    -0
      src/pEp_internal.h
  8. +195
    -15
      src/pgp_sequoia.c
  9. +142
    -116
      src/pgp_sequoia.h
  10. +9
    -0
      src/platform_windows.h

+ 1
- 1
engine_doxygen.conf View File

@ -549,7 +549,7 @@ HIDE_IN_BODY_DOCS = NO
# will be excluded. Set it to YES to include the internal documentation.
# The default value is: NO.
INTERNAL_DOCS = NO
INTERNAL_DOCS = YES
# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
# names in lower-case letters. If set to YES, upper-case letters are also


+ 11
- 0
src/base64.c View File

@ -126,6 +126,17 @@ char next_char(const char** input_ptr, const char* end) {
}
// 4 chars = 3 output bytes
/**
* @internal
*
* <!-- base64_str_to_binary_blob() -->
*
* @brief TODO
*
* @param[in] *input const char
* @param[in] length int
*
*/
bloblist_t* base64_str_to_binary_blob(const char* input, int length) {
if (length == 0)
return NULL;


+ 88
- 0
src/message_api.c View File

@ -286,6 +286,17 @@ static char* _get_resource_ptr_noown(char* uri) {
return uri + 3;
}
/**
* @internal
*
* <!-- string_equality() -->
*
* @brief TODO
*
* @param[in] *s1 const char
* @param[in] *s2 const char
*
*/
static bool string_equality(const char *s1, const char *s2)
{
if (s1 == NULL || s2 == NULL)
@ -513,6 +524,17 @@ unsigned long long get_bitmask(int num_bits) {
return bitmask;
}
/**
* @internal
*
* <!-- get_base_36_rep() -->
*
* @brief TODO
*
* @param[in] value unsigned long long
* @param[in] num_sig_bits int
*
*/
static char* get_base_36_rep(unsigned long long value, int num_sig_bits) {
int bufsize = ((int) ceil((double) num_sig_bits / _pEp_log2_36)) + 1;
@ -1662,6 +1684,17 @@ static PEP_rating key_rating(PEP_SESSION session, const char *fpr)
return _rating(resulting_comm_type);
}
/**
* @internal
*
* <!-- worst_rating() -->
*
* @brief TODO
*
* @param[in] rating1 PEP_rating
* @param[in] rating2 PEP_rating
*
*/
static PEP_rating worst_rating(PEP_rating rating1, PEP_rating rating2) {
return ((rating1 < rating2) ? rating1 : rating2);
}
@ -1906,6 +1939,20 @@ static bool compare_first_n_bytes(const char* first, const char* second, size_t
return true;
}
/**
* @internal
*
* <!-- import_attached_keys() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *msg message
* @param[in] **private_idents identity_list
* @param[in] **imported_key_list stringlist_t
* @param[in] *changed_keys uint64_t
*
*/
bool import_attached_keys(
PEP_SESSION session,
message *msg,
@ -3766,6 +3813,22 @@ static PEP_STATUS _decrypt_in_pieces(PEP_SESSION session,
}
// This is misleading - this imports ALL the keys!
/**
* @internal
*
* <!-- import_keys_from_decrypted_msg() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *msg message
* @param[in] *keys_were_imported bool
* @param[in] *imported_private bool
* @param[in] **private_il identity_list
* @param[in] **keylist stringlist_t
* @param[in] *changed_keys uint64_t
*
*/
static PEP_STATUS import_keys_from_decrypted_msg(PEP_SESSION session,
message* msg,
bool* keys_were_imported,
@ -4193,6 +4256,19 @@ static char* seek_good_trusted_private_fpr(PEP_SESSION session, char* own_id,
return NULL;
}
/**
* @internal
*
* <!-- import_header_keys() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *src message
* @param[in] **imported_key_list stringlist_t
* @param[in] *changed_keys uint64_t
*
*/
static bool import_header_keys(PEP_SESSION session, message* src, stringlist_t** imported_key_list, uint64_t* changed_keys) {
stringpair_list_t* header_keys = stringpair_list_find(src->opt_fields, "Autocrypt");
if (!header_keys || !header_keys->value)
@ -5789,6 +5865,18 @@ DYNAMIC_API PEP_STATUS get_trustwords(
wsize, full);
}
/**
* @internal
*
* <!-- remove_separators() -->
*
* @brief TODO
*
* @param[in] *str1 const char
* @param[in] *str2 char
* @param[in] str1len int
*
*/
static void remove_separators(const char* str1, char* str2, int str1len) {
int i = 0;
char* curr_write = str2;


+ 12
- 0
src/message_api.h View File

@ -16,6 +16,18 @@
extern "C" {
#endif
/**
* <!-- import_attached_keys() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *msg message
* @param[in] **private_idents identity_list
* @param[in] **imported_keys stringlist_t
* @param[in] *changed_keys uint64_t
*
*/
bool import_attached_keys(
PEP_SESSION session,
message *msg,


+ 108
- 0
src/pEpEngine.c View File

@ -21,6 +21,18 @@
static volatile int init_count = -1;
// sql overloaded functions - modified from sqlite3.c
/**
* @internal
*
* <!-- _sql_lower() -->
*
* @brief TODO
*
* @param[in] *ctx sqlite3_context
* @param[in] argc int
* @param[in] **argv sqlite3_value
*
*/
static void _sql_lower(sqlite3_context* ctx, int argc, sqlite3_value** argv) {
const char *z2;
int n;
@ -45,6 +57,19 @@ static void _sql_lower(sqlite3_context* ctx, int argc, sqlite3_value** argv) {
}
#ifdef _PEP_SQLITE_DEBUG
/**
* @internal
*
* <!-- sql_trace_callback() -->
*
* @brief TODO
*
* @param[in] trace_constant unsigned
* @param[in] *context_ptr void
* @param[in] *P void
* @param[in] *X void
*
*/
int sql_trace_callback (unsigned trace_constant,
void* context_ptr,
void* P,
@ -884,6 +909,16 @@ void errorLogCallback(void *pArg, int iErrCode, const char *zMsg){
fprintf(stderr, "(%d) %s\n", iErrCode, zMsg);
}
/**
* @internal
*
* <!-- upgrade_revoc_contact_to_13() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
*
*/
static PEP_STATUS upgrade_revoc_contact_to_13(PEP_SESSION session) {
// I HATE SQLITE.
PEP_STATUS status = PEP_STATUS_OK;
@ -3279,6 +3314,18 @@ PEP_STATUS clear_trust_info(PEP_SESSION session,
return PEP_STATUS_OK;
}
/**
* @internal
*
* <!-- _set_or_update_trust() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *identity pEp_identity
* @param[in] *set_or_update sqlite3_stmt
*
*/
static PEP_STATUS _set_or_update_trust(PEP_SESSION session,
pEp_identity* identity,
sqlite3_stmt* set_or_update) {
@ -3307,6 +3354,18 @@ static PEP_STATUS _set_or_update_trust(PEP_SESSION session,
return PEP_STATUS_OK;
}
/**
* @internal
*
* <!-- _set_or_update_identity_entry() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *identity pEp_identity
* @param[in] *set_or_update sqlite3_stmt
*
*/
static PEP_STATUS _set_or_update_identity_entry(PEP_SESSION session,
pEp_identity* identity,
sqlite3_stmt* set_or_update) {
@ -3334,6 +3393,18 @@ static PEP_STATUS _set_or_update_identity_entry(PEP_SESSION session,
return PEP_STATUS_OK;
}
/**
* @internal
*
* <!-- _set_or_update_person() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *identity pEp_identity
* @param[in] *set_or_update sqlite3_stmt
*
*/
static PEP_STATUS _set_or_update_person(PEP_SESSION session,
pEp_identity* identity,
sqlite3_stmt* set_or_update) {
@ -5102,6 +5173,18 @@ static void _clean_log_value(char *text)
}
}
/**
* @internal
*
* <!-- _concat_string() -->
*
* @brief TODO
*
* @param[in] *str1 char
* @param[in] *str2 const char
* @param[in] delim char
*
*/
static char *_concat_string(char *str1, const char *str2, char delim)
{
str2 = str2 ? str2 : "";
@ -5338,6 +5421,18 @@ the_end:
return status;
}
/**
* @internal
*
* <!-- _get_sequence_value() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *name const char
* @param[in] *value int32_t
*
*/
static PEP_STATUS _get_sequence_value(PEP_SESSION session, const char *name,
int32_t *value)
{
@ -5537,6 +5632,19 @@ DYNAMIC_API PEP_STATUS get_revoked(
return status;
}
/**
* @internal
*
* <!-- get_replacement_fpr() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *fpr const char
* @param[in] **revoked_fpr char
* @param[in] *revocation_date uint64_t
*
*/
DYNAMIC_API PEP_STATUS get_replacement_fpr(
PEP_SESSION session,
const char *fpr,


+ 11
- 0
src/pEpEngine.h View File

@ -2005,6 +2005,17 @@ PEP_STATUS replace_main_user_fpr(PEP_SESSION session, const char* user_id,
PEP_STATUS replace_main_user_fpr_if_equal(PEP_SESSION session, const char* user_id,
const char* new_fpr, const char* compare_fpr);
/**
* <!-- get_replacement_fpr() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *fpr const char
* @param[in] **revoked_fpr char
* @param[in] *revocation_date uint64_t
*
*/
DYNAMIC_API PEP_STATUS get_replacement_fpr(
PEP_SESSION session,
const char *fpr,


+ 14
- 0
src/pEp_internal.h View File

@ -545,6 +545,13 @@ static inline int _unsigned_signed_strcmp(const unsigned char* bytestr, const ch
}
// This is just a horrible example of C type madness. UTF-8 made me do it.
/**
* <!-- _pEp_subj_copy() -->
*
* @brief TODO
*
*
*/
static inline char* _pEp_subj_copy() {
#ifndef WIN32
unsigned char pEpstr[] = PEP_SUBJ_STRING;
@ -721,6 +728,13 @@ static inline void set_max_version(unsigned int first_maj, unsigned int first_mi
extern int _pEp_rand_max_bits;
extern double _pEp_log2_36;
/**
* <!-- _init_globals() -->
*
* @brief TODO
*
*
*/
static inline void _init_globals() {
_pEp_rand_max_bits = (int) ceil(log2((double) RAND_MAX));
_pEp_log2_36 = log2(36);


+ 195
- 15
src/pgp_sequoia.c View File

@ -106,6 +106,19 @@
} while(0)
#ifdef _PEP_SQLITE_DEBUG
/**
* @internal
*
* <!-- sq_sql_trace_callback() -->
*
* @brief TODO
*
* @param[in] trace_constant unsigned
* @param[in] *context_ptr void
* @param[in] *P void
* @param[in] *X void
*
*/
int sq_sql_trace_callback (unsigned trace_constant,
void* context_ptr,
void* P,
@ -697,6 +710,19 @@ static char *pgp_fingerprint_canonicalize(const char *fpr)
// step statement and load the certificate and secret.
/**
* @internal
*
* <!-- key_load() -->
*
* @brief TODO
*
* @param[in] PEP_SESSION PEP_SESSION
* @param[in] * sqlite3_stmt
* @param[in] * pgp_cert_t
* @param[in] * int
*
*/
static PEP_STATUS key_load(PEP_SESSION, sqlite3_stmt *, pgp_cert_t *, int *)
__attribute__((nonnull(1, 2)));
static PEP_STATUS key_load(PEP_SESSION session, sqlite3_stmt *stmt,
@ -737,6 +763,19 @@ static PEP_STATUS key_load(PEP_SESSION session, sqlite3_stmt *stmt,
// step statement until exhausted and load the certificates.
/**
* @internal
*
* <!-- key_loadn() -->
*
* @brief TODO
*
* @param[in] PEP_SESSION PEP_SESSION
* @param[in] * sqlite3_stmt
* @param[in] ** pgp_cert_t
* @param[in] * int
*
*/
static PEP_STATUS key_loadn(PEP_SESSION, sqlite3_stmt *, pgp_cert_t **, int *)
__attribute__((nonnull));
static PEP_STATUS key_loadn(PEP_SESSION session, sqlite3_stmt *stmt,
@ -1386,6 +1425,24 @@ get_public_keys_cb(void *cookie_raw,
return PGP_STATUS_SUCCESS;
}
/**
* @internal
*
* <!-- decrypt_cb() -->
*
* @brief TODO
*
* @param[in] *cookie_opaque void
* @param[in] *pkesks pgp_pkesk_t
* @param[in] pkesk_count size_t
* @param[in] *skesks pgp_skesk_t
* @param[in] skesk_count size_t
* @param[in] symmetric_algo uint8_t
* @param[in] *decrypt pgp_decryptor_do_decrypt_cb_t
* @param[in] *decrypt_cookie void
* @param[in] *identity_out pgp_fingerprint_t
*
*/
static pgp_status_t
decrypt_cb(void *cookie_opaque,
pgp_pkesk_t *pkesks, size_t pkesk_count,
@ -2795,6 +2852,21 @@ static unsigned int count_keydata_parts(const char* key_data, size_t size) {
// This is for single keys, which is why we're using a boolean here.
/**
* @internal
*
* <!-- _pgp_import_keydata() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *key_data const char
* @param[in] size size_t
* @param[in] **private_idents identity_list
* @param[in] **imported_keys stringlist_t
* @param[in] *changed_bitvec uint64_t
*
*/
PEP_STATUS _pgp_import_keydata(PEP_SESSION session, const char *key_data,
size_t size, identity_list **private_idents,
stringlist_t** imported_keys,
@ -3143,6 +3215,16 @@ PEP_STATUS pgp_export_keydata(
*
* @ownership ownership of the retval goes to the calle
*/
/**
* @internal
*
* <!-- _undot_address() -->
*
* @brief TODO
*
* @param[in] *address const char
*
*/
static char *_undot_address(const char* address) {
if (!address)
return NULL;
@ -3194,6 +3276,20 @@ static char *_undot_address(const char* address) {
*
* @todo do we need null checks here? I think we do.
*/
/**
* @internal
*
* <!-- add_key() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *keyinfo_list stringpair_list_t
* @param[in] *keylist stringlist_t
* @param[in] cert pgp_cert_t
* @param[in] fpr pgp_fingerprint_t
*
*/
static stringpair_list_t *add_key(PEP_SESSION session,
stringpair_list_t *keyinfo_list,
stringlist_t* keylist,
@ -3259,6 +3355,20 @@ static stringpair_list_t *add_key(PEP_SESSION session,
* @todo what if both output params are NULL? What does it mean?
*
*/
/**
* @internal
*
* <!-- list_keys() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *pattern const char
* @param[in] private_only int
* @param[in] **keyinfo_list stringpair_list_t
* @param[in] **keylist stringlist_t
*
*/
static PEP_STATUS list_keys(PEP_SESSION session,
const char* pattern, int private_only,
stringpair_list_t** keyinfo_list, stringlist_t** keylist)
@ -3383,18 +3493,12 @@ PEP_STATUS pgp_recv_key(PEP_SESSION session, const char *pattern)
return PEP_UNKNOWN_ERROR;
}
// Unlike pgp_list_keyinfo, this function returns revoked keys.
PEP_STATUS pgp_find_keys(
PEP_SESSION session, const char *pattern, stringlist_t **keylist)
{
return list_keys(session, pattern, false, NULL, keylist);
}
// Unlike pgp_list_keyinfo, this function returns revoked keys.
PEP_STATUS pgp_find_private_keys(
PEP_SESSION session, const char *pattern, stringlist_t **keylist)
{
@ -3612,14 +3716,30 @@ PEP_STATUS pgp_revoke_key(
*
* <!-- _pgp_contains_encryption_subkey() -->
*
* @brief TODO
* @brief Returns true if the input cert contains an encryption subkey
*
* @param[in] session PEP_SESSION
* @param[in] cert pgp_cert_t
* @param[out] has_subkey bool
* @param[in] cert cert to check
* @param[out] has_subkey true if there's an encryption subkey, else false
*
* @note Doesn't check the *validity* of these subkeys.
* Just checks to see if they exist.
*
* @todo If this doesn't check the validity, why is it using valid_key_iter???
* I am probably just confused, but check with neal. What does valid mean
* in this respect?
*/
/**
* @internal
*
* <!-- _pgp_contains_encryption_subkey() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] cert pgp_cert_t
* @param[in] *has_subkey bool
*
*/
static void _pgp_contains_encryption_subkey(PEP_SESSION session, pgp_cert_t cert, bool* has_subkey) {
pgp_cert_valid_key_iter_t key_iter
@ -3641,14 +3761,30 @@ static void _pgp_contains_encryption_subkey(PEP_SESSION session, pgp_cert_t cert
*
* <!-- _pgp_contains_sig_subkey() -->
*
* @brief TODO
* @brief Returns true if the input cert contains an encryption subkey
*
* @param[in] session PEP_SESSION
* @param[in] cert pgp_cert_t
* @param[out] has_subkey bool
* @param[in] cert cert to check
* @param[out] has_subkey true if there's a signing subkey, else false
*
* @note Doesn't check the *validity* of these subkeys.
* Just checks to see if they exist.
*
* @todo If this doesn't check the validity, why is it using valid_key_iter???
* I am probably just confused, but check with neal. What does valid mean
* in this respect?
*/
/**
* @internal
*
* <!-- _pgp_contains_sig_subkey() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] cert pgp_cert_t
* @param[in] *has_subkey bool
*
*/
static void _pgp_contains_sig_subkey(PEP_SESSION session, pgp_cert_t cert, bool* has_subkey) {
pgp_cert_valid_key_iter_t key_iter
@ -3668,11 +3804,30 @@ static void _pgp_contains_sig_subkey(PEP_SESSION session, pgp_cert_t cert, bool*
*
* <!-- _pgp_key_broken() -->
*
* @brief Check to see that key, at a minimum, even contains encryption or signing subkeys
* @brief Check to see that key, at a minimum, even contains encryption and signing subkeys;
* if not, return false
*
* @param[in] session PEP_SESSION
* @param[in] cert pgp_cert_t
* @param[in] *is_broken bool
* @param[in] cert cert to check
* @param[out] is_broken false if both encryption and signing subkeys exist for this key,
* else true
* @note Doesn't check the *validity* of these subkeys.
* Just checks to see if they exist.
*
* @todo If this doesn't check the validity, why do the check functions use valid_key_iter???
* I am probably just confused, but check with neal. What does valid mean
* in this respect?
*/
/**
* @internal
*
* <!-- _pgp_key_broken() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] cert pgp_cert_t
* @param[in] *is_broken bool
*
*/
static void _pgp_key_broken(PEP_SESSION session, pgp_cert_t cert, bool* is_broken) {
@ -3701,6 +3856,19 @@ static void _pgp_key_broken(PEP_SESSION session, pgp_cert_t cert, bool* is_broke
* @param[out] expired contains true if key expired, else false
*
*/
/**
* @internal
*
* <!-- _pgp_key_expired() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] cert pgp_cert_t
* @param[in] when const time_t
* @param[in] *expired bool
*
*/
static void _pgp_key_expired(PEP_SESSION session, pgp_cert_t cert, const time_t when, bool* expired)
{
// Is the certificate live?
@ -3815,6 +3983,18 @@ PEP_STATUS pgp_key_expired(PEP_SESSION session, const char *fpr,
* @param[in] *revoked bool
*
*/
/**
* @internal
*
* <!-- _pgp_key_revoked() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] cert pgp_cert_t
* @param[in] *revoked bool
*
*/
static void _pgp_key_revoked(PEP_SESSION session, pgp_cert_t cert, bool* revoked) {
pgp_revocation_status_t rs = pgp_cert_revocation_status(cert, session->policy, 0);
*revoked = pgp_revocation_status_variant(rs) == PGP_REVOCATION_STATUS_REVOKED;


+ 142
- 116
src/pgp_sequoia.h View File

@ -8,6 +8,9 @@
*
* @see https://sequoia-pgp.org/
* @see https://docs.sequoia-pgp.org/sequoia_ffi/index.html
*
* @todo more doc
* @todo tidy up tabs
*/
#pragma once
@ -19,8 +22,8 @@
*
* @brief initialise the sequoia driver for this session
*
* @param[in] session PEP_SESSION
* @param[in] in_first true if this is the first pEp session running
* @param[in] session PEP_SESSION
* @param[in] in_first true if this is the first pEp session running
* after startup, else false
*
*/
@ -31,8 +34,8 @@ PEP_STATUS pgp_init(PEP_SESSION session, bool in_first);
*
* @brief release resources used by the sequoia driver in this session
*
* @param[in] session PEP_SESSION
* @param[in] out_last true if this is the last extant pEp session
* @param[in] session PEP_SESSION
* @param[in] out_last true if this is the last extant pEp session
* running, else false
*
*/
@ -41,17 +44,17 @@ void pgp_release(PEP_SESSION session, bool out_last);
/**
* <!-- pgp_decrypt_and_verify() -->
*
* @brief TODO
* @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
* @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(
@ -64,14 +67,14 @@ PEP_STATUS pgp_decrypt_and_verify(
/**
* <!-- pgp_encrypt_and_sign() -->
*
* @brief TODO
* @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
* @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(
@ -82,14 +85,14 @@ PEP_STATUS pgp_encrypt_and_sign(
/**
* <!-- pgp_sign_only() -->
*
* @brief TODO
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] *ptext constchar
* @param[in] psize size_t
* @param[in] **stext char
* @param[in] *ssize size_t
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] *ptext constchar
* @param[in] psize size_t
* @param[in] **stext char
* @param[in] *ssize size_t
*
*/
PEP_STATUS pgp_sign_only(
@ -100,14 +103,14 @@ PEP_STATUS pgp_sign_only(
/**
* <!-- pgp_encrypt_only() -->
*
* @brief TODO
* @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
* @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_only(
@ -119,14 +122,14 @@ PEP_STATUS pgp_encrypt_only(
/**
* <!-- pgp_verify_text() -->
*
* @brief TODO
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *text constchar
* @param[in] size size_t
* @param[in] *signature constchar
* @param[in] sig_size size_t
* @param[in] **keylist stringlist_t
* @param[in] session PEP_SESSION
* @param[in] *text constchar
* @param[in] size size_t
* @param[in] *signature constchar
* @param[in] sig_size size_t
* @param[in] **keylist stringlist_t
*
*/
PEP_STATUS pgp_verify_text(
@ -137,10 +140,10 @@ PEP_STATUS pgp_verify_text(
/**
* <!-- pgp_delete_keypair() -->
*
* @brief TODO
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
*
*/
PEP_STATUS pgp_delete_keypair(PEP_SESSION session, const char *fpr);
@ -148,13 +151,13 @@ PEP_STATUS pgp_delete_keypair(PEP_SESSION session, const char *fpr);
/**
* <!-- pgp_export_keydata() -->
*
* @brief TODO
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] **key_data char
* @param[in] *size size_t
* @param[in] secret bool
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] **key_data char
* @param[in] *size size_t
* @param[in] secret bool
*
*/
PEP_STATUS pgp_export_keydata(
@ -165,12 +168,17 @@ PEP_STATUS pgp_export_keydata(
/**
* <!-- pgp_find_keys() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *pattern constchar
* @param[in] **keylist stringlist_t
* @brief Find all keys (as fpr strings) which match this fpr or OpenPGP
* userid pattern
*
* @param[in] session PEP_SESSION
* @param[in] pattern Pattern to search for; could be empty,
* an fpr, or a mailbox (email, URI, etc).
* @param[in,out] keylist A list of fprs containing matching keys.
*
* @note Unlike pgp_list_keyinfo, this function returns revoked keys.
*
* @see pgp_list_keyinfo()
*/
PEP_STATUS pgp_find_keys(
PEP_SESSION session, const char *pattern, stringlist_t **keylist
@ -179,14 +187,14 @@ PEP_STATUS pgp_find_keys(
/**
* <!-- pgp_list_keyinfo() -->
*
* @brief Find all keys (in <fpr, OpenPGP uid> pairs which match this fpr
* or other OpenPGP userid pattern
* @brief Find all keys (returning <fpr, OpenPGP uid> pairs) which match this fpr
* or OpenPGP userid pattern
*
* @param[in] session PEP_SESSION
* @param[in] pattern Pattern to search for; could be empty,
* an fpr, or a mailbox (email, URI, etc).
* @param[in,out] keyinfo_list A list of <fpr, OpenPGP userid> tuples for the
* matching keys.
* @param[in] session PEP_SESSION
* @param[in] pattern Pattern to search for; could be empty,
* an fpr, or a mailbox (email, URI, etc).
* @param[in,out] keyinfo_list A list of <fpr, OpenPGP userid> tuples for the
* matching keys.
*
* @note This function filters out revoked keys, but NOT expired keys.
*/
@ -197,10 +205,10 @@ PEP_STATUS pgp_list_keyinfo(
/**
* <!-- pgp_generate_keypair() -->
*
* @brief TODO
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *identity pEp_identity
* @param[in] session PEP_SESSION
* @param[in] *identity pEp_identity
*
*/
PEP_STATUS pgp_generate_keypair(
@ -210,11 +218,11 @@ PEP_STATUS pgp_generate_keypair(
/**
* <!-- pgp_get_key_rating() -->
*
* @brief TODO
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] *comm_type PEP_comm_type
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] *comm_type PEP_comm_type
*
*/
PEP_STATUS pgp_get_key_rating(
@ -223,6 +231,19 @@ PEP_STATUS pgp_get_key_rating(
PEP_comm_type *comm_type
);
/**
* <!-- pgp_import_keydata() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *key_data const char
* @param[in] size size_t
* @param[in] **private_idents identity_list
* @param[in] **imported_keys stringlist_t
* @param[in] *changed_key_index uint64_t
*
*/
PEP_STATUS pgp_import_keydata(PEP_SESSION session, const char *key_data,
size_t size, identity_list **private_idents,
stringlist_t** imported_keys,
@ -231,12 +252,12 @@ PEP_STATUS pgp_import_keydata(PEP_SESSION session, const char *key_data,
/**
* <!-- pgp_import_private_keydata() -->
*
* @brief TODO
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *key_data constchar
* @param[in] size size_t
* @param[in] **private_idents identity_list
* @param[in] session PEP_SESSION
* @param[in] *key_data constchar
* @param[in] size size_t
* @param[in] **private_idents identity_list
*
*/
PEP_STATUS pgp_import_private_keydata(PEP_SESSION session, const char *key_data,
@ -245,20 +266,20 @@ PEP_STATUS pgp_import_private_keydata(PEP_SESSION session, const char *key_data,
/**
* <!-- pgp_recv_key() -->
*
* @brief TODO
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *pattern constchar
* @param[in] session PEP_SESSION
* @param[in] *pattern constchar
*
*/
PEP_STATUS pgp_recv_key(PEP_SESSION session, const char *pattern);
/**
* <!-- pgp_send_key() -->
*
* @brief TODO
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *pattern constchar
* @param[in] session PEP_SESSION
* @param[in] *pattern constchar
*
*/
PEP_STATUS pgp_send_key(PEP_SESSION session, const char *pattern);
@ -266,11 +287,11 @@ PEP_STATUS pgp_send_key(PEP_SESSION session, const char *pattern);
/**
* <!-- pgp_renew_key() -->
*
* @brief TODO
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] *ts consttimestamp
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] *ts consttimestamp
*
*/
PEP_STATUS pgp_renew_key(
@ -282,11 +303,11 @@ PEP_STATUS pgp_renew_key(
/**
* <!-- pgp_revoke_key() -->
*
* @brief TODO
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] *reason constchar
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] *reason constchar
*
*/
PEP_STATUS pgp_revoke_key(
@ -298,12 +319,12 @@ PEP_STATUS pgp_revoke_key(
/**
* <!-- pgp_key_expired() -->
*
* @brief TODO
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] when consttime_t
* @param[in] *expired bool
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] when consttime_t
* @param[in] *expired bool
*
*/
PEP_STATUS pgp_key_expired(
@ -316,11 +337,11 @@ PEP_STATUS pgp_key_expired(
/**
* <!-- pgp_key_revoked() -->
*
* @brief TODO
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] *revoked bool
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] *revoked bool
*
*/
PEP_STATUS pgp_key_revoked(
@ -332,11 +353,11 @@ PEP_STATUS pgp_key_revoked(
/**
* <!-- pgp_key_created() -->
*
* @brief TODO
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] *created time_t
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] *created time_t
*
*/
PEP_STATUS pgp_key_created(
@ -348,11 +369,11 @@ PEP_STATUS pgp_key_created(
/**
* <!-- pgp_contains_priv_key() -->
*
* @brief TODO
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] *has_private bool
* @param[in] session PEP_SESSION
* @param[in] *fpr constchar
* @param[in] *has_private bool
*
*/
PEP_STATUS pgp_contains_priv_key(
@ -363,12 +384,17 @@ PEP_STATUS pgp_contains_priv_key(
/**
* <!-- pgp_find_private_keys() -->
*
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] *pattern constchar
* @param[in] **keylist stringlist_t
* @brief Find all keys (as fpr strings) which match this fpr or OpenPGP
* userid pattern AND contain a private key
*
* @param[in] session PEP_SESSION
* @param[in] pattern Pattern to search for; could be empty,
* an fpr, or a mailbox (email, URI, etc).
* @param[in,out] keylist A list of fprs containing matching keys.
*
* @note Unlike pgp_list_keyinfo, this function returns revoked keys.
*
* @see pgp_list_keyinfo()
*/
PEP_STATUS pgp_find_private_keys(
PEP_SESSION session, const char *pattern, stringlist_t **keylist
@ -377,9 +403,9 @@ PEP_STATUS pgp_find_private_keys(
/**
* <!-- pgp_binary() -->
*
* @brief TODO
* @brief TODO
*
* @param[in] **path constchar
* @param[in] **path constchar
*
*/
PEP_STATUS pgp_binary(const char **path);
@ -387,10 +413,10 @@ PEP_STATUS pgp_binary(const char **path);
/**
* <!-- pgp_config_cipher_suite() -->
*
* @brief TODO
* @brief TODO
*
* @param[in] session PEP_SESSION
* @param[in] suite PEP_CIPHER_SUITE
* @param[in] session PEP_SESSION
* @param[in] suite PEP_CIPHER_SUITE
*
*/
PEP_STATUS pgp_config_cipher_suite(PEP_SESSION session,


+ 9
- 0
src/platform_windows.h View File

@ -130,6 +130,15 @@ DYNAMIC_API time_t timegm(timestamp *timeptr);
#define ftello(A) ((off_t) _ftelli64(A))
#endif
/**
* <!-- strndup() -->
*
* @brief TODO
*
* @param[in] *s1 const char
* @param[in] n size_t
*
*/
char *strndup(const char *s1, size_t n);
/**
* <!-- stpcpy() -->


Loading…
Cancel
Save