Skip to content

Commit

Permalink
#474 Use charset when generating aes vendor id info
Browse files Browse the repository at this point in the history
  • Loading branch information
srikanth-lingala committed Sep 12, 2022
1 parent 4aaa10a commit c64f9eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/net/lingala/zip4j/headers/HeaderWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public void writeLocalFileHeader(ZipModel zipModel, LocalFileHeader localFileHea
rawIO.writeShortLittleEndian(byteArrayOutputStream, (int) aesExtraDataRecord.getSignature().getValue());
rawIO.writeShortLittleEndian(byteArrayOutputStream, aesExtraDataRecord.getDataSize());
rawIO.writeShortLittleEndian(byteArrayOutputStream, aesExtraDataRecord.getAesVersion().getVersionNumber());
byteArrayOutputStream.write(aesExtraDataRecord.getVendorID().getBytes());
byteArrayOutputStream.write(getBytesFromString(aesExtraDataRecord.getVendorID(), charset));

byte[] aesStrengthBytes = new byte[1];
aesStrengthBytes[0] = (byte) aesExtraDataRecord.getAesKeyStrength().getRawCode();
Expand Down Expand Up @@ -496,7 +496,7 @@ private void writeFileHeader(ZipModel zipModel, FileHeader fileHeader, ByteArray
rawIO.writeShortLittleEndian(byteArrayOutputStream, (int) aesExtraDataRecord.getSignature().getValue());
rawIO.writeShortLittleEndian(byteArrayOutputStream, aesExtraDataRecord.getDataSize());
rawIO.writeShortLittleEndian(byteArrayOutputStream, aesExtraDataRecord.getAesVersion().getVersionNumber());
byteArrayOutputStream.write(aesExtraDataRecord.getVendorID().getBytes());
byteArrayOutputStream.write(getBytesFromString(aesExtraDataRecord.getVendorID(), charset));

byte[] aesStrengthBytes = new byte[1];
aesStrengthBytes[0] = (byte) aesExtraDataRecord.getAesKeyStrength().getRawCode();
Expand Down

0 comments on commit c64f9eb

Please sign in to comment.