Multiple compiler warnings note that the gcm_aes_* family of functions are deprecated. They have been replaced with gcm_aes<key_length>_*. This change uses the correct set of functions based on the given key size. Resolves#571.
Sample compiler warning:
/home/noviv/opendht/src/crypto.cpp: In function ‘dht::Blob dht::crypto::aesEncrypt(const uint8_t*, size_t, const dht::Blob&)’: /home/noviv/opendht/src/crypto.cpp:97:20: warning: ‘void nettle_gcm_aes_set_key(gcm_aes_ctx*, size_t, const uint8_t*)’ is deprecated [-Wdeprecated-declarations]
97 | gcm_aes_set_key(&aes, key.size(), key.data());
| ^
In file included from /home/noviv/opendht/src/crypto.cpp:27:
/usr/include/nettle/gcm.h:276:1: note: declared here
276 | gcm_aes_set_key(struct gcm_aes_ctx *ctx,
| ^~~~~~~~~~~~~~~)
https://github.com/gnutls/nettle/commit/6a19845e6f71791ca98765d490ec08e776494bee marked the functions as deprecated.
Add verifications to gnutls calls and throw expcetion
with readable messages.
For example, if call loadIdentity and crt file has name
different of private key exception message was
Can't get certificate public key ID: ASN1 parser: Value was not found.
However, the real problem is that crt file was not found.
Now, for the same problem the exception message will be:
Error while reading file.
Signed-off-by: Lucas Dias <lucas_dias@redes.ufsm.br>
Add verifications to gnutls calls and throw expcetion
with readable messages.
For example, if call loadIdentity and crt file has name
different of private key exception message was
Can't get certificate public key ID: ASN1 parser: Value was not found.
However, the real problem is that crt file was not found.
Now, for the same problem the exception message will be:
Error while reading file.
Signed-off-by: Lucas Dias <lucas_dias@redes.ufsm.br>
Add verifications to gnutls calls and throw expcetion
with readable messages.
For example, if call loadIdentity and crt file has name
different of private key exception message was
Can't get certificate public key ID: ASN1 parser: Value was not found.
However, the real problem is that crt file was not found.
Now, for the same problem the exception message will be:
Error while reading file.
Signed-off-by: Lucas Dias <lucas_dias@redes.ufsm.br>
Add verifications to gnutls calls and throw expcetion
with readable messages.
For example, if call loadIdentity and crt file has name
different of private key exception message was
Can't get certificate public key ID: ASN1 parser: Value was not found.
However, the real problem is that crt file was not found.
Now, for the same problem the exception message will be:
Error while reading file.
Signed-off-by: Lucas Dias <lucas_dias@redes.ufsm.br>
select is limited to file descriptor numbers below FD_SETSIZE (1024),
and calling FD_SET with a higher value can cause a buffer overflow. This
can be problematic for applications using OpenDHT as a library.