Shared constants/structs that are private to Autocrypt. More...
#include <sqlite3.h>
#include <stdbool.h>
Go to the source code of this file.
Data Structures | |
struct | AccountEntry |
An entry in the Autocrypt account Menu. More... | |
Enumerations | |
enum | ExpandoDataAutocrypt { ED_AUT_ENABLED = 1 , ED_AUT_KEYID , ED_AUT_ADDRESS , ED_AUT_NUMBER , ED_AUT_PREFER_ENCRYPT } |
Expando UIDs for Autocrypt. More... | |
Functions | |
int | mutt_autocrypt_account_init (bool prompt) |
Create a new Autocrypt account. | |
void | mutt_autocrypt_scan_mailboxes (void) |
Scan mailboxes for Autocrypt headers. | |
int | mutt_autocrypt_db_account_delete (struct AutocryptAccount *acct) |
Delete an Account from the Autocrypt database. | |
void | mutt_autocrypt_db_account_free (struct AutocryptAccount **ptr) |
Free an AutocryptAccount. | |
int | mutt_autocrypt_db_account_get (struct Address *addr, struct AutocryptAccount **account) |
Get Autocrypt Account data from the database. | |
int | mutt_autocrypt_db_account_get_all (struct AutocryptAccount ***accounts, int *num_accounts) |
Get all accounts from an Autocrypt database. | |
int | mutt_autocrypt_db_account_insert (struct Address *addr, const char *keyid, const char *keydata, bool prefer_encrypt) |
Insert an Account into the Autocrypt database. | |
struct AutocryptAccount * | mutt_autocrypt_db_account_new (void) |
Create a new AutocryptAccount. | |
int | mutt_autocrypt_db_account_update (struct AutocryptAccount *acct) |
Update Account info in the Autocrypt database. | |
void | mutt_autocrypt_db_close (void) |
Close the Autocrypt SQLite database connection. | |
void | mutt_autocrypt_db_gossip_history_free (struct AutocryptGossipHistory **ptr) |
Free an AutocryptGossipHistory. | |
int | mutt_autocrypt_db_gossip_history_insert (struct Address *addr, struct AutocryptGossipHistory *gossip_hist) |
Insert a gossip history into the Autocrypt database. | |
struct AutocryptGossipHistory * | mutt_autocrypt_db_gossip_history_new (void) |
Create a new AutocryptGossipHistory. | |
int | mutt_autocrypt_db_init (bool can_create) |
Initialise the Autocrypt SQLite database. | |
void | mutt_autocrypt_db_normalize_addr (struct Address *a) |
Normalise an Email Address. | |
void | mutt_autocrypt_db_normalize_addrlist (struct AddressList *al) |
Normalise a list of Email Addresses. | |
void | mutt_autocrypt_db_peer_free (struct AutocryptPeer **ptr) |
Free an AutocryptPeer. | |
int | mutt_autocrypt_db_peer_get (struct Address *addr, struct AutocryptPeer **peer) |
Get peer info from the Autocrypt database. | |
void | mutt_autocrypt_db_peer_history_free (struct AutocryptPeerHistory **ptr) |
Free an AutocryptPeerHistory. | |
int | mutt_autocrypt_db_peer_history_insert (struct Address *addr, struct AutocryptPeerHistory *peerhist) |
Insert peer history into the Autocrypt database. | |
struct AutocryptPeerHistory * | mutt_autocrypt_db_peer_history_new (void) |
Create a new AutocryptPeerHistory. | |
int | mutt_autocrypt_db_peer_insert (struct Address *addr, struct AutocryptPeer *peer) |
Insert a peer into the Autocrypt database. | |
struct AutocryptPeer * | mutt_autocrypt_db_peer_new (void) |
Create a new AutocryptPeer. | |
int | mutt_autocrypt_db_peer_update (struct AutocryptPeer *peer) |
Update the peer info in an Autocrypt database. | |
int | mutt_autocrypt_schema_init (void) |
Set up an Autocrypt database. | |
int | mutt_autocrypt_schema_update (void) |
Update the version number of the Autocrypt database schema. | |
int | mutt_autocrypt_gpgme_create_key (struct Address *addr, struct Buffer *keyid, struct Buffer *keydata) |
Create a GPGME key. | |
int | mutt_autocrypt_gpgme_import_key (const char *keydata, struct Buffer *keyid) |
Read a key from GPGME. | |
int | mutt_autocrypt_gpgme_init (void) |
Initialise GPGME. | |
bool | mutt_autocrypt_gpgme_is_valid_key (const char *keyid) |
Is a key id valid? | |
int | mutt_autocrypt_gpgme_select_key (struct Buffer *keyid, struct Buffer *keydata) |
Select a Autocrypt key. | |
int | mutt_autocrypt_gpgme_select_or_create_key (struct Address *addr, struct Buffer *keyid, struct Buffer *keydata) |
Ask the user to select or create an Autocrypt key. | |
bool | populate_menu (struct Menu *menu) |
Add the Autocrypt data to a Menu. | |
Variables | |
sqlite3 * | AutocryptDB |
Handle to the open Autocrypt database. | |
Shared constants/structs that are private to Autocrypt.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file private.h.
enum ExpandoDataAutocrypt |
Expando UIDs for Autocrypt.
Enumerator | |
---|---|
ED_AUT_ENABLED | |
ED_AUT_KEYID | |
ED_AUT_ADDRESS | |
ED_AUT_NUMBER | |
ED_AUT_PREFER_ENCRYPT |
Definition at line 56 of file private.h.
int mutt_autocrypt_account_init | ( | bool | prompt | ) |
Create a new Autocrypt account.
prompt | Prompt the user |
0 | Success |
-1 | Error |
This is used the first time autocrypt is initialized, and in the account menu.
Definition at line 143 of file autocrypt.c.
void mutt_autocrypt_scan_mailboxes | ( | void | ) |
Scan mailboxes for Autocrypt headers.
This is invoked during the first autocrypt initialization, to scan one or more mailboxes for autocrypt headers.
Due to the implementation, header-cached headers are not scanned, so this routine just opens up the mailboxes with $header_cache temporarily disabled.
Definition at line 914 of file autocrypt.c.
int mutt_autocrypt_db_account_delete | ( | struct AutocryptAccount * | acct | ) |
Delete an Account from the Autocrypt database.
acct | Account to delete |
0 | Success |
-1 | Error |
Definition at line 428 of file db.c.
void mutt_autocrypt_db_account_free | ( | struct AutocryptAccount ** | ptr | ) |
Free an AutocryptAccount.
ptr | Account to free |
Definition at line 247 of file db.c.
int mutt_autocrypt_db_account_get | ( | struct Address * | addr, |
struct AutocryptAccount ** | account | ||
) |
Get Autocrypt Account data from the database.
0 | Success |
-1 | Error |
Definition at line 266 of file db.c.
int mutt_autocrypt_db_account_get_all | ( | struct AutocryptAccount *** | accounts, |
int * | num_accounts | ||
) |
Get all accounts from an Autocrypt database.
[out] | accounts | List of accounts |
[out] | num_accounts | Number of accounts |
0 | Success |
-1 | Error |
Definition at line 463 of file db.c.
int mutt_autocrypt_db_account_insert | ( | struct Address * | addr, |
const char * | keyid, | ||
const char * | keydata, | ||
bool | prefer_encrypt | ||
) |
Insert an Account into the Autocrypt database.
addr | Email Address for the account |
keyid | Autocrypt KeyID |
keydata | Autocrypt key data |
prefer_encrypt | Whether the account prefers encryption |
0 | Success |
-1 | Error |
Definition at line 328 of file db.c.
struct AutocryptAccount * mutt_autocrypt_db_account_new | ( | void | ) |
Create a new AutocryptAccount.
ptr | New AutocryptAccount |
Definition at line 238 of file db.c.
int mutt_autocrypt_db_account_update | ( | struct AutocryptAccount * | acct | ) |
Update Account info in the Autocrypt database.
acct | Autocrypt Account data |
0 | Success |
-1 | Error |
Definition at line 382 of file db.c.
void mutt_autocrypt_db_close | ( | void | ) |
Close the Autocrypt SQLite database connection.
Definition at line 133 of file db.c.
void mutt_autocrypt_db_gossip_history_free | ( | struct AutocryptGossipHistory ** | ptr | ) |
Free an AutocryptGossipHistory.
ptr | AutocryptGossipHistory to free |
Definition at line 839 of file db.c.
int mutt_autocrypt_db_gossip_history_insert | ( | struct Address * | addr, |
struct AutocryptGossipHistory * | gossip_hist | ||
) |
Insert a gossip history into the Autocrypt database.
0 | Success |
-1 | Error |
Definition at line 859 of file db.c.
struct AutocryptGossipHistory * mutt_autocrypt_db_gossip_history_new | ( | void | ) |
Create a new AutocryptGossipHistory.
ptr | New AutocryptGossipHistory |
Definition at line 830 of file db.c.
int mutt_autocrypt_db_init | ( | bool | can_create | ) |
Initialise the Autocrypt SQLite database.
can_create | If true, the directory may be created |
0 | Success |
-1 | Error |
Definition at line 83 of file db.c.
void mutt_autocrypt_db_normalize_addr | ( | struct Address * | a | ) |
a | Address to normalise |
Definition at line 168 of file db.c.
void mutt_autocrypt_db_normalize_addrlist | ( | struct AddressList * | al | ) |
Normalise a list of Email Addresses.
al | List of Addresses to normalise |
Definition at line 179 of file db.c.
void mutt_autocrypt_db_peer_free | ( | struct AutocryptPeer ** | ptr | ) |
Free an AutocryptPeer.
ptr | AutocryptPeer to free |
Definition at line 537 of file db.c.
int mutt_autocrypt_db_peer_get | ( | struct Address * | addr, |
struct AutocryptPeer ** | peer | ||
) |
Get peer info from the Autocrypt database.
0 | Success, no matches |
1 | Success, a match |
-1 | Error |
Definition at line 559 of file db.c.
void mutt_autocrypt_db_peer_history_free | ( | struct AutocryptPeerHistory ** | ptr | ) |
Free an AutocryptPeerHistory.
ptr | AutocryptPeerHistory to free |
Definition at line 758 of file db.c.
int mutt_autocrypt_db_peer_history_insert | ( | struct Address * | addr, |
struct AutocryptPeerHistory * | peerhist | ||
) |
Insert peer history into the Autocrypt database.
0 | Success |
-1 | Error |
Definition at line 777 of file db.c.
struct AutocryptPeerHistory * mutt_autocrypt_db_peer_history_new | ( | void | ) |
Create a new AutocryptPeerHistory.
ptr | New AutocryptPeerHistory |
Definition at line 749 of file db.c.
int mutt_autocrypt_db_peer_insert | ( | struct Address * | addr, |
struct AutocryptPeer * | peer | ||
) |
Insert a peer into the Autocrypt database.
addr | Email Address |
peer | AutocryptPeer to insert |
0 | Success |
-1 | Error |
Definition at line 627 of file db.c.
struct AutocryptPeer * mutt_autocrypt_db_peer_new | ( | void | ) |
Create a new AutocryptPeer.
ptr | New AutocryptPeer |
Definition at line 528 of file db.c.
int mutt_autocrypt_db_peer_update | ( | struct AutocryptPeer * | peer | ) |
Update the peer info in an Autocrypt database.
peer | AutocryptPeer to update |
0 | Success |
-1 | Error |
Definition at line 693 of file db.c.
int mutt_autocrypt_schema_init | ( | void | ) |
Set up an Autocrypt database.
0 | Success |
-1 | Error |
Definition at line 41 of file schema.c.
int mutt_autocrypt_schema_update | ( | void | ) |
Update the version number of the Autocrypt database schema.
0 | Success |
-1 | Error |
Definition at line 107 of file schema.c.
int mutt_autocrypt_gpgme_create_key | ( | struct Address * | addr, |
struct Buffer * | keyid, | ||
struct Buffer * | keydata | ||
) |
Create a GPGME key.
0 | Success |
-1 | Error |
Definition at line 158 of file gpgme.c.
int mutt_autocrypt_gpgme_import_key | ( | const char * | keydata, |
struct Buffer * | keyid | ||
) |
Read a key from GPGME.
0 | Success |
-1 | Error |
Definition at line 320 of file gpgme.c.
int mutt_autocrypt_gpgme_init | ( | void | ) |
Initialise GPGME.
0 | Always |
Definition at line 70 of file gpgme.c.
bool mutt_autocrypt_gpgme_is_valid_key | ( | const char * | keyid | ) |
Is a key id valid?
keyid | Key id to check |
true | Key id is valid |
Definition at line 361 of file gpgme.c.
Select a Autocrypt key.
[in] | keyid | Key id to select |
[out] | keydata | Buffer for resulting Key data |
0 | Success |
-1 | Error |
Definition at line 232 of file gpgme.c.
int mutt_autocrypt_gpgme_select_or_create_key | ( | struct Address * | addr, |
struct Buffer * | keyid, | ||
struct Buffer * | keydata | ||
) |
Ask the user to select or create an Autocrypt key.
0 | Success |
-1 | Error |
Definition at line 279 of file gpgme.c.
bool populate_menu | ( | struct Menu * | menu | ) |
Add the Autocrypt data to a Menu.
menu | Menu to populate |
true | Success |
Definition at line 234 of file dlg_autocrypt.c.