Skip to content

Commit

Permalink
working new EVs page
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian authored and Ian committed Nov 10, 2024
1 parent b477194 commit 4af9de9
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 10 deletions.
17 changes: 14 additions & 3 deletions etc/standardintents/standardintents.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
},
{
"itemid": "std::intent::uefi::eventlog",
"name": "System Information",
"name": "UEFI Eventlog",
"description": "Retreives the UEFI Eventlog on Linux systems",
"function": "uefi/eventlog",
"parameters": {}
},
{
"itemid": "std::intent::linux::ima::asciilog",
"name": "System Information",
"name": "Linux IMA ASCII Log",
"description": "Retrieves the ASCII Log generated by Linux Integrity Measurement Architecture",
"function": "ima/asciilog",
"parameters": {}
Expand Down Expand Up @@ -46,14 +46,25 @@
{
"itemid": "std::intent::sha256::crtm::bootloaderonly",
"name": "x86 UEFI Bootloader Only",
"description": "The initial CRTM bootloader only measurement for x86 UEFI machines as stored in SHA256 PCRs",
"description": "The bootloader only measurement for x86 UEFI machines as stored in SHA256 PCRs",
"function": "tpm2/quote",
"parameters":
{
"pcrSelection": "4,5",
"bank": "sha256"
}
},
{
"itemid": "std::intent::sha256::crtm::srtmbootloader",
"name": "x86 UEFI SRTM and Bootloader",
"description": "The SRTM and bootloader measurements for x86 UEFI machines as stored in SHA256 PCRs",
"function": "tpm2/quote",
"parameters":
{
"pcrSelection": "0,1,2,3,4,5",
"bank": "sha256"
}
},
{
"itemid": "std::intent::sha256::srtm",
"name": "x86 UEFI SRTM",
Expand Down
Binary file modified janeserver/janeserver
Binary file not shown.
54 changes: 47 additions & 7 deletions janeserver/services/webui/templates/editexpectedvalue.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ <h3>Expected Value</h3>
<div class="row">
<div class="col-md-12">
<label for="itemid" class="form-label"><b>ItemID</b></label>
<input class="form-control" id="itemid" name="itemid"></input>
<input class="form-control" id="itemid" name="itemid" readonly></input>
</div>
</div>

<div class="row">
<div class="col-md-12">
<label for="name" class="form-label"><b>Name</b></label>
<input class="form-control" id="name" name="name"></input>
<input class="form-control" id="name" name="name" required></input>
</div>
</div>

<div class="row">
<div class="col-md-12">
<label for="description" class="form-label"><b>Description</b></label>
<input class="form-control" id="description" name="description"></input>
<input class="form-control" id="description" name="description" required></input>
</div>
</div>

Expand All @@ -30,15 +30,15 @@ <h3>Expected Value</h3>
<div class="row">
<div class="col-md-6">
<label for="elementselect" class="form-label"><b>Element</b> <i>select one</i></label>
<select class="form-select" size=10 name="elementselect" id="elementselect">
<select class="form-select" size=10 name="elementselect" id="elementselect" required>
{{ range .Elements }}
<option value={{ .ItemID }}>{{ .Name }}</option>
{{ end }}
</select>
</div>
<div class="col-md-6">
<label for="intentselect" class="form-label"><b>Intent</b> <i>select one</i></label>
<select class="form-select" size=10 name="intentselect" id="intentselect">
<select class="form-select" size=10 name="intentselect" id="intentselect" required>
{{ range .Intents }}
<option value={{ .ItemID }}>{{ .Name }} ({{ .Function }})</option>
{{ end }}
Expand All @@ -51,10 +51,23 @@ <h3>Expected Value</h3>
<div class="row">
<div class="col-md-10">
<label for="evsparameters" class="form-label"><b>Expected Value Parameters (evs field) in JSON</b></label>
<textarea class="form-control" rows=6 id="evsparameters" name="evdata"></textarea>
<textarea class="form-control" rows=6 id="evsparameters" name="evsparameters" required>{}</textarea>
</div>
<div class="col-md-2">
<button type="button" class="btn btn-primary">TPM/Quote</button>
<div>
<p><b>Templates:</b><br/></p>
<p>
<button type="button" class="btn btn-warning btn-sm" onClick="setEVBlank()">Clear EVS</button>&nbsp;
<button class="btn btn-info btn-sm" onclick="PrettyPrintJSON()">Pretty Print EVS</button>

</p>
<p>
<button type="button" class="btn btn-primary btn-sm" onClick="setEVTPMQuote()">TPM/Quote</button>&nbsp;
<button type="button" class="btn btn-primary btn-sm" onClick="setEVPCRSelection()">PCRSelection</button><br/>
</p>


</div>
</div>
</div>

Expand All @@ -75,4 +88,31 @@ <h3>Instructions</h3>
</form>


<script type="text/javascript">
function setEVTPMQuote() {
document.getElementById('evsparameters').value = `{
"attestedValue":"****",
"firmwareVersion":"****"
}`;
}
function setEVPCRSelection() {
document.getElementById('evsparameters').value = `{ "pcrselection":"****" }`;
}
function setEVBlank() {
document.getElementById('evsparameters').value = "{}";
}



function PrettyPrintJSON() {
console.log("pressed")
var badJSON = document.getElementById("evsparameters").value;
var parseJSON = JSON.parse(badJSON);
var JSONinPrettyFormat = JSON.stringify(parseJSON, undefined, 4);
document.getElementById("evsparameters").value = JSONinPrettyFormat;
}

</script>


{{end}}

0 comments on commit 4af9de9

Please sign in to comment.