futility/updater_archive.c
/*
 * Determines the signature ID to use for white label.
 * Returns the signature ID for looking up rootkey and vblock files.
 * Caller must free the returned string.
 */
Determines the signature ID to use for white label.
Returns the signature ID for looking up rootkey and vblock files.
Caller must free the returned string.
Determines the signature ID to use for white label . Returns the signature ID for looking up rootkey and vblock files . Caller must free the returned string .
static char *resolve_signature_id(struct model_config *model, const char *image)
{
	int is_unibuild = model->signature_id ? 1 : 0;
	char *wl_tag = vpd_get_value(image, VPD_WHITELABEL_TAG);
	char *sig_id = NULL;
	if (is_unibuild) {
		if (!wl_tag) {
			WARN("No VPD '%s' set for white label - use model name "
			     "'%s' as default.\n", VPD_WHITELABEL_TAG,
			     model->name);
			return strdup(model->name);
		}
		ASPRINTF(&sig_id, "%s-%s", model->name, wl_tag);
		free(wl_tag);
		return sig_id;
	}
	if (!wl_tag) {
		char *cid = vpd_get_value(image, VPD_CUSTOMIZATION_ID);
		if (cid) {
			char *dash = strchr(cid, '-');
			if (dash)
				*dash = '\0';
			wl_tag = cid;
		}
	}
	if (wl_tag)
		str_convert(wl_tag, toupper);
	return wl_tag;
}
static char * resolve_signature_id ( struct model_config * model , const char * image ) { int is_unibuild = model -> signature_id ? 1 : 0 ; char * wl_tag = vpd_get_value ( image , VPD_WHITELABEL_TAG ) ; char * sig_id = NULL ; if ( is_unibuild ) { if ( ! wl_tag ) { WARN ( " " " \n " , VPD_WHITELABEL_TAG , model -> name ) ; return strdup ( model -> name ) ; } ASPRINTF ( & sig_id , " " , model -> name , wl_tag ) ; free ( wl_tag ) ; return sig_id ; } if ( ! wl_tag ) { char * cid = vpd_get_value ( image , VPD_CUSTOMIZATION_ID ) ; if ( cid ) { char * dash = strchr ( cid , ' ' ) ; if ( dash ) * dash = ' \0 ' ; wl_tag = cid ; } } if ( wl_tag ) str_convert ( wl_tag , toupper ) ; return wl_tag ; }
Determines the signature ID to use for white label.
Determines the signature ID to use for white label .
/* Unified build: $model.$wl_tag, or $model (b/126800200). */ /* Non-Unibuild: Upper($wl_tag), or Upper(${cid%%-*}). */ /* customization_id in format LOEM[-VARIANT]. */