openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/rng-tools/6.7-r0/git/rngd_entsource.c
int init_tpm_entropy_source(struct rng* ent_src)
{
    message(LOG_CONS | LOG_INFO,
            "The TPM entropy source only supports TPM1.2 hardware and is "
            "deprecated.  TPM2.0 and later hardware exports entropy via "
            "/dev/hwrng, which "
            "can be collected via the hwrng entropy source in rngd\n");
    ent_src->rng_fd = open(ent_src->rng_fname, O_RDWR);
    if (ent_src->rng_fd == -1)
    {
        message(LOG_DAEMON | LOG_DEBUG, "Unable to open file: %s",
                ent_src->rng_fname);
        return 1;
    }
    /* Bootstrap FIPS tests */
    ent_src->fipsctx = malloc(sizeof(fips_ctx_t));
    close(ent_src->rng_fd);
    return 0;
}
/*
 * Open tpm entropy source, and initialize it
 */
Open tpm entropy source, and initialize it
Open tpm entropy source and initialize it
int init_tpm_entropy_source(struct rng* ent_src)
{
    message(LOG_CONS | LOG_INFO,
            "The TPM entropy source only supports TPM1.2 hardware and is "
            "deprecated.  TPM2.0 and later hardware exports entropy via "
            "/dev/hwrng, which "
            "can be collected via the hwrng entropy source in rngd\n");
    ent_src->rng_fd = open(ent_src->rng_fname, O_RDWR);
    if (ent_src->rng_fd == -1)
    {
        message(LOG_DAEMON | LOG_DEBUG, "Unable to open file: %s",
                ent_src->rng_fname);
        return 1;
    }
    ent_src->fipsctx = malloc(sizeof(fips_ctx_t));
    close(ent_src->rng_fd);
    return 0;
}
int init_tpm_entropy_source ( struct rng * ent_src ) { message ( LOG_CONS | LOG_INFO , " " " " " " " \n " ) ; ent_src -> rng_fd = open ( ent_src -> rng_fname , O_RDWR ) ; if ( ent_src -> rng_fd == -1 ) { message ( LOG_DAEMON | LOG_DEBUG , " " , ent_src -> rng_fname ) ; return 1 ; } ent_src -> fipsctx = malloc ( sizeof ( fips_ctx_t ) ) ; close ( ent_src -> rng_fd ) ; return 0 ; }
Open tpm entropy source, and initialize it
Open tpm entropy source and initialize it
/* Bootstrap FIPS tests */