web-push-libs / ecec

Web Push encryption and decryption in C.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parse base64 encoded values with padding '=' characters cause error

commandus opened this issue · comments

Some services like Google's MCS using padding, e.g.

encryption: salt=3jFrNEVgtPynKcHPmHXawA==

ece_webpush_aesgcm_headers_extract_params() return -13 error in this case.

Thanks, @commandus! This should be fixed in 8197205, I'll merge it as soon as Travis is green.

In general, it's not a good idea for servers to send padding, since it's omitted in RFC 7515, and other implementations might reject it. But we can at least make ecec more forgiving, and working code is always better than following a spec to the letter! 😸