Files
WoW-Hybrid-gateway/tests/loopback_srp_entropy_fixture.c

19 lines
708 B
C

/* Synthetic loopback fixture only. Never linked into gateway/client artifacts.
* These private values belong to public TEST/LOCAL-ONLY fixture inputs.
* Only the 19-byte SRP ephemeral draw is forced; other draws remain OpenSSL.
*/
#define _GNU_SOURCE
#include <dlfcn.h>
#include <stdlib.h>
#include <string.h>
int RAND_bytes(unsigned char *out,int count){
const char *width=getenv("GW_TEST_HEADER_KEY_WIDTH");
if(width && count==19){
if(strcmp(width,"39") && strcmp(width,"40"))return 0;
memset(out,0,19);out[0]=!strcmp(width,"39")?164:1;
return 1;
}
int (*original)(unsigned char *,int)=dlsym(RTLD_NEXT,"RAND_bytes");
return original?original(out,count):0;
}