X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=ctypescrypto%2Fx509.py;fp=ctypescrypto%2Fx509.py;h=4f086328f2ee143afed0c939c6efbb9d7631be22;hb=ca6a5055ad8a9ea82e9f42aff3c906903d5e6df7;hp=44919f1ff9a26be49f66b80570872018c319f84c;hpb=7b9c29e43612629052e0ec875fd9ecbb35b0b02d;p=oss%2Fctypescrypto.git diff --git a/ctypescrypto/x509.py b/ctypescrypto/x509.py index 44919f1..4f08632 100644 --- a/ctypescrypto/x509.py +++ b/ctypescrypto/x509.py @@ -148,7 +148,7 @@ class X509Name(object): # Return first matching field idx=libcrypto.X509_NAME_get_index_by_NID(self.ptr,key.nid,-1) if idx<0: - raise KeyError("Key not found "+repr(Oid)) + raise KeyError("Key not found "+str(Oid)) entry=libcrypto.X509_NAME_get_entry(self.ptr,idx) s=libcrypto.X509_NAME_ENTRY_get_data(entry) b=Membio() @@ -168,6 +168,8 @@ class X509Name(object): def __setitem__(self,key,val): if not self.writable: raise ValueError("Attempt to modify constant X509 object") + else: + raise NotImplementedError class _x509_ext(Structure): """ Represens C structure X509_EXTENSION """ @@ -191,7 +193,6 @@ class X509_EXT(object): def __str__(self): b=Membio() libcrypto.X509V3_EXT_print(b.bio,self.ptr,0x20010,0) - libcrypto.X509V3_EXT_print.argtypes=(c_void_p,POINTER(_x509_ext),c_long,c_int) return str(b) def __unicode__(self): b=Membio() @@ -547,3 +548,4 @@ libcrypto.X509_EXTENSION_dup.restype=POINTER(_x509_ext) libcrypto.X509V3_EXT_print.argtypes=(c_void_p,POINTER(_x509_ext),c_long,c_int) libcrypto.X509_get_ext.restype=c_void_p libcrypto.X509_get_ext.argtypes=(c_void_p,c_int) +libcrypto.X509V3_EXT_print.argtypes=(c_void_p,POINTER(_x509_ext),c_long,c_int)