Пример #1
0
    def do_verify(self, root, vote_file, conf, code):
        res = False
        msg = 'VIGA:\t%s\tTundmatu viga' % code
        inzip = None
        try:
            try:

                lname = root + '/' + vote_file
                inzip = zipfile.ZipFile(lname, 'r')
                bdocdata = inzip.read(htscommon.ZIP_BDOCFILE)

                ver = regrights.analyze_vote(bdocdata, conf)
                if ver.result:
                    res = True
                    msg = 'OK:\t%s\t%s' % (code, ver.ocsp_time)
                else:
                    res = False
                    msg = 'VIGA:\t%s\t%s' % (code, ver.error)
            except Exception as e:
                res = False
                msg = 'Viga:\t%s\t%s' % (code, e)
            except:
                pass
        finally:
            if inzip:
                inzip.close()

        return res, msg
Пример #2
0
 def do_verify(self, root, vote_file, conf, code):
     res = False
     msg = 'VIGA:\t%s\tTundmatu viga' % code
     try:
         ver = regrights.analyze_vote(root + '/' + vote_file, conf)
         if ver.result:
             res = True
             msg = 'OK:\t%s\t%s' % (code, ver.ocsp_time)
         else:
             res = False
             msg = 'VIGA:\t%s\t%s' % (code, ver.error)
     except Exception, e:
         res = False
         msg = 'Viga:\t%s\t%s' % (code, e)
Пример #3
0
 def do_verify(self, root, vote_file, conf, code):
     res = False
     msg = 'VIGA:\t%s\tTundmatu viga' % code
     try:
         ver = regrights.analyze_vote(root + '/' + vote_file, conf)
         if ver.result:
             res = True
             msg = 'OK:\t%s\t%s' % (code, ver.ocsp_time)
         else:
             res = False
             msg = 'VIGA:\t%s\t%s' % (code, ver.error)
     except Exception, e:
         res = False
         msg = 'Viga:\t%s\t%s' % (code, e)