aboutsummaryrefslogtreecommitdiff
path: root/src/libcrypto.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-07-05 10:47:49 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-07-05 12:12:14 +0200
commitc503bb572eee1a166ce5e631785b7d24e6319605 (patch)
tree6ab8c088fe5f2764fffe91ef9ea9d9640cf63ed1 /src/libcrypto.c
parent36a727e656a7fcd91722cf2d050fc87d55410b5b (diff)
downloadlibssh-c503bb572eee1a166ce5e631785b7d24e6319605.tar.gz
libssh-c503bb572eee1a166ce5e631785b7d24e6319605.tar.xz
libssh-c503bb572eee1a166ce5e631785b7d24e6319605.zip
crytpo: Make sure we check return of ssh_get_random() correctly
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/libcrypto.c')
-rw-r--r--src/libcrypto.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libcrypto.c b/src/libcrypto.c
index bde706b8..46570294 100644
--- a/src/libcrypto.c
+++ b/src/libcrypto.c
@@ -78,6 +78,19 @@ void ssh_reseed(void){
#endif
}
+/**
+ * @brief Get random bytes
+ *
+ * Make sure to always check the return code of this function!
+ *
+ * @param[in] where The buffer to fill with random bytes
+ *
+ * @param[in] len The size of the buffer to fill.
+ *
+ * @param[in] strong Use a strong or private RNG source.
+ *
+ * @return 1 on success, 0 on error.
+ */
int ssh_get_random(void *where, int len, int strong)
{
(void)strong;