diff options
Diffstat (limited to 'src/main/java/com/android/apksig/internal/apk/stamp/V2SourceStampSigner.java')
-rw-r--r-- | src/main/java/com/android/apksig/internal/apk/stamp/V2SourceStampSigner.java | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/main/java/com/android/apksig/internal/apk/stamp/V2SourceStampSigner.java b/src/main/java/com/android/apksig/internal/apk/stamp/V2SourceStampSigner.java index 9c00a88..1c1570a 100644 --- a/src/main/java/com/android/apksig/internal/apk/stamp/V2SourceStampSigner.java +++ b/src/main/java/com/android/apksig/internal/apk/stamp/V2SourceStampSigner.java @@ -35,7 +35,6 @@ import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.security.SignatureException; import java.security.cert.CertificateEncodingException; -import java.time.Instant; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; @@ -203,22 +202,6 @@ public abstract class V2SourceStampSigner { private static Map<Integer, byte[]> generateStampAttributes(SigningCertificateLineage lineage) { HashMap<Integer, byte[]> stampAttributes = new HashMap<>(); - - // Write the current epoch time as the timestamp for the source stamp. - long timestamp = Instant.now().getEpochSecond(); - if (timestamp > 0) { - ByteBuffer attributeBuffer = ByteBuffer.allocate(8); - attributeBuffer.order(ByteOrder.LITTLE_ENDIAN); - attributeBuffer.putLong(timestamp); - stampAttributes.put(SourceStampConstants.STAMP_TIME_ATTR_ID, attributeBuffer.array()); - } else { - // The epoch time should never be <= 0, and since security decisions can potentially - // be made based on the value in the timestamp, throw an Exception to ensure the issues - // with the environment are resolved before allowing the signing. - throw new IllegalStateException( - "Received an invalid value from Instant#getTimestamp: " + timestamp); - } - if (lineage != null) { stampAttributes.put(SourceStampConstants.PROOF_OF_ROTATION_ATTR_ID, lineage.encodeSigningCertificateLineage()); |