Skip to content

SSH modules spam warning about MD5 fingerprints when there aren't any #40878

@joewreschnig

Description

@joewreschnig

Description of Issue/Question

After installing Salt 2016.11.4, my states spews

[WARNING ] Public Key hashing currently defaults to "md5". This will change to "sha256" in the Nitrogen release.

several dozen times when applied. This appears to be the result of #40543, which adds the fingerprint_hash_type option and warns if it's not set. I appreciate the effort to both move off of MD5 and help users migrate. However, some callers of _fingerprint in the same file still call directly without a hash, and there's no way for the user to provide one.

The simplest fix may be to have these callers provide literally any hash function, since most seem to be using it to validate keys rather than actually look at the fingerprint. Above that, I'm not sure why _fingerprint, a private function, is taking the hash as an optional argument in the first place. It seems like this would have been caught earlier had the argument been mandatory and caused an error rather than an ignorable warning, thereby forcing callers passing user data to pass None if they wanted the warning.

Versions Report

Salt Version:
           Salt: 2016.11.4
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.2
      docker-py: Not Installed
          gitdb: 0.5.4
      gitpython: 0.3.2 RC1
          ioflo: Not Installed
         Jinja2: 2.9.4
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.2
   mysql-python: 1.2.3
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.9 (default, Jun 29 2016, 13:08:31)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 14.4.0
           RAET: Not Installed
          smmap: 0.8.2
        timelib: Not Installed
        Tornado: 4.4.2
            ZMQ: 4.0.5
 
System Versions:
           dist: debian 8.7 
        machine: x86_64
        release: 4.4.27-x86_64-jb1
         system: Linux
        version: debian 8.7 

Metadata

Metadata

Assignees

Labels

Corerelates to code central or existential to SaltP1Priority 1bugbroken, incorrect, or confusing behaviorfixed-pls-verifyfix is linked, bug author to confirm fixseverity-low4th level, cosemtic problems, work around exists

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions