Closed andyblarblar closed 3 years ago
when testing with autopush I get: [ERROR] When sending webpush to client: Please provide valid credentials to send the notification. Looks like perhaps VAPID is bad after all?
both services build correct payload tests fail. Considering both of these only cover aesgcm, this is where we should focus.
those test failures are unrelated and due to removing padding. The real issue per firebase is 'VAPID public key must be on the P-256 curve'. This only effects the aesgcm varient so it looks like were messing up the header.
it looks like this could be the ecdh Cypto-key header or the JWT. Leaning towards the former as its litterally just the key.
The Crypto-key header is incorrect while using aesGCM. It should match the public key exactly.
it looks like the issue is that the key is getting base64 encoded twice. I believe the server is already base64 encoding, so this may be a bug with that and not the lib. On the other hand, this should be documented if this is the case. Most likely, we can remove base64 encoding on the pub key on certain or all paths.
The ece crate was already base64 encoding the pubkey, so a double encoding was applied. With this fixed, aesgcm now sends to the server, but fails to decrypt on the client.
Need to take a look at the body, as it doesnt have the \x delims as in the aes128gcm thats working. The token is correct because 128 is working. Perhaps testing with master thats working could help.
Just going to make a branch that removes aesgcm code as its ultimately quite unneeded and is an easy migration for consumers as it constitutes a single enum change. This may prevent this fork from being accepted by the main repo, but we could always make this repo into its own crate.
Pretty sure the changes in e2d0505cc27e3356afc97c58aa02e29c913347b3 would have fixed the issue with aesgcm. I stand by removing the protocol however, as it has no advantages and will be deprecated anyways. Closing as aesgcm is fully removed now.
headers appear to be correct, perhaps the firebase implementation no longer works?