Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions packages/aurora-sep/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
pkgname=aurora-sep
pkgver=1
pkgrel=6
pkgrel=7
pkgdesc='SEP trusted-key and fingerprint integration for Aurora'
arch=('any')
groups=('aurora-platform-apple-silicon')
license=('GPL-2.0-only')
url='https://github.com/aurora-silicon/linux'
source=('load-driver' 'aurora-sep.service' 'fprintd-aurora.conf' 'README.md' 'XART-SAFETY.md' 'aurora-sep-ready' 'aurora-sep-ready.service' 'fprintd-no-timeout.conf.in' 'prepare-sep-calibration' 'extract-mesa-calibration' 'aurora-sep.timer' 'aurora-sep-load.conf' 'sensor-present' 'provenance.json' )
source=('load-driver' 'aurora-sep.service' 'fprintd-aurora.conf' 'README.md' 'XART-SAFETY.md' 'aurora-sep-ready' 'aurora-sep-ready.service' 'fprintd-no-timeout.conf.in' 'prepare-sep-calibration' 'extract-mesa-calibration' 'aurora-sep.timer' 'aurora-sep-load.conf' 'sensor-present' 'provenance.json' 'calibration-ready' )
sha256sums=('98d88d028d4a1e703cc9a3bb20d3248d9cd33899288b51bd17fa6af4d71e56df'
'1bb0f37f5057c64ba5f6ca024b05c314abefc3b756f95e858c5c2c1213ca7d89'
'e7898b3e409bde5b23453e22448b434dc4861642f575dab56148c78114f577b8'
'875f8857c2fb61b139072e08625e1b4d4726680e276c8ecd486dc2c2ebc25372'
'a16dc655968783cddd8917e270936a34f02ef6a04e9766571694942462c19232'
'626e55f44bac1d05660b60c1adf2eda32c3bc069e99f1e103ca342cda0b9769c'
'30b27c1e9fa8e73cae3e151ce932352b15d13e10da4b8725afda51faeff5589d'
'2db07d3a0191e8d14581a3056505a8c4225b2fc8e6ea4a1956ae5493abcbb0ae'
'540e0fb2995fe6e34da9a1c6128430e4ac921405de94efcd2b20d8d1ac2310e6'
'a0aec5fb1396df061b4b88e3f5e9c1b61064c8e2793e5b3d569ede8fb242ae6c'
'8d8df0ba2a6861b2edb2110e606906d84ca4848617621ad3cb48493a1522971d'
'65f76d04b80cbc1d964139e92c50947c29cfd7626edae080587e0920bda4dd79'
'09edcb4346afc14a632671d61e125441927012409511db8f0683f1d55b2e2a9a'
'15a878dcf382a22c5d807f0f2c754fe70d39baec88f65aea183b1fe56cf69441'
'87de46450fe3322b74b50db64861cf42eeb725a0460a04f2a034c62e21f8f72f'
'122147a26a700532efebeb8bd70536909352b7b3a0f7c61d64fba38c1ff5e097'
'a07ea64ab1ae82761ee07c22af502e3701a37781f00bd2c2ad92864ecc5cf61c'
'928924f8e7b5ea8db6fb209a83dfaf349ca5abe3e907b11a1990355096c78b79')
'bcf0db07e342bf698deefb731217a5cdcbccc4d47b7a576f5166766769c80b9a'
'9da330e1bbfe0f9b0f7de0f126532cf563320e02ec0b2a13cf9607eb30150ea2')

package() {
depends=('coreutils' 'fprintd' 'keyutils' 'kmod' 'python' 'util-linux' 'grep' 'systemd' 'libfprint-aurora' 'linux-aurora>=7.2.10-4')
install -Dm755 load-driver "$pkgdir/usr/libexec/aurora-sep-load"
install -Dm755 aurora-sep-ready "$pkgdir/usr/libexec/aurora-sep-ready"
install -Dm755 sensor-present "$pkgdir/usr/libexec/aurora-sep-sensor-present"
install -Dm755 calibration-ready "$pkgdir/usr/libexec/aurora-sep-calibration-ready"
for name in prepare-sep-calibration extract-mesa-calibration; do
install -Dm755 "$name" "$pkgdir/usr/libexec/aurora/$name"
done
Expand Down
13 changes: 9 additions & 4 deletions packages/aurora-sep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ loads SEP on every supported boot. Dracut omits the module from the initramfs. T
kernel with SEP built in, and starts normally after reboot into the module-based
kernel.

Calibration extraction reads the local boot container without modifying it. A
private cache is bound to its partition identity and SHA-256. The device-tree
firmware name is respected. No calibration data is distributed or reused across
machines. Models without a fingerprint reader can still initialize SEP trusted
Each start rebuilds the fingerprint calibration from this Mac's own factory
records, read without modification from the Hardware volume of its iBoot System
Container: the calibration resealed with the seal that names this Mac's chip
and ECID, and the trust bundle in use. The installed record is replaced only
when it differs; the replaced bytes are kept privately as rollback evidence,
and a record that is refused moves to private quarantine. Touch ID is marked
ready in /run/aurora-sep only when the installed record is the one admitted, and
fprintd and the reader activation wait for that. The device-tree firmware name
is respected. No calibration data is distributed or reused across machines. Models without a fingerprint reader can still initialize SEP trusted
keys; missing calibration is reported without suppressing the cryptographic
services. Read XART-SAFETY.md for persistent identity ownership constraints.

Expand Down
1 change: 1 addition & 0 deletions packages/aurora-sep/aurora-sep-ready.service
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ JobTimeoutSec=90
Type=oneshot
RemainAfterExit=yes
ExecCondition=/usr/libexec/aurora-sep-sensor-present
ExecCondition=/usr/libexec/aurora-sep-calibration-ready
ExecStart=/usr/local/sbin/aurora-sep-ready
TimeoutStartSec=60
43 changes: 43 additions & 0 deletions packages/aurora-sep/calibration-ready
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/python3
"""Exit successfully only when this boot admitted the fingerprint calibration
and the installed record is still the one admitted."""
import hashlib
import json
import os
import stat


MARKER = '/run/aurora-sep/calibration-ready'


def private(fd):
info = os.fstat(fd)
return (stat.S_ISREG(info.st_mode) and info.st_uid == os.geteuid()
and info.st_nlink == 1 and stat.S_IMODE(info.st_mode) == 0o600)


def read_private(path, limit):
fd = os.open(path, os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK | os.O_CLOEXEC)
try:
if not private(fd):
raise OSError(f'{path} is not a private regular file')
with os.fdopen(os.dup(fd), 'rb') as f:
data = f.read(limit + 1)
if len(data) > limit:
raise OSError(f'{path} is oversized')
return data
finally:
os.close(fd)


def ready(marker=MARKER):
record = json.loads(read_private(marker, 64 * 1024))
installed = read_private(record['target'], 16 * 1024 * 1024)
return hashlib.sha256(installed).hexdigest() == record['sha256']


if __name__ == '__main__':
try:
raise SystemExit(0 if ready() else 1)
except (OSError, ValueError, KeyError, TypeError):
raise SystemExit(1)
1 change: 1 addition & 0 deletions packages/aurora-sep/fprintd-aurora.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ Requires=aurora-sep.service

[Service]
ExecCondition=/usr/libexec/aurora-sep-sensor-present
ExecCondition=/usr/libexec/aurora-sep-calibration-ready
DeviceAllow=/dev/sep-bio rw
Loading