Skip to content

Commit

Permalink
pkcs7: Fix endless loop when loading PKCS#7 via PEM import
Browse files Browse the repository at this point in the history
  • Loading branch information
chris2511 committed Oct 30, 2021
1 parent be1a44d commit 6efba2b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/pki_pkcs7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,13 @@ void pki_pkcs7::fromPEM_BIO(BIO *bio, const QString &name)
append_certs(myp7, name);
}

void pki_pkcs7::fromPEMbyteArray(const QByteArray &ba, const QString &name)
{
// Skip the pki_multi::fromPEMbyteArray(),
// which would cause an endless loop
pki_base::fromPEMbyteArray(ba, name);
}

void pki_pkcs7::fload(const QString &name)
{
PKCS7 *myp7;
Expand Down
1 change: 1 addition & 0 deletions lib/pki_pkcs7.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class pki_pkcs7: public pki_multi
void encryptFile(pki_x509 *crt, const QString &filename);
void writeP7(XFile &file, bool PEM);
void fromPEM_BIO(BIO *bio, const QString &name);
void fromPEMbyteArray(const QByteArray &, const QString &);
void fload(const QString &name);
};
#endif

0 comments on commit 6efba2b

Please sign in to comment.