diff --git a/internal/local/info.go b/internal/local/info.go index d32b4177..44f07292 100644 --- a/internal/local/info.go +++ b/internal/local/info.go @@ -77,7 +77,7 @@ func (service *ProvisioningService) DisplayAMTInfo() utils.ReturnCode { } } if service.flags.AmtInfo.Ver && service.flags.AmtInfo.Sku { - result := decodeAMT(dataStruct["amt"].(string), dataStruct["sku"].(string)) + result := DecodeAMT(dataStruct["amt"].(string), dataStruct["sku"].(string)) dataStruct["features"] = strings.TrimSpace(result) if !service.flags.JsonOutput { println("Features : " + result) @@ -259,7 +259,7 @@ func (service *ProvisioningService) DisplayAMTInfo() utils.ReturnCode { return utils.Success } -func decodeAMT(version, SKU string) string { +func DecodeAMT(version, SKU string) string { amtParts := strings.Split(version, ".") if len(amtParts) <= 1 { return "Invalid AMT version format" diff --git a/internal/local/info_test.go b/internal/local/info_test.go index 6ccd42c1..3f34a1c9 100644 --- a/internal/local/info_test.go +++ b/internal/local/info_test.go @@ -157,9 +157,9 @@ func TestDecodeAMT(t *testing.T) { } for _, tc := range testCases { - got := decodeAMT(tc.version, tc.SKU) + got := DecodeAMT(tc.version, tc.SKU) if got != tc.want { - t.Errorf("decodeAMT(%q, %q) = %v; want %v", tc.version, tc.SKU, got, tc.want) + t.Errorf("DecodeAMT(%q, %q) = %v; want %v", tc.version, tc.SKU, got, tc.want) } } } diff --git a/internal/rps/message.go b/internal/rps/message.go index 96071073..7cb05a5c 100644 --- a/internal/rps/message.go +++ b/internal/rps/message.go @@ -11,6 +11,7 @@ import ( "os" "rpc/internal/amt" "rpc/internal/flags" + "rpc/internal/local" "rpc/pkg/utils" "time" @@ -47,6 +48,7 @@ type MessagePayload struct { Version string `json:"ver"` Build string `json:"build"` SKU string `json:"sku"` + Features string `json:"features"` UUID string `json:"uuid"` Username string `json:"username"` Password string `json:"password"` @@ -86,6 +88,9 @@ func (p Payload) createPayload(dnsSuffix string, hostname string, amtTimeout tim if err != nil { return payload, err } + + payload.Features = local.DecodeAMT(payload.Version, payload.SKU) + payload.UUID, err = p.AMT.GetUUID() if err != nil { return payload, err