I would rather see this fixed upstream than hack around it in MAAS. I checked the twisted code[1] and saw that it was decoding the base64 and parsing the expected ASN1, which I agree is probably too much work for us to take on at this time.
But I'm not convinced that calling Twisted to validate the key for us was the right thing to do in the first place. After all, SSH would be better at telling us whether or not we have a valid key. We should do this instead:
(1) Write key to <tempfile
(2) Check the result of: ssh-keygen -l -f <tempfile>
I would rather see this fixed upstream than hack around it in MAAS. I checked the twisted code[1] and saw that it was decoding the base64 and parsing the expected ASN1, which I agree is probably too much work for us to take on at this time.
But I'm not convinced that calling Twisted to validate the key for us was the right thing to do in the first place. After all, SSH would be better at telling us whether or not we have a valid key. We should do this instead:
(1) Write key to <tempfile
(2) Check the result of: ssh-keygen -l -f <tempfile>
[1]: /github. com/twisted/ twisted/ blob/trunk/ twisted/ conch/ssh/ keys.py
https:/