diff options
author | irungentoo <irungentoo@gmail.com> | 2014-06-19 10:50:46 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2014-06-19 10:50:46 -0400 |
commit | 3c64c87ea7e3b458714533d1df8e742c5d274966 (patch) | |
tree | e47574b04cae6975a2062281c98fb5bc85efc894 /toxdns/toxdns.c | |
parent | db724df189525de3738cdfdd2566c82553e8d88c (diff) |
dns3_test now automatically does the DNS request.
tox_decrypt_dns3_TXT no longer needs id_record to be null terminated.
Diffstat (limited to 'toxdns/toxdns.c')
-rw-r--r-- | toxdns/toxdns.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/toxdns/toxdns.c b/toxdns/toxdns.c index 79d2adbb..3eafc3de 100644 --- a/toxdns/toxdns.c +++ b/toxdns/toxdns.c | |||
@@ -216,8 +216,11 @@ int tox_decrypt_dns3_TXT(void *dns3_object, uint8_t *tox_id, uint8_t *id_record, | |||
216 | /*if (id_record_len > 255 || id_record_len <= (sizeof(uint32_t) + crypto_box_MACBYTES)) | 216 | /*if (id_record_len > 255 || id_record_len <= (sizeof(uint32_t) + crypto_box_MACBYTES)) |
217 | return -1;*/ | 217 | return -1;*/ |
218 | 218 | ||
219 | uint8_t id_record_null[id_record_len + 1]; | ||
220 | memcpy(id_record_null, id_record, id_record_len); | ||
221 | id_record_null[id_record_len] = 0; | ||
219 | uint8_t data[id_record_len]; | 222 | uint8_t data[id_record_len]; |
220 | int length = decode(data, id_record); | 223 | int length = decode(data, id_record_null); |
221 | 224 | ||
222 | if (length == -1) | 225 | if (length == -1) |
223 | return -1; | 226 | return -1; |