comparison app/src/main/java/ch/ethz/ssh2/KnownHosts.java @ 510:7953570e5210

update to ganymed-ssh2 tag 263 and fix hmac-sha2-512
author Carl Byington <carl@five-ten-sg.com>
date Wed, 01 Feb 2023 17:55:29 -0700
parents d29cce60f393
children
comparison
equal deleted inserted replaced
509:2eb4fa13b9ef 510:7953570e5210
178 if (salt.length != sha1.getDigestLength()) { 178 if (salt.length != sha1.getDigestLength()) {
179 throw new IllegalArgumentException("Salt has wrong length (" + salt.length + ")"); 179 throw new IllegalArgumentException("Salt has wrong length (" + salt.length + ")");
180 } 180 }
181 181
182 try { 182 try {
183 HMAC hmac = new HMAC(sha1, salt, salt.length); 183 HMAC hmac = new HMAC(sha1, salt, salt.length, 64);
184 hmac.update(StringEncoder.GetBytes(hostname)); 184 hmac.update(StringEncoder.GetBytes(hostname));
185 byte[] dig = new byte[hmac.getDigestLength()]; 185 byte[] dig = new byte[hmac.getDigestLength()];
186 hmac.digest(dig); 186 hmac.digest(dig);
187 return dig; 187 return dig;
188 } 188 }