Home GnuPG

Add test for decrypting email
Concern Raisedd3fc19ccfa57

Description

Add test for decrypting email

Details

Auditors
werner
Provenance
CarlSchwanAuthored on Sep 7 2023, 2:03 PM
Parents
rMTP4026d5db5b0a: Allow saving email either unchanged or decrypted
Branches
Unknown
Tags
Unknown

Event Timeline

werner added a subscriber: werner.
werner added inline comments.
/src/core/cryptohelper.cpp
178

Please use a macro here like

X_PGP_BEGIN_MESSAGE  "-----BEGIN PGP MESSAGE-----"
if (!strncmp (c, X_PGP_BEGIN_MESSAGE, sizeof (X_PGP_BEGIN_MESSAGE))
  {
  }

Duplicating strings is not good for future maintenance. It is too easy to accidentally edit one of them without noticing.

This commit now has outstanding concerns.Sep 7 2023, 2:10 PM

I think using a static const char * is better than using a macro. In fact, using a static constexpr std::string may be even better because we avoid calculating the string length during runtime again and again. (I'm not sure the compiler is clever enough to precalculate the string length of a static const char *.)