Skip to content

Commit

Permalink
Refactor for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Mészáros Mihály committed Aug 16, 2018
1 parent 0b77253 commit 3858989
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/apps/relay/mainrelay.c
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ unsigned char *base64encode (const void *b64_encode_this, int encode_this_many_b
(*mem_bio_mem_ptr).data[(*mem_bio_mem_ptr).length] = '\0'; //Adds null-terminator to tail.
return (unsigned char*)(*mem_bio_mem_ptr).data; //Returns base-64 encoded data. (See: "buf_mem_st" struct).
}
void encrypt(unsigned char* in, const unsigned char* mykey){
void encrypt_aes_128(unsigned char* in, const unsigned char* mykey){

int j=0,k=0;
int totalSize=0;
Expand Down Expand Up @@ -1049,7 +1049,7 @@ int decodedTextSize(char *input){
result=(strlen(input)/4*3)-padding;
return result;
}
void decrypt(char* in, const unsigned char* mykey){
void decrypt_aes_128(char* in, const unsigned char* mykey){

unsigned char iv[8] = {0};
AES_KEY key;
Expand Down Expand Up @@ -1809,7 +1809,7 @@ static int adminmain(int argc, char **argv)
exit(0);
}
if(print_enc_aes_password){
encrypt(pwd, generated_key);
encrypt_aes_128(pwd, generated_key);
exit(0);
}
break;
Expand All @@ -1829,7 +1829,7 @@ static int adminmain(int argc, char **argv)
}
break;
case 'v':
decrypt((char*)optarg, generated_key);
decrypt_aes_128((char*)optarg, generated_key);
exit(0);
case 'h':
printf("\n%s\n", AdminUsage);
Expand Down
4 changes: 2 additions & 2 deletions src/apps/relay/mainrelay.h
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,9 @@ struct ctr_state {
};
void generate_aes_128_key(char* filePath, unsigned char* returnedKey);
unsigned char *base64encode (const void *b64_encode_this, int encode_this_many_bytes);
void encrypt(unsigned char* in, const unsigned char* mykey);
void encrypt_aes_128(unsigned char* in, const unsigned char* mykey);
unsigned char *base64decode (const void *b64_decode_this, int decode_this_many_bytes);
void decrypt(char* in, const unsigned char* mykey);
void decrypt_aes_128(char* in, const unsigned char* mykey);
int decodedTextSize(char *input);
char* decryptPassword(char* in, const unsigned char* mykey);
int init_ctr(struct ctr_state *state, const unsigned char iv[8]);
Expand Down

0 comments on commit 3858989

Please sign in to comment.