fix use of an unallocated variable
This commit is contained in:
parent
502ba4ac9b
commit
454e3ff720
3
auth.c
3
auth.c
@ -64,7 +64,6 @@ static int derive_key(struct vtun_host *host)
|
|||||||
unsigned char salt[crypto_pwhash_scryptsalsa208sha256_SALTBYTES];
|
unsigned char salt[crypto_pwhash_scryptsalsa208sha256_SALTBYTES];
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
size_t bin_len;
|
size_t bin_len;
|
||||||
const char ** const hex_end;
|
|
||||||
|
|
||||||
if (host->key != NULL) {
|
if (host->key != NULL) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -74,7 +73,7 @@ static int derive_key(struct vtun_host *host)
|
|||||||
}
|
}
|
||||||
|
|
||||||
sodium_hex2bin(host->key, HOST_KEYBYTES,host->passwd,
|
sodium_hex2bin(host->key, HOST_KEYBYTES,host->passwd,
|
||||||
strlen(host->passwd), "", &bin_len, hex_end);
|
strlen(host->passwd), "", &bin_len, NULL);
|
||||||
if (bin_len == HOST_KEYBYTES) {
|
if (bin_len == HOST_KEYBYTES) {
|
||||||
vtun_syslog(LOG_ERR,"supplied password is long enough to be the secret");
|
vtun_syslog(LOG_ERR,"supplied password is long enough to be the secret");
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user