Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "crypto: more compact solution to detect endless loop"
This reverts commit bd978e1.
  • Loading branch information
nils91 committed Apr 23, 2021
commit 374335d019c15f603dbe6227434d94942438324c
13 changes: 8 additions & 5 deletions src/crypto/crypto_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -480,14 +480,17 @@ MaybeLocal<Object> GetLastIssuedCert(
return MaybeLocal<Object>();
issuer_chain = ca_info;

// Take the value of cert->get(), compare it with the value of ca
// and provide a way to exit this loop
// in case it gets stuck.
if (cert->get() == ca)
break;
// Take the value of cert->get() before and after the call to cert->reset()
// in order to compare them and provide a way to exit this loop
// in case it gets stuck
X509* value_before_reset = cert->get();

// Delete previous cert and continue aggregating issuers.
cert->reset(ca);

X509* value_after_reset = cert->get();
if (value_before_reset == value_after_reset)
Comment thread
nils91 marked this conversation as resolved.
Outdated
break;
}
return MaybeLocal<Object>(issuer_chain);
}
Expand Down