Beispiel #1
0
 def serialize(self):
     rb = {
         self.oid: {
             0x80: {
                 'value': self.status,
                 'type': 'intval'
             },
             0x81: {
                 'value': self.info,
                 'type': 'strval'
             }
         }
     }
     return HaspASN1.encode(rb)
Beispiel #2
0
 def serialize(self):
     sd = {
         self.oid: {
             0x80: {
                 'value': self.status,
                 'type': 'intval'
             },
             0x81: {
                 'value': self.client_id,
                 'type': 'intval'
             }
         }
     }
     return HaspASN1.encode(sd)
Beispiel #3
0
 def serialize(self):
     sd = {
         self.oid: {
             0x80: {
                 'value': self.session_id,
                 'type': 'intval'
             },
             0x81: {
                 'value': self.val_81,
                 'type': 'intval'
             }
         }
     }
     return HaspASN1.encode(sd)
Beispiel #4
0
 def serialize(self):
     bcid = struct.pack(">I", self.sc_id)
     rb = {
         self.oid: {
             0x80: {
                 'value': self.status,
                 'type': 'intval'
             },
             0x81: {
                 'value': bcid
             }
         }
     }
     return HaspASN1.encode(rb)
Beispiel #5
0
 def serialize(self):
     rb = {
         self.oid: {
             0x80: {
                 'value': self.status,
                 'type': 'intval'
             },
             0x81: {
                 'value': self.session_id,
                 'type': 'intval'
             },
             0x82: {
                 'value': self.hasp_serial,
                 'type': 'intval'
             },
             0x83: {
                 'value': self.val_83,
                 'type': 'intval'
             },
             0x84: {
                 'value': self.val_84,
                 'type': 'intval'
             },
             0x85: {
                 'value': self.val_85,
                 'type': 'intval'
             },
             0x87: {
                 'value': self.val_87,
                 'type': 'intval'
             },
             0x88: {
                 'value': self.sc_id,
                 'type': 'intval'
             },
             0x89: {
                 'value': self.val_89,
                 'type': 'intval'
             },
             0x8A: {
                 'value': self.val_8a
             },
             0x8B: {
                 'value': self.val_8b,
                 'type': 'intval'
             },
         }
     }
     return HaspASN1.encode(rb)
Beispiel #6
0
 def serialize(self):
     rb = {
         self.oid: {
             0x80: {
                 'value': self.status,
                 'type': 'intval'
             },
             0x81: {
                 'value': self.rtc_timestamp,
                 'type': 'intval',
                 'blen': 5
             },
         }
     }
     return HaspASN1.encode(rb)
Beispiel #7
0
 def serialize(self):
     rb = {
         self.oid: {
             0x80: {
                 'value': self.session_id,
                 'type': 'intval'
             },
             0x81: {
                 'value': self.file_id,
                 'type': 'intval',
                 'blen': 3
             }
         }
     }
     return HaspASN1.encode(rb)
Beispiel #8
0
 def serialize(self):
     rb = {
         self.oid: {
             0x80: {
                 'value': self.status,
                 'type': 'intval'
             },
             0x81: {
                 'value': self.data
             },
             0x82: {
                 'value': self.val_82,
                 'type': 'intval'
             }
         }
     }
     return HaspASN1.encode(rb)
Beispiel #9
0
 def serialize(self):
     rb = {
         self.oid: {
             0x80: {
                 'value': self.status,
                 'type': 'intval'
             },
             0x81: {
                 'value': self.num_written,
                 'type': 'intval'
             },
             0x82: {
                 'value': self.seedvals
             },
         }
     }
     return HaspASN1.encode(rb)
Beispiel #10
0
 def serialize(self):
     sd = {
         self.oid: {
             0x80: {
                 'value': self.val_80,
                 'type': 'intval'
             },
             0x81: {
                 'value': self.api_version_major,
                 'type': 'intval'
             },
             0x82: {
                 'value': self.api_version_minor,
                 'type': 'intval'
             },
             0x84: {
                 'value': HaspUtils.GetTimestamp(),
                 'type': 'intval',
                 'blen': 5
             }
         }
     }
     return HaspASN1.encode(sd)
Beispiel #11
0
 def serialize(self):
     is_linux_request = False
     if (self.tid == 0x1234):
         is_linux_request = True
     rb = {
         self.oid: {
             0x80: {
                 'value': self.pid,
                 'type': 'intval',
                 'blen': 2
             },
             0x81: {
                 'value': self.tid,
                 'type': 'intval',
                 'blen': 2
             },
             0x82: {
                 'value': self.hasp_uid,
                 'type': 'intval',
                 'blen': 2
             },  # This is 0 in linux
             0x83: {
                 'value': self.vendor_id,
                 'type': 'intval',
                 'blen': 3
             },
             0x84: {
                 'value': self.username,
                 'type': 'strval'
             },
             0x85: {
                 'value': self.machine_name,
                 'type': 'strval'
             },
             0x86: {
                 'value': self.login_type,
                 'type': 'strval'
             },
             0x87: {
                 'value': self.spec,
                 'type': 'strval'
             },
             0x88: {
                 'value': self.scope,
                 'type': 'strval'
             },
             0x89: {
                 'value': self.api_version_major,
                 'type': 'intval'
             },
             0x8A: {
                 'value': self.api_version_minor,
                 'type': 'intval'
             },
             0x8B: {
                 'value': HaspUtils.GetTimestamp(),
                 'type': 'intval',
                 'blen': 5
             },
             0x8C: {
                 'value': self.val_8c,
                 'type': 'intval'
             },
             0x8D: {
                 'value': self.val_8d,
                 'type': 'intval'
             },
             0x8E: {
                 'value': self.val_8e,
                 'type': 'intval'
             },
             0x8F: {
                 'value': self.val_8f,
                 'type': 'intval'
             },
             0x90: {
                 'value': self.volume_serial,
                 'type': 'intval',
                 'blen': 4
             },
             0x91: {
                 'value': self.val_91,
                 'type': 'intval'
             },
             0x92: {
                 'value': self.hasp_handle,
                 'type': 'intval',
                 'blen': 5
             },
             0x93: {
                 'value': self.val_93,
                 'type': 'intval'
             },
         }
     }
     if (is_linux_request == True):
         rb[self.oid][0x90] = {
             'value': self.volume_serial,
             'type': 'strval'
         }
     return HaspASN1.encode(rb)
Beispiel #12
0
 def serialize(self):
     rb = {
         self.oid: {
             0x80: {
                 'value': self.pid,
                 'type': 'intval',
                 'blen': 2
             },
             0x81: {
                 'value': self.tid,
                 'type': 'intval',
                 'blen': 2
             },
             0x82: {
                 'value': self.hasp_uid,
                 'type': 'intval',
                 'blen': 2
             },
             0x83: {
                 'value': self.vendor_id,
                 'type': 'intval',
                 'blen': 3
             },
             0x84: {
                 'value': self.feature_id,
                 'type': 'intval'
             },
             0x85: {
                 'value': self.username,
                 'type': 'strval'
             },
             0x86: {
                 'value': self.machine_name,
                 'type': 'strval'
             },
             0x87: {
                 'value': self.login_type,
                 'type': 'strval'
             },
             0x88: {
                 'value': self.api_version_major,
                 'type': 'intval'
             },
             0x89: {
                 'value': self.api_version_minor,
                 'type': 'intval'
             },
             0x8A: {
                 'value': HaspUtils.GetTimestamp(),
                 'type': 'intval',
                 'blen': 5
             },
             0x8B: {
                 'value': self.val_8b,
                 'type': 'intval'
             },
             0x8C: {
                 'value': self.val_8c,
                 'type': 'intval'
             },
             0x8D: {
                 'value': self.val_8d,
                 'type': 'intval'
             },
             0x8E: {
                 'value': self.val_8e,
                 'type': 'intval'
             },
             0x8F: {
                 'value': self.volume_serial,
                 'type': 'intval',
                 'blen': 4
             },
             0x90: {
                 'value': self.val_90,
                 'type': 'intval'
             },
             0x91: {
                 'value': self.hasp_handle,
                 'type': 'intval',
                 'blen': 5
             }
         }
     }
     return HaspASN1.encode(rb)