Projet

Général

Profil

Bug #4403

PKIFreeText should include an instance of UTF8String, not the type

Ajouté par Drew Fisher il y a environ 10 ans. Mis à jour il y a plus de 2 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
-
Version cible:
-
Début:
05 mars 2014
Echéance:
% réalisé:

100%

Temps estimé:
Patch proposed:
Non
Planning:
Non

Description

When trying to use rfc3161 0.1.9 with pyasn1 0.1.7 as follows:

#!/usr/bin/env python
import rfc3161
blob = "unimportant" 
# I know I'm not passing in a cert, please ignore
ts = rfc3161.RemoteTimestamper("http://timestamp.apple.com/ts01")
tst, err = ts(data=blob)

I get the following stacktrace:

Traceback (most recent call last):
  File "minimal-test.py", line 6, in <module>
    tst, err = ts(data=blob)
  File "/Users/drew/git/redesign/env/lib/python2.7/site-packages/rfc3161/api.py", line 185, in __call__
    tst_response, substrate = decoder.decode(response, asn1Spec=rfc3161.TimeStampResp())
  File "/Users/drew/git/redesign/env/lib/python2.7/site-packages/pyasn1/codec/ber/decoder.py", line 792, in __call__
    stGetValueDecoder, self, substrateFun
  File "/Users/drew/git/redesign/env/lib/python2.7/site-packages/pyasn1/codec/ber/decoder.py", line 321, in valueDecoder
    component, head = decodeFun(head, asn1Spec)
  File "/Users/drew/git/redesign/env/lib/python2.7/site-packages/pyasn1/codec/ber/decoder.py", line 792, in __call__
    stGetValueDecoder, self, substrateFun
  File "/Users/drew/git/redesign/env/lib/python2.7/site-packages/pyasn1/codec/ber/decoder.py", line 321, in valueDecoder
    component, head = decodeFun(head, asn1Spec)
  File "/Users/drew/git/redesign/env/lib/python2.7/site-packages/pyasn1/codec/ber/decoder.py", line 792, in __call__
    stGetValueDecoder, self, substrateFun
  File "/Users/drew/git/redesign/env/lib/python2.7/site-packages/pyasn1/codec/ber/decoder.py", line 367, in valueDecoder
    component, head = decodeFun(head, asn1Spec)
  File "/Users/drew/git/redesign/env/lib/python2.7/site-packages/pyasn1/codec/ber/decoder.py", line 735, in __call__
    tagSet == __chosenSpec.getTagSet() or \
TypeError: unbound method getTagSet() must be called with UTF8String instance as first argument (got nothing instead)

It looks like rfc3161/types.py line 42 should be:

    componentType = char.UTF8String()

rather than

    componentType = char.UTF8String

Sidenote: is there a public copy of this repository that I can clone/checkout, rather than just using PyPI? Is this the right place to report issues/bugfixes?

Thanks,
Drew

Révisions associées

Révision ad89c71b (diff)
Ajouté par Benjamin Dauvergne il y a environ 8 ans

fix instantiation of UTF8String (fixes #4403)

Historique

#1

Mis à jour par Benjamin Dauvergne il y a environ 8 ans

  • Statut changé de Nouveau à Résolu (à déployer)
  • % réalisé changé de 0 à 100
#2

Mis à jour par Benjamin Dauvergne il y a environ 8 ans

  • Patch proposed mis à Non

Yes it's the right place, repository is http://git.entrouvert.org/python-rfc3161.git/ .

#3

Mis à jour par Frédéric Péters il y a plus de 2 ans

  • Statut changé de Résolu (à déployer) à Fermé
  • Planning mis à Non

Formats disponibles : Atom PDF