Commit 029bdaff authored by Julien Muchembled's avatar Julien Muchembled

Fix too many NewSessionError when nodes are in different timezones

Using datetime objects was a bad idea anyway. Its extra accuracy for
microseconds is lost because datime.utcnow() is slower than time.time().
parent 9751e221
# -*- coding: utf-8 -*-
import calendar, hashlib, hmac, logging, os, struct, subprocess, threading, time
from datetime import datetime
from OpenSSL import crypto
from . import utils
def newHmacSecret():
x = datetime.utcnow()
return utils.newHmacSecret(int(time.mktime(x.timetuple())) * 1000000
+ x.microsecond)
return utils.newHmacSecret(int(time.time() * 1000000))
def networkFromCa(ca):
return bin(ca.get_serial_number())[3:]
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment