Init sodium and check for AES after option()
This commit is contained in:
20
glorytun.c
20
glorytun.c
@@ -511,16 +511,6 @@ int main (int argc, char **argv)
|
||||
{
|
||||
gt_set_signal();
|
||||
|
||||
if (sodium_init()==-1) {
|
||||
printf("libsodium initialization has failed!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!crypto_aead_aes256gcm_is_available()) {
|
||||
printf("AES-256-GCM is not available on your platform!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
char *host = NULL;
|
||||
char *port = "5000";
|
||||
char *dev = "glorytun";
|
||||
@@ -539,6 +529,16 @@ int main (int argc, char **argv)
|
||||
if (option(opts, argc, argv))
|
||||
return 1;
|
||||
|
||||
if (sodium_init()==-1) {
|
||||
printf("libsodium initialization has failed!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!crypto_aead_aes256gcm_is_available()) {
|
||||
printf("AES-256-GCM is not available on your platform!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
struct addrinfo hints = {
|
||||
.ai_family = AF_UNSPEC,
|
||||
.ai_socktype = SOCK_STREAM,
|
||||
|
||||
Reference in New Issue
Block a user