Use the right public key representation for push subscriptions
This commit is contained in:
parent
7a47b09b39
commit
42a3f6c880
|
@ -67,7 +67,10 @@ struct PushInstanceSettingsView: View {
|
||||||
let subscription = try await PushManager.shared.createSubscription(account: account)
|
let subscription = try await PushManager.shared.createSubscription(account: account)
|
||||||
let req = Pachyderm.PushSubscription.create(
|
let req = Pachyderm.PushSubscription.create(
|
||||||
endpoint: pushProxyRegistration.endpoint,
|
endpoint: pushProxyRegistration.endpoint,
|
||||||
publicKey: subscription.secretKey.publicKey.rawRepresentation,
|
// mastodon docs just say "Base64 encoded string of a public key from a ECDH keypair using the prime256v1 curve."
|
||||||
|
// other apps use SecKeyCopyExternalRepresentation which is documented to use X9.63 for elliptic curve keys
|
||||||
|
// and that seems to work
|
||||||
|
publicKey: subscription.secretKey.publicKey.x963Representation,
|
||||||
authSecret: subscription.authSecret,
|
authSecret: subscription.authSecret,
|
||||||
alerts: .init(subscription.alerts),
|
alerts: .init(subscription.alerts),
|
||||||
policy: .init(subscription.policy)
|
policy: .init(subscription.policy)
|
||||||
|
|
Loading…
Reference in New Issue