Package: file
Version: 4.17-4
Severity: normal

Program "file" doesn't recognize correctly OpenSSH/OpenSSL public &
private keys :

$ file .ssh/id_*
.ssh/id_dsa:     ASCII text
.ssh/id_dsa.pub: ASCII text, with very long lines
.ssh/id_rsa:     ASCII text
.ssh/id_rsa.pub: ASCII text, with very long lines

With the attached patch applyed , we now get this :

$ file .ssh/id_*
.ssh/id_dsa:     PEM DSA private key
.ssh/id_dsa.pub: OpenSSH DSA public key
.ssh/id_rsa:     PEM RSA private key
.ssh/id_rsa.pub: OpenSSH RSA public key

Attached patch targets /etc/magic but may be changed to /usr/share/file/magic.

-- System Information:
Debian Release: 4.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.18.3

Versions of packages file depends on:
ii  libc6                         2.6.1-1    GNU C Library: Shared libraries
ii  libmagic1                  4.17-4     File type determination library us
3a4,14
> #------------------------------------------------------------------------------
> # OpenSSH / OpenSSL keys/certificates
> # from Nicolas Collignon <[EMAIL PROTECTED]>
> 0	string	SSH\ PRIVATE\ KEY		OpenSSH RSA1 private key
> >28	string	>\0				version %s
> 0	string	ssh-rsa\ 			OpenSSH RSA public key
> 0	string	ssh-dss\ 			OpenSSH DSA public key
> 0	string 	-----BEGIN\ CERTIFICATE-----	PEM certificate
> 0	string 	-----BEGIN\ CERTIFICATE\ REQ	PEM certificate request
> 0	string 	-----BEGIN\ RSA\ PRIVATE	PEM RSA private key
> 0	string 	-----BEGIN\ DSA\ PRIVATE	PEM DSA private key

Reply via email to