Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite3a2c23

Browse files
mikeytdiscoBret Barkelew
authored and
Bret Barkelew
committed
Merged PR 449: Sync with ZeroTOuch - OptIn/OptOut
Sync with ZeroTOuch - OptIn/OptOutIgnore comments starting with JSON. This is new code, not complete.
1 parenta1b38bb commite3a2c23

File tree

17 files changed

+288
-505
lines changed

17 files changed

+288
-505
lines changed

‎DfciPkg/Application/DfciMenu/DfciMenu.c‎

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5959
#include<Library/UefiLib.h>
6060
#include<Library/UefiRuntimeServicesTableLib.h>
6161
#include<Library/UefiHiiServicesLib.h>
62+
#include<Library/ZeroTouchSettingsLib.h>
6263

6364
#include<Settings/DfciSettings.h>
6465

@@ -381,12 +382,14 @@ GetDfciParameters (
381382
VOID
382383
) {
383384

384-
EFI_STATUSStatus;
385-
UINTNi;
386-
DFCI_IDENTITY_MASKDfciMask;
385+
STATICBOOLEANAlreadyRun= FALSE;
387386
DFCI_CERT_STRINGSCert;
387+
DFCI_IDENTITY_MASKDfciMask;
388388
VOID*dummy;
389-
STATICBOOLEANAlreadyRun= FALSE;
389+
UINTNi;
390+
CHAR8*Name;
391+
UINTNNameSize;
392+
EFI_STATUSStatus;
390393

391394

392395
if (!AlreadyRun) {
@@ -464,14 +467,29 @@ GetDfciParameters (
464467
}
465468
}
466469

467-
Status=GetASetting (DFCI_SETTING_ID__DFCI_URL,&mDfciUrl,&mDfciUrlSize);
470+
Status=GetASetting (DFCI_SETTING_ID__DFCI_URL,&mDfciUrl,&mDfciUrlSize);
468471
if (EFI_ERROR(Status)|| (mDfciUrlSize <=1)) {
469472
gotoCLEANUP_EXIT;
470473
}
471474

472475
SetStringEntry (STRING_TOKEN(STR_DFCI_URL_FIELD),mDfciUrl);
473476
mDfciMenuConfiguration.DfciHttpRecoveryEnabled= TRUE;
474477
DEBUG((DEBUG_INFO,"Dfci Http Recovery is enabled\n"));
478+
479+
Status=GetASetting (DFCI_SETTING_ID__MDM_FRIENDLY_NAME,&Name,&NameSize);
480+
if (!EFI_ERROR(Status)&& (NameSize >=1)) {
481+
SetStringEntry (STRING_TOKEN(STR_DFCI_MDM_FRIENDLY_NAME),Name);
482+
mDfciMenuConfiguration.DfciFriendlyName= TRUE;
483+
DEBUG((DEBUG_INFO,"Dfci MDM.FriendlyName is enabled\n"));
484+
}
485+
486+
Status=GetASetting (DFCI_SETTING_ID__MDM_TENANT_NAME,&Name,&NameSize);
487+
if (!EFI_ERROR(Status)&& (NameSize >=1)) {
488+
SetStringEntry (STRING_TOKEN(STR_DFCI_MDM_TENANT_NAME),Name);
489+
mDfciMenuConfiguration.DfciFriendlyName= TRUE;
490+
DEBUG((DEBUG_INFO,"Dfci MDM.Tenant is enabled\n"));
491+
}
492+
475493
}
476494

477495
returnEFI_SUCCESS;
@@ -881,7 +899,8 @@ DriverCallback (
881899
caseDFCI_MENU_ZUM_OPT_IN_QUESTION_ID:
882900
DEBUG((DEBUG_INFO," Opt In selected\n"));
883901

884-
DEBUG((DEBUG_ERROR," NOT IMPLEMENTED YET\n"));
902+
SetZeroTouchState (ZERO_TOUCH_OPT_IN);
903+
mDfciMenuConfiguration.DfciOptInChanged= TRUE;
885904

886905
*ActionRequest=EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;
887906
Status=EFI_SUCCESS;
@@ -890,7 +909,8 @@ DriverCallback (
890909
caseDFCI_MENU_ZUM_OPT_OUT_QUESTION_ID:
891910
DEBUG((DEBUG_INFO," Opt Out selected\n"));
892911

893-
DEBUG((DEBUG_ERROR," NOT IMPLEMENTED YET\n"));
912+
SetZeroTouchState (ZERO_TOUCH_OPT_OUT);
913+
mDfciMenuConfiguration.DfciOptInChanged= TRUE;
894914

895915
*ActionRequest=EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;
896916
Status=EFI_SUCCESS;

‎DfciPkg/Application/DfciMenu/DfciMenu.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ typedef struct {
7272
UINT8DfciUser1Enabled;
7373
UINT8DfciUser2Enabled;
7474
UINT8DfciFriendlyName;
75+
UINT8DfciOptInChanged;
7576
}DFCI_MENU_CONFIGURATION;
7677

7778
// Grid class form browser extensions. These should be ignored

‎DfciPkg/Application/DfciMenu/DfciMenu.inf‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
NetworkPkg/NetworkPkg.dec
5959
MdePkg/MdePkg.dec
6060
MdeModulePkg/MdeModulePkg.dec
61+
ZeroTouchPkg/ZeroTouchPkg.dec
6162

6263
[LibraryClasses]
6364
BaseLib
@@ -77,6 +78,7 @@
7778
UefiHiiServicesLib
7879
UefiLib
7980
UefiRuntimeServicesTableLib
81+
ZeroTouchSettingsLib
8082

8183
[Guids]
8284
gDfciAuthProvisionVarNamespace

‎DfciPkg/Application/DfciMenu/DfciMenuStrings.uni‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4444

4545
#string STR_DFCI_MANAGEMENT_HEADER #language en-US "\fh!48!Management"
4646

47+
#string STR_DFCI_OPT_IN_CHANGED #language en-US "\fc!Red!The opt in state has been changed. Restart the system to apply the setting."
48+
4749
#string STR_DFCI_ZUM_STATUS_READY #language en-US "Zero-touch UEFI Management: Ready"
4850

4951
#string STR_DFCI_ZUM_OPT_OUT #language en-US "Opt Out"

‎DfciPkg/Application/DfciMenu/DfciMenuVfr.Vfr‎

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,34 @@ formset
7070
help = STRING_TOKEN(STR_NULL_STRING), // SPACING
7171
text = STRING_TOKEN(STR_NULL_STRING); //
7272

73+
suppressif ideqval DfciMenuConfig.DfciOptInChanged == 0x00; // Warning message if OptIn/Out
74+
75+
text
76+
help = STRING_TOKEN(STR_NULL_STRING), // DFCI Enabled Header
77+
text = STRING_TOKEN(STR_DFCI_OPT_IN_CHANGED); //
78+
79+
text
80+
help = STRING_TOKEN(STR_NULL_STRING), // SPACING
81+
text = STRING_TOKEN(STR_NULL_STRING); //
82+
83+
endif;
84+
7385
suppressif NOT ideqval DfciMenuConfig.DfciOwnerEnabled == 0x00; // ZUM menu when no Owner
7486

7587
suppressif ideqval DfciMenuConfig.DfciZeroTouchEnabled == 0x00;
7688
text
77-
help = STRING_TOKEN(STR_NULL_STRING), //
89+
help = STRING_TOKEN(STR_NULL_STRING), //
7890
text = STRING_TOKEN(STR_DFCI_ZUM_STATUS_READY); // ZeroTouchStatus: Ready
7991

8092
text
8193
help = STRING_TOKEN(STR_NULL_STRING), // SPACING
8294
text = STRING_TOKEN(STR_NULL_STRING); //
8395

8496
text
85-
help = STRING_TOKEN(STR_NULL_STRING), //
97+
help = STRING_TOKEN(STR_NULL_STRING), //
8698
text = STRING_TOKEN(STR_DFCI_ZUM_OPT_OUT), // Opt Out
8799
flags = INTERACTIVE | RESET_REQUIRED, // INTERACTIVE = Button
88-
key =DFCI_MENU_ZUM_OPT_IN_QUESTION_ID;
100+
key =DFCI_MENU_ZUM_OPT_OUT_QUESTION_ID;
89101
endif;
90102

91103
suppressif NOT ideqval DfciMenuConfig.DfciZeroTouchEnabled == 0x00;
@@ -98,10 +110,10 @@ formset
98110
text = STRING_TOKEN(STR_NULL_STRING); //
99111

100112
text
101-
help = STRING_TOKEN(STR_NULL_STRING), //
113+
help = STRING_TOKEN(STR_NULL_STRING), //
102114
text = STRING_TOKEN(STR_DFCI_ZUM_OPT_IN), // Opt In
103115
flags = INTERACTIVE | RESET_REQUIRED, // INTERACTIVE = Button
104-
key =DFCI_MENU_ZUM_OPT_OUT_QUESTION_ID;
116+
key =DFCI_MENU_ZUM_OPT_IN_QUESTION_ID;
105117
endif;
106118

107119
text
@@ -130,9 +142,9 @@ formset
130142
help = STRING_TOKEN(STR_NULL_STRING), // SPACING
131143
text = STRING_TOKEN(STR_NULL_STRING); //
132144

133-
endif;
145+
endif;
134146

135-
suppressif ideqval DfciMenuConfig.DfciOwnerEnabled == 0x00; // DFCI Menu when Owner
147+
suppressif ideqval DfciMenuConfig.DfciOwnerEnabled == 0x00; // DFCI Menu when Owner
136148

137149
guidop
138150
guid = GRID_CLASS_START_OPCODE_GUID, // Custom UI Grid opcode - START
@@ -148,13 +160,13 @@ formset
148160
help = STRING_TOKEN(STR_NULL_STRING), // Subject:
149161
text = STRING_TOKEN(STR_DFCI_MANAGED_BY);
150162

151-
suppressif ideqval DfciMenuConfig.DfciFriendlyName == 0x00; // If no friendly name, just
163+
suppressif ideqval DfciMenuConfig.DfciFriendlyName == 0x00; // If no friendly name, just
152164
text
153165
help = STRING_TOKEN(STR_NULL_STRING), // managed by owner
154166
text = STRING_TOKEN(STR_DFCI_OWNER_SUBJECT_FIELD);
155167
endif;
156168

157-
suppressif NOT ideqval DfciMenuConfig.DfciFriendlyName == 0x00; // If friendly name,
169+
suppressif NOT ideqval DfciMenuConfig.DfciFriendlyName == 0x00; // If friendly name,
158170
text
159171
help = STRING_TOKEN(STR_NULL_STRING), // managed by MDM
160172
text = STRING_TOKEN(STR_DFCI_MDM_FRIENDLY_NAME);
@@ -168,7 +180,7 @@ formset
168180
text = STRING_TOKEN(STR_DFCI_ON_BEHALF_OF);
169181

170182
text
171-
help = STRING_TOKEN(STR_NULL_STRING),
183+
help = STRING_TOKEN(STR_NULL_STRING),
172184
text = STRING_TOKEN(STR_DFCI_MDM_TENANT_NAME);
173185
endif;
174186

@@ -183,7 +195,7 @@ formset
183195
text
184196
help = STRING_TOKEN(STR_NULL_STRING), // SPACING
185197
text = STRING_TOKEN(STR_NULL_STRING); //
186-
198+
187199
guidop
188200
guid = GRID_CLASS_END_OPCODE_GUID, // Custom UI Grid opcode - END
189201
endguidop;
@@ -212,8 +224,8 @@ formset
212224
text = STRING_TOKEN(STR_NULL_STRING); //
213225

214226
text
215-
help = STRING_TOKEN(STR_NULL_STRING),
216-
text = STRING_TOKEN(STR_DETAILS);
227+
help = STRING_TOKEN(STR_NULL_STRING),
228+
text = STRING_TOKEN(STR_DETAILS);
217229

218230
text
219231
help = STRING_TOKEN(STR_NULL_STRING), // SPACING
@@ -316,15 +328,15 @@ formset
316328
text
317329
help = STRING_TOKEN(STR_NULL_STRING), // Thumbprint from certificate
318330
text = STRING_TOKEN(STR_DFCI_USER1_THUMBPRINT_FIELD);
319-
331+
320332
guidop
321333
guid = GRID_CLASS_END_OPCODE_GUID, // Custom UI Grid opcode - END
322334
endguidop;
323335

324336
text
325337
help = STRING_TOKEN(STR_NULL_STRING), // SPACING
326338
text = STRING_TOKEN(STR_NULL_STRING); //
327-
339+
328340
endif;
329341

330342
suppressif ideqval DfciMenuConfig.DfciUserEnabled == 0x00;
@@ -370,7 +382,7 @@ formset
370382
text
371383
help = STRING_TOKEN(STR_NULL_STRING), // Thumbprint from certificate
372384
text = STRING_TOKEN(STR_DFCI_USER_THUMBPRINT_FIELD);
373-
385+
374386
guidop
375387
guid = GRID_CLASS_END_OPCODE_GUID, // Custom UI Grid opcode - END
376388
endguidop;
@@ -425,7 +437,7 @@ formset
425437
text
426438
help = STRING_TOKEN(STR_NULL_STRING), // Thumbprint from certificate
427439
text = STRING_TOKEN(STR_DFCI_OWNER_THUMBPRINT_FIELD);
428-
440+
429441
guidop
430442
guid = GRID_CLASS_END_OPCODE_GUID, // Custom UI Grid opcode - END
431443
endguidop;
@@ -479,15 +491,15 @@ formset
479491
text
480492
help = STRING_TOKEN(STR_NULL_STRING), // Thumbprint from certificate
481493
text = STRING_TOKEN(STR_DFCI_ZTD_THUMBPRINT_FIELD);
482-
494+
483495
guidop
484496
guid = GRID_CLASS_END_OPCODE_GUID, // Custom UI Grid opcode - END
485497
endguidop;
486498

487499
text
488500
help = STRING_TOKEN(STR_NULL_STRING), // SPACING
489501
text = STRING_TOKEN(STR_NULL_STRING); //
490-
502+
491503
endif;
492504

493505
endform;
@@ -503,7 +515,7 @@ formset
503515
help = STRING_TOKEN(STR_NULL_STRING),
504516
text = STRING_TOKEN(STR_NULL_STRING),
505517
flags = INTERACTIVE,
506-
key = DFCI_MENU_INIT2_QUESTION_ID;
518+
key = DFCI_MENU_INIT2_QUESTION_ID;
507519
endif;
508520

509521
//
@@ -575,7 +587,7 @@ formset
575587
text
576588
help = STRING_TOKEN(STR_NULL_STRING), // SPACING
577589
text = STRING_TOKEN(STR_NULL_STRING); //
578-
endif;
590+
endif;
579591

580592
text
581593
help = STRING_TOKEN(STR_NULL_STRING), // SPACING
@@ -602,7 +614,7 @@ formset
602614
text
603615
help = STRING_TOKEN(STR_NULL_STRING), // SPACING
604616
text = STRING_TOKEN(STR_NULL_STRING); //
605-
617+
606618
text
607619
help = STRING_TOKEN(STR_NULL_STRING), // SPACING
608620
text = STRING_TOKEN(STR_NULL_STRING); //
@@ -611,11 +623,11 @@ formset
611623
text
612624
help = STRING_TOKEN(STR_NULL_STRING), // DFCI Reset Permission Info
613625
text = STRING_TOKEN(STR_DFCI_RESET_INFO); //
614-
626+
615627
text
616628
help = STRING_TOKEN(STR_NULL_STRING), // SPACING
617629
text = STRING_TOKEN(STR_NULL_STRING); //
618-
630+
619631
goto // External reference to recovery menu
620632
formid = DFCI_MENU_RECOVERY_INFO_FORM_ID,
621633
question = DFCI_MENU_RECOVERY_INFO_QUESTION_ID,
@@ -647,7 +659,7 @@ formset
647659
help = STRING_TOKEN(STR_NULL_STRING),
648660
text = STRING_TOKEN(STR_NULL_STRING),
649661
flags = INTERACTIVE,
650-
key = DFCI_MENU_INIT3_QUESTION_ID;
662+
key = DFCI_MENU_INIT3_QUESTION_ID;
651663
endif;
652664

653665
//
@@ -673,7 +685,7 @@ formset
673685
text
674686
help = STRING_TOKEN(STR_NULL_STRING), // SPACING
675687
text = STRING_TOKEN(STR_NULL_STRING); //
676-
688+
677689
goto // External reference to recovery menu
678690
formsetguid = DFCI_RECOVERY_FORMSET_GUID,
679691
formid = DFCI_RECOVERY_FORM_ID,

‎DfciPkg/Application/DfciMenu/DfciRequest.c‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,29 @@ STATIC PROCESS_REQUEST_ENTRY mRequestTable[] = {
151151
152152
#define REQUEST_TABLE_COUNT (sizeof(mRequestTable)/sizeof(mRequestTable[0]))
153153
154+
typedef struct {
155+
CHAR8 *FieldName;
156+
UINTN FieldSize;
157+
} JSON_REQUEST_ENTRY;
158+
159+
#define JSON_REQUEST_MFG 1
160+
#define JSON_REQUEST_MODEL 3
161+
#define JSON_REQUEST_SERIAL 5
162+
#define JSON_REQUEST_THUMBPRINT 7
163+
164+
JSON_REQUEST_ENTRY mJsonRequest[] = {
165+
{ "{\"oenManufacturer\":", sizeof ("{\"oenManufacturer\":") },
166+
{ NULL, 0 },
167+
{ "{\"modelName\":", sizeof ("{\"modelName\":") },
168+
{ NULL, 0 },
169+
{ "{\"serialNumber\":", sizeof ("{\"serialNumber\":") },
170+
{ NULL, 0 },
171+
{ "{\"thumbprint\":", sizeof ("{\"oenManufacturer\":") },
172+
{ NULL, 0 },
173+
{ NULL, 0 } // Terminator
174+
};
175+
176+
154177
/**
155178
* DFCI Private Data
156179
**/
@@ -1440,6 +1463,22 @@ ProcessDfciRequests (
14401463
}
14411464

14421465
SettingApplied= FALSE;
1466+
1467+
1468+
// 1. Build JSON Request
1469+
1470+
1471+
1472+
// Request:
1473+
// {"oemManufacturer":null,"modelName":null,"serialNumber":null,"thumbprint":null}
1474+
//
1475+
// Response:
1476+
// {"settingsPacket":null,"provisioningPacket":null,"permissionsPacket":null}
1477+
1478+
1479+
1480+
1481+
14431482
//
14441483
// Send Results and Current to Settings Manager
14451484
//

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp