]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - crypto/rand/rand_vms.c
crypto/rand/rand_vms.c: include "internal/rand_int.h"
[thirdparty/openssl.git] / crypto / rand / rand_vms.c
index 16afae7a2e228b1c6e363367235b2fb388f35b49..ff9e1aafee8fa62a19ff99af72d4c4b92eef4f88 100644 (file)
@@ -11,6 +11,7 @@
 
 #if defined(OPENSSL_SYS_VMS)
 # include <openssl/rand.h>
+# include "internal/rand_int.h"
 # include "rand_lcl.h"
 # include <descrip.h>
 # include <jpidef.h>
@@ -54,7 +55,7 @@ static struct items_data_st {
     {0, 0}
 };
 
-int RAND_poll(void)
+size_t rand_pool_acquire_entropy(RAND_POOL *pool)
 {
     /* determine the number of items in the JPI array */
     struct items_data_st item_entry;
@@ -112,9 +113,14 @@ int RAND_poll(void)
 
     total_length += (tmp_length - 1);
 
-    /* size of seed is total_length*4 bytes (64bytes) */
-    RAND_add((PTR_T)data_buffer, total_length * 4, total_length * 2);
-    return 1;
+    /*
+     * Size of seed is total_length*4 bytes (64bytes). The original assumption
+     * was that it contains 4 bits of entropy per byte. This makes a total
+     * amount of total_length*16 bits (256bits).
+     */
+    return rand_pool_add(pool,
+                         (PTR_T)data_buffer, total_length * 4,
+                         total_length * 16);
 }
 
 #endif