Skip to content

Instantly share code, notes, and snippets.

View ansiwen's full-sized avatar
🚜
Tenacious Tractor

Sven Anderson ansiwen

🚜
Tenacious Tractor
View GitHub Profile
@ansiwen
ansiwen / pinner_benchmark.go
Created November 8, 2021 08:00
Pinner Research Benchmarks
package pinnerbenchmark
/*
inline void* ccall0() {
return NULL;
}
inline void* ccall1(void* p) {
return NULL;
}
open Lwt.Infix
module type S =
sig
module Mirage : Mirage_flow.S
type data = (Cstruct.t Mirage_flow.or_eof, Mirage.error) result
type t
val create : Mirage.flow -> t
val mirage_flow : t -> Mirage.flow
val read :
@ansiwen
ansiwen / enable-bootguard-measured-boot.md
Created September 4, 2023 16:42
Enable BootGuard 1.0 on Prodive Hermes

Enable BootGuard 1.0 for PCR-0 measurement in Firmware on ProDrive Hermes Board

Operation

We are using BootGuard 1.0 in order to generate an Intel authorized Locality 3 PCR-0 measurement of the boot block, which is the self-measured root of trust for the PCR-2 measurements of Coreboot. That is, we are not using its verification feature, which would require to fuse the chip. Because there is no BootGuard profile without verification, we still have to use a dummy OEM Key for signing both the Key Manifest and the Boot Policy Manifest, so that we can get the PCR-0

@ansiwen
ansiwen / sce.md
Last active October 17, 2023 23:00
Short-Circuit-Error-API

Original

func myFunc() (string, error) {
	file, err := os.Open("data.json")
	if err != nil {
		return "", fmt.Errorf("open data.json: %w", err)
	}

	jsonData, err := io.ReadAll(file)