Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Implement FPM policy validation algorithm

Đang mở
#5 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

@mcy đang làm issue này rồi.

Từ ngày 17/9/2020.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

Pesudocode for the algorithm:

fn verify_policy(
  fpm: Fpm,
  flash: &impl Flash,
  hash_builder: &impl ha256::Builder
) -> Result<FirmwareVersion> {
  for fw in fpm.fw_versions {
    let version = flash.read(fw.version_addr, fw.version_len);
    if version != fw.version {
      continue
    }
    let mut sha = hash_builder.new();
    for (ptr, len) in fw.signed_regions {
      // Note: this is grossly exaggerated. There is an expectation that
      // data will be fed into the hashing engine in small packets (O(1K),
      // for example.
      sha.write(flash.read(ptr, len));
    }
    if fw.signed_region_hash != sha.finish() {
      return Err("hash mismatch");
    }

    let unused_regions = regions_except(flash, [fw.signed_regions,
                                                fw.write_regions]);
    for (ptr, len) in unused_regions {
      for byte in flash.read(ptr, len) {
        return Err("bad byte in blank region");
      }
    }
    return fw
  }
  return Err("failed to find an acceptable version")
}
Ngôn ngữ chính
Rust
Star
17
Fork
11
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của lowRISC/manticore

Tất cả issue của lowRISC/manticore

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.