Closed GoogleCodeExporter closed 9 years ago
ParseX509 expects a DER-encoded ASN.1 sequence -- it should be binary data, not
Base64-encoded.
Where did you get that DSA key, encoded in that way?
Original comment by sh...@willden.org
on 26 Jan 2012 at 3:58
Ah, never mind. I typed first and thought later. I should have looked at your
fix.
Why does your PEM-encoded key have apostrophes in it which need to be removed?
That's not a valid character. Are you sending in the "publickey=" stuff?
Original comment by sh...@willden.org
on 26 Jan 2012 at 4:05
The apostrophes are coming from the ASN1 BitString format, which is something
like '00010100101'B.
Original comment by h...@at.or.at
on 26 Jan 2012 at 4:31
Ah, I see. You're replacing the apostrophes after ASN.1 parsing, not before
Base64 decoding.
That's very interesting. I wonder why you're seeing this problem. Is it
something unique about your key, or perhaps nobody else has used this code?
The latter is probably the case, since I can't find any uses of this function
in the Keyczar codebase. I'll take a more detailed look tomorrow; it's late.
Original comment by sh...@willden.org
on 26 Jan 2012 at 4:52
The test script breaks it down, I don't know why it happening, just that it is.
The key in question comes from our app Gibberbot, its an OTR chat app, so
that's a DSA key for OTR. DSA keys aren't very common these days outside of
OTR, so it could be that no one has used that method.
Original comment by h...@at.or.at
on 26 Jan 2012 at 2:32
DSA is pretty common in Google's usage of Keyczar (and it's internal parent).
We often exchange DSA keys with our external partners, too. But I don't know
how many of them are using Python, and Google's usage tends to be more Java and
C++.
Anyway, I'll do some testing today and get this merged. Thanks!
Original comment by swillden@google.com
on 31 Jan 2012 at 2:10
Actually, could I ask you to please write a unit test that verifies that this
is fixed? It should go in python/tests/keyczar_tests/util_test.py. I think
your test script is a good start, it just needs some restructuring and some
assertions rather than print statements.
Thanks.
Original comment by swillden@google.com
on 31 Jan 2012 at 5:01
Original comment by jtu...@gmail.com
on 2 Mar 2013 at 9:32
I added the unit test and patch. Will someone review the code before I push it
up?
Unit test:
https://code.google.com/p/keyczar/source/detail?r=fb9c29301fc987478fafe92a255562
14af566f5b&name=fix_x509_python
Patch:
https://code.google.com/p/keyczar/source/detail?name=fix_x509_python&r=11f075680
fbafd120f3ffed3b409983e76e289c2
Original comment by dlundb...@google.com
on 15 Jul 2013 at 3:58
Original comment by dlundb...@google.com
on 16 Jul 2013 at 4:17
Original comment by dlundb...@google.com
on 9 Sep 2013 at 5:45
Original issue reported on code.google.com by
h...@at.or.at
on 26 Jan 2012 at 3:23Attachments: