Explorar el Código

Add no-op |RAND_load_file| function for compatibility.

Change-Id: I9493a1509a75d3f0d99ce2b699d8781ad9b1bafa
Reviewed-on: https://boringssl-review.googlesource.com/4540
Reviewed-by: Adam Langley <agl@google.com>
kris/onging/CECPQ3_patch15
Matt Braithwaite hace 9 años
committed by Adam Langley
padre
commit
af3d5bd5a4
Se han modificado 2 ficheros con 14 adiciones y 0 borrados
  1. +11
    -0
      crypto/rand/rand.c
  2. +3
    -0
      include/openssl/rand.h

+ 11
- 0
crypto/rand/rand.c Ver fichero

@@ -14,6 +14,7 @@

#include <openssl/rand.h>

#include <limits.h>
#include <string.h>

#include <openssl/mem.h>
@@ -149,6 +150,16 @@ int RAND_pseudo_bytes(uint8_t *buf, size_t len) {

void RAND_seed(const void *buf, int num) {}

int RAND_load_file(const char *path, long num) {
if (num < 0) { /* read the "whole file" */
return 1;
} else if (num <= INT_MAX) {
return (int) num;
} else {
return INT_MAX;
}
}

void RAND_add(const void *buf, int num, double entropy) {}

int RAND_poll(void) {


+ 3
- 0
include/openssl/rand.h Ver fichero

@@ -41,6 +41,9 @@ OPENSSL_EXPORT int RAND_pseudo_bytes(uint8_t *buf, size_t len);
/* RAND_seed does nothing. */
OPENSSL_EXPORT void RAND_seed(const void *buf, int num);

/* RAND_load_file returns a nonnegative number. */
OPENSSL_EXPORT int RAND_load_file(const char *path, long num);

/* RAND_add does nothing. */
OPENSSL_EXPORT void RAND_add(const void *buf, int num, double entropy);



Cargando…
Cancelar
Guardar