Coverage for /pythoncovmergedfiles/medio/medio/src/paramiko/paramiko/kex_group14.py: 92%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

12 statements  

1# Copyright (C) 2013 Torsten Landschoff <torsten@debian.org> 

2# 

3# This file is part of paramiko. 

4# 

5# Paramiko is free software; you can redistribute it and/or modify it under the 

6# terms of the GNU Lesser General Public License as published by the Free 

7# Software Foundation; either version 2.1 of the License, or (at your option) 

8# any later version. 

9# 

10# Paramiko is distributed in the hope that it will be useful, but WITHOUT ANY 

11# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 

12# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 

13# details. 

14# 

15# You should have received a copy of the GNU Lesser General Public License 

16# along with Paramiko; if not, write to the Free Software Foundation, Inc., 

17# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 

18 

19""" 

20Standard SSH key exchange ("kex" if you wanna sound cool). Diffie-Hellman of 

212048 bit key halves, using a known "p" prime and "g" generator. 

22""" 

23 

24from paramiko.kex_group1 import KexGroup1 

25from hashlib import sha1, sha256 

26 

27 

28class KexGroup14(KexGroup1): 

29 

30 # http://tools.ietf.org/html/rfc3526#section-3 

31 P = 0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF # noqa 

32 G = 2 

33 

34 name = "diffie-hellman-group14-sha1" 

35 hash_algo = sha1 

36 

37 

38class KexGroup14SHA256(KexGroup14): 

39 name = "diffie-hellman-group14-sha256" 

40 hash_algo = sha256