コード例 #1
0
ファイル: nt.py プロジェクト: gowhd20/Family-Shopping-Cart
    def flush(self):
        """Work around weakness in Windows RNG.

        The CryptGenRandom mechanism in some versions of Windows allows an
        attacker to learn 128 KiB of past and future output.  As a workaround,
        this function reads 128 KiB of 'random' data from Windows and discards
        it.

        For more information about the weaknesses in CryptGenRandom, see
        _Cryptanalysis of the Random Number Generator of the Windows Operating
        System_, by Leo Dorrendorf and Zvi Gutterman and Benny Pinkas
        http://eprint.iacr.org/2007/419
        """
        if self.closed:
            raise ValueError("I/O operation on closed file")
        data = self.__winrand.get_bytes(128*1024)
        assert (len(data) == 128*1024)
        BaseRNG.flush(self)
コード例 #2
0
ファイル: nt.py プロジェクト: 309972460/software
    def flush(self):
        """Work around weakness in Windows RNG.

        The CryptGenRandom mechanism in some versions of Windows allows an
        attacker to learn 128 KiB of past and future output.  As a workaround,
        this function reads 128 KiB of 'random' data from Windows and discards
        it.

        For more information about the weaknesses in CryptGenRandom, see
        _Cryptanalysis of the Random Number Generator of the Windows Operating
        System_, by Leo Dorrendorf and Zvi Gutterman and Benny Pinkas
        http://eprint.iacr.org/2007/419
        """
        if self.closed:
            raise ValueError("I/O operation on closed file")
        data = self.__winrand.get_bytes(128 * 1024)
        assert (len(data) == 128 * 1024)
        BaseRNG.flush(self)
コード例 #3
0
 def flush(self):
     if self.closed:
         raise ValueError('I/O operation on closed file')
     data = self.__winrand.get_bytes(131072)
     BaseRNG.flush(self)
コード例 #4
0
ファイル: nt.py プロジェクト: bizonix/DropBoxLibrarySRC
 def flush(self):
     if self.closed:
         raise ValueError('I/O operation on closed file')
     data = self.__winrand.get_bytes(131072)
     assert len(data) == 131072
     BaseRNG.flush(self)