diff options
author | Jan Cholasta <jcholast@redhat.com> | 2012-09-03 09:33:30 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2012-09-06 19:11:57 -0400 |
commit | 46ad724301e301d1bc96216b8873e704a37d35e3 (patch) | |
tree | 908bb30a22e372cf110be7d0e40f4e9a22c469bc /ipapython/ipautil.py | |
parent | 0f81268ec4a006625c8286ac7c6f5fed5aab7346 (diff) | |
download | freeipa-46ad724301e301d1bc96216b8873e704a37d35e3.tar.gz freeipa-46ad724301e301d1bc96216b8873e704a37d35e3.tar.xz freeipa-46ad724301e301d1bc96216b8873e704a37d35e3.zip |
Use OpenSSH-style public keys as the preferred format of SSH public keys.
Public keys in the old format (raw RFC 4253 blob) are automatically
converted to OpenSSH-style public keys. OpenSSH-style public keys are now
stored in LDAP.
Changed sshpubkeyfp to be an output parameter, as that is what it actually
is.
Allow parameter normalizers to be used on values of any type, not just
unicode, so that public key blobs (which are str) can be normalized to
OpenSSH-style public keys.
ticket 2932, 2935
Diffstat (limited to 'ipapython/ipautil.py')
-rw-r--r-- | ipapython/ipautil.py | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py index a212aa6ef..a3fd83e45 100644 --- a/ipapython/ipautil.py +++ b/ipapython/ipautil.py @@ -64,7 +64,6 @@ except ImportError: self.cmd = cmd def __str__(self): return "Command '%s' returned non-zero exit status %d" % (self.cmd, self.returncode) -from ipapython.compat import sha1, md5 def get_domain_name(): try: @@ -1022,25 +1021,6 @@ def backup_config_and_replace_variables( return old_values -def decode_ssh_pubkey(data, fptype=md5): - try: - (algolen,) = struct.unpack('>I', data[:4]) - if algolen > 0 and algolen <= len(data) - 4: - return (data[4:algolen+4], data[algolen+4:], fptype(data).hexdigest().upper()) - except struct.error: - pass - raise ValueError('not a SSH public key') - -def make_sshfp(key): - algo, data, fp = decode_ssh_pubkey(key, fptype=sha1) - if algo == 'ssh-rsa': - algo = 1 - elif algo == 'ssh-dss': - algo = 2 - else: - return - return '%d 1 %s' % (algo, fp) - def utf8_encode_value(value): if isinstance(value, unicode): |