Skip to content

Commit cbf3987

Browse files
rorarclaude
andcommitted
fix(spec): correct PushDelivery IV split in notification-dispatch.allium
WebPushSubscription stores two pipe-separated IVs ("ivP256dh|ivAuth") in a single iv field. The spec incorrectly showed a single IV used for both p256dh and auth decryption. Now accurately reflects the split pattern matching push.channel.ts and push.actions.ts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 30ef25e commit cbf3987

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

specs/notification-dispatch.allium

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,9 @@ entity WebPushSubscription {
220220
id: String -- UUID
221221
userId: String
222222
endpoint: String -- push service endpoint URL
223-
p256dh: String -- AES-encrypted
224-
auth: String -- AES-encrypted
225-
iv: String -- AES initialization vector
223+
p256dh: String -- AES-encrypted (own IV)
224+
auth: String -- AES-encrypted (own IV)
225+
iv: String -- pipe-separated: "ivP256dh|ivAuth"
226226
expirationTime: DateTime?
227227
createdAt: DateTime = now()
228228
updatedAt: DateTime
@@ -616,9 +616,12 @@ rule PushDelivery {
616616
requires: checkPushDispatchRateLimit(userId) = allowed
617617

618618
for_each subscription in subscriptions:
619-
-- Decrypt subscription keys
620-
let p256dh = decrypt(subscription.p256dh, subscription.iv)
621-
let auth = decrypt(subscription.auth, subscription.iv)
619+
-- Decrypt subscription keys (each encrypted with its own IV)
620+
-- The iv field stores both IVs as "ivP256dh|ivAuth" (pipe-separated)
621+
let iv_p256dh = split(subscription.iv, "|").first
622+
let iv_auth = split(subscription.iv, "|").last
623+
let p256dh = decrypt(subscription.p256dh, iv_p256dh)
624+
let auth = decrypt(subscription.auth, iv_auth)
622625

623626
ensures: web-push sendNotification with VAPID signing
624627

0 commit comments

Comments
 (0)