Skip to content

Commit

Permalink
stun: Rename rand function to make its strengh clear
Browse files Browse the repository at this point in the history
It's only nonce level randomness, not long term key level.

Differential Revision: https://phabricator.freedesktop.org/D1711
  • Loading branch information
ocrete committed Apr 3, 2017
1 parent 6e45d18 commit c54a329
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion stun/rand.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void nice_RAND_bytes (uint8_t *dst, int len)
#include <gnutls/gnutls.h>
#include <gnutls/crypto.h>

void nice_RAND_bytes (uint8_t *dst, int len)
void nice_RAND_nonce (uint8_t *dst, int len)
{
gnutls_rnd (GNUTLS_RND_NONCE, dst, len);
}
Expand Down
2 changes: 1 addition & 1 deletion stun/rand.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@
#include <stdint.h>
#endif

void nice_RAND_bytes (uint8_t *dst, int len);
void nice_RAND_nonce (uint8_t *dst, int len);

#endif /* RAND_H */
2 changes: 1 addition & 1 deletion stun/stunhmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,5 @@ void stun_hash_creds (const uint8_t *realm, size_t realm_len,

void stun_make_transid (StunTransactionId id)
{
nice_RAND_bytes (id, 16);
nice_RAND_nonce (id, 16);
}

0 comments on commit c54a329

Please sign in to comment.