|
|
@ -283,7 +283,7 @@ public class FullBackupImporter extends FullBackupBase {
|
|
|
|
|
|
|
|
|
|
|
|
out.close();
|
|
|
|
out.close();
|
|
|
|
|
|
|
|
|
|
|
|
byte[] ourMac = mac.doFinal();
|
|
|
|
byte[] ourMac = ByteUtil.trim(mac.doFinal(), 10);
|
|
|
|
byte[] theirMac = new byte[10];
|
|
|
|
byte[] theirMac = new byte[10];
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -293,7 +293,7 @@ public class FullBackupImporter extends FullBackupBase {
|
|
|
|
throw new IOException(e);
|
|
|
|
throw new IOException(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (MessageDigest.isEqual(ourMac, theirMac)) {
|
|
|
|
if (!MessageDigest.isEqual(ourMac, theirMac)) {
|
|
|
|
//destination.delete();
|
|
|
|
//destination.delete();
|
|
|
|
throw new IOException("Bad MAC");
|
|
|
|
throw new IOException("Bad MAC");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -314,9 +314,9 @@ public class FullBackupImporter extends FullBackupBase {
|
|
|
|
System.arraycopy(frame, frame.length - 10, theirMac, 0, theirMac.length);
|
|
|
|
System.arraycopy(frame, frame.length - 10, theirMac, 0, theirMac.length);
|
|
|
|
|
|
|
|
|
|
|
|
mac.update(frame, 0, frame.length - 10);
|
|
|
|
mac.update(frame, 0, frame.length - 10);
|
|
|
|
byte[] ourMac = mac.doFinal();
|
|
|
|
byte[] ourMac = ByteUtil.trim(mac.doFinal(), 10);
|
|
|
|
|
|
|
|
|
|
|
|
if (MessageDigest.isEqual(ourMac, theirMac)) {
|
|
|
|
if (!MessageDigest.isEqual(ourMac, theirMac)) {
|
|
|
|
throw new IOException("Bad MAC");
|
|
|
|
throw new IOException("Bad MAC");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|