crypto/fipsmodule/service_indicator/service_indicator.c
static struct fips_service_indicator_state * FIPS_service_indicator_get(void) {
  struct fips_service_indicator_state *indicator =
    CRYPTO_get_thread_local(AWSLC_THREAD_LOCAL_FIPS_SERVICE_INDICATOR_STATE);

  if (indicator == NULL) {

    indicator = OPENSSL_malloc(sizeof(struct fips_service_indicator_state));
    if (indicator == NULL) {
      OPENSSL_PUT_ERROR(CRYPTO, ERR_R_MALLOC_FAILURE);
      return NULL;
    }

    indicator->lock_state = STATE_UNLOCKED;
    indicator->counter = 0;

    if (!CRYPTO_set_thread_local(AWSLC_THREAD_LOCAL_FIPS_SERVICE_INDICATOR_STATE,
                                 indicator, OPENSSL_free)) {
      OPENSSL_PUT_ERROR(CRYPTO, ERR_R_INTERNAL_ERROR);
      return NULL;
    }
  }
  return indicator;
}
// FIPS 140-3 requires that the module should provide the service indicator
// for approved services irrespective of whether the user queries it or not.
// Hence, it is lazily initialized in any call to an approved service.
FIPS 140-3 requires that the module should provide the service indicator
for approved services irrespective of whether the user queries it or not.
Hence, it is lazily initialized in any call to an approved service.
FIPS 140 - 3 requires that the module should provide the service indicator for approved services irrespective of whether the user queries it or not . Hence it is lazily initialized in any call to an approved service .
static struct fips_service_indicator_state * FIPS_service_indicator_get(void) {
  struct fips_service_indicator_state *indicator =
    CRYPTO_get_thread_local(AWSLC_THREAD_LOCAL_FIPS_SERVICE_INDICATOR_STATE);
  if (indicator == NULL) {
    indicator = OPENSSL_malloc(sizeof(struct fips_service_indicator_state));
    if (indicator == NULL) {
      OPENSSL_PUT_ERROR(CRYPTO, ERR_R_MALLOC_FAILURE);
      return NULL;
    }
    indicator->lock_state = STATE_UNLOCKED;
    indicator->counter = 0;
    if (!CRYPTO_set_thread_local(AWSLC_THREAD_LOCAL_FIPS_SERVICE_INDICATOR_STATE,
                                 indicator, OPENSSL_free)) {
      OPENSSL_PUT_ERROR(CRYPTO, ERR_R_INTERNAL_ERROR);
      return NULL;
    }
  }
  return indicator;
}
static struct fips_service_indicator_state * FIPS_service_indicator_get ( void ) { struct fips_service_indicator_state * indicator = CRYPTO_get_thread_local ( AWSLC_THREAD_LOCAL_FIPS_SERVICE_INDICATOR_STATE ) ; if ( indicator == NULL ) { indicator = OPENSSL_malloc ( sizeof ( struct fips_service_indicator_state ) ) ; if ( indicator == NULL ) { OPENSSL_PUT_ERROR ( CRYPTO , ERR_R_MALLOC_FAILURE ) ; return NULL ; } indicator -> lock_state = STATE_UNLOCKED ; indicator -> counter = 0 ; if ( ! CRYPTO_set_thread_local ( AWSLC_THREAD_LOCAL_FIPS_SERVICE_INDICATOR_STATE , indicator , OPENSSL_free ) ) { OPENSSL_PUT_ERROR ( CRYPTO , ERR_R_INTERNAL_ERROR ) ; return NULL ; } } return indicator ; }
FIPS 140-3 requires that the module should provide the service indicator
for approved services irrespective of whether the user queries it or not.
FIPS 140 - 3 requires that the module should provide the service indicator for approved services irrespective of whether the user queries it or not .