Commit 66ccdd41 authored by yids's avatar yids
Browse files

forgot some

parent 665bd466
# Edit this file to configure the AVRNaCl build system # Edit this file to configure the AVRNaCl build system
# Do not put spaces before or after the '=' character. # Do not put spaces before or after the '=' character.
TARGET_DEVICE=atmega2560 TARGET_DEVICE=atmega328p
CPUFREQ=16000000 CPUFREQ=16000000
CC=/usr/bin/avr-gcc CC=/usr/bin/avr-gcc
OBJCOPY=/usr/bin/avr-objcopy OBJCOPY=/usr/bin/avr-objcopy
......
...@@ -37,7 +37,7 @@ extern "C" ...@@ -37,7 +37,7 @@ extern "C"
#define DBM #define DBM
#endif #endif
typedef enum { false, true } bool; //typedef enum { false, true } bool;
/* /*
* List of all the available keypairs * List of all the available keypairs
...@@ -58,8 +58,8 @@ typedef struct list_kp { ...@@ -58,8 +58,8 @@ typedef struct list_kp {
*/ */
typedef struct list_public_key { typedef struct list_public_key {
uint32_t id; uint32_t id;
char public_key[crypto_box_PUBLICKEYBYTES]; unsigned char public_key[crypto_box_PUBLICKEYBYTES];
bool is_group; //bool is_group;
char alias[32]; char alias[32];
struct list_public_key *prev; struct list_public_key *prev;
struct list_public_key *next; struct list_public_key *next;
...@@ -85,7 +85,7 @@ typedef struct list_inbox { ...@@ -85,7 +85,7 @@ typedef struct list_inbox {
struct pl_ctx struct pl_ctx
{ {
// contains the message that will be send or is received // contains the message that will be send or is received
char clear_message[MSG_SIZE]; // char clear_message[MSG_SIZE];
char decryptbuffer[PLAIN_MSG_SIZE]; char decryptbuffer[PLAIN_MSG_SIZE];
struct pl_keypair *kp; // my (currently used ) keypair struct pl_keypair *kp; // my (currently used ) keypair
struct list_kp *keypairs; // keypair list (all available keypairs) struct list_kp *keypairs; // keypair list (all available keypairs)
...@@ -93,15 +93,17 @@ struct pl_ctx ...@@ -93,15 +93,17 @@ struct pl_ctx
int msgcount; int msgcount;
struct list_inbox *inbox; struct list_inbox *inbox;
struct list_inbox *inbox_curr; struct list_inbox *inbox_curr;
char receiver_public_key[crypto_box_PUBLICKEYBYTES]; #ifndef RX
unsigned char receiver_public_key[crypto_box_PUBLICKEYBYTES];
struct list_public_key *public_keys; struct list_public_key *public_keys;
#endif
uint8_t err; uint8_t err;
}; };
struct pl_ctx * pl_init(); struct pl_ctx * pl_init();
struct pl_keypair * pl_create_keypair(struct pl_ctx*); struct pl_keypair * pl_create_keypair(struct pl_ctx*);
int pl_set_receiver(struct pl_ctx *ctx, char *public_key); int pl_set_receiver(struct pl_ctx *ctx, unsigned char *public_key);
int pl_set_receiver_by_address(struct pl_ctx *ctx, uint32_t addr); int pl_set_receiver_by_address(struct pl_ctx *ctx, uint32_t addr);
int pl_send_message(struct pl_ctx *); int pl_send_message(struct pl_ctx *);
...@@ -115,7 +117,7 @@ int pl_save_public_key(char pubkey[crypto_box_PUBLICKEYBYTES], char *filename); ...@@ -115,7 +117,7 @@ int pl_save_public_key(char pubkey[crypto_box_PUBLICKEYBYTES], char *filename);
char *pl_load_public_key(char *filename); char *pl_load_public_key(char *filename);
int pl_print_keylist(struct pl_ctx *ctx); int pl_print_keylist(struct pl_ctx *ctx);
int pl_load_key_in_list(struct pl_ctx *ctx, struct pl_keypair *key); int pl_load_key_in_list(struct pl_ctx *ctx, struct pl_keypair *key);
int pl_load_public_key_in_list(struct pl_ctx *ctx, char *public_key, char *alias); int pl_load_public_key_in_list(struct pl_ctx *ctx, unsigned char *public_key, char *alias);
int pl_print_public_keylist(struct pl_ctx *ctx); int pl_print_public_keylist(struct pl_ctx *ctx);
int pl_load_public_keys_from_folder(struct pl_ctx *ctx, char const *folder); int pl_load_public_keys_from_folder(struct pl_ctx *ctx, char const *folder);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment