mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
parent
f13becc50b
commit
f0bfd7224f
@ -210,7 +210,13 @@ public abstract class PushSendJob extends SendJob {
|
|||||||
|
|
||||||
protected void rotateSenderCertificateIfNecessary() throws IOException {
|
protected void rotateSenderCertificateIfNecessary() throws IOException {
|
||||||
try {
|
try {
|
||||||
SenderCertificate certificate = new SenderCertificate(TextSecurePreferences.getUnidentifiedAccessCertificate(context));
|
byte[] certificateBytes = TextSecurePreferences.getUnidentifiedAccessCertificate(context);
|
||||||
|
|
||||||
|
if (certificateBytes == null) {
|
||||||
|
throw new InvalidCertificateException("No certificate was present.");
|
||||||
|
}
|
||||||
|
|
||||||
|
SenderCertificate certificate = new SenderCertificate(certificateBytes);
|
||||||
|
|
||||||
if (System.currentTimeMillis() > (certificate.getExpiration() - CERTIFICATE_EXPIRATION_BUFFER)) {
|
if (System.currentTimeMillis() > (certificate.getExpiration() - CERTIFICATE_EXPIRATION_BUFFER)) {
|
||||||
throw new InvalidCertificateException("Certificate is expired, or close to it. Expires on: " + certificate.getExpiration() + ", currently: " + System.currentTimeMillis());
|
throw new InvalidCertificateException("Certificate is expired, or close to it. Expires on: " + certificate.getExpiration() + ", currently: " + System.currentTimeMillis());
|
||||||
|
Loading…
Reference in New Issue
Block a user