conditionally compile CMS SignedData detached signature example based on wolfSSL version

pull/113/head
Chris Conlon 2018-11-26 16:13:46 -08:00
parent 21ef7a1dfe
commit 8c0fbd1da1
1 changed files with 5 additions and 3 deletions

View File

@ -19,11 +19,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wolfssl/options.h>
#include <wolfssl/version.h>
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/wolfcrypt/pkcs7.h>
#include <wolfssl/wolfcrypt/error-crypt.h>
#include <wolfssl/wolfcrypt/logging.h>
/* Detached signature support was only in wolfSSL versions after 3.15.5 */
#if defined(HAVE_PKCS7) && (LIBWOLFSSL_VERSION_HEX > 0x03015005)
#define certFile "../certs/client-cert.der"
#define keyFile "../certs/client-key.der"
#define encodedFileNoAttrs "signedData_detached_noattrs.der"
@ -278,8 +282,6 @@ static int signedData_verify(byte* in, word32 inSz, byte* cert,
return ret;
}
#ifdef HAVE_PKCS7
int main(int argc, char** argv)
{
int ret;
@ -335,7 +337,7 @@ int main(int argc, char** argv)
int main(int argc, char** argv)
{
printf("Must build wolfSSL using ./configure --enable-pkcs7\n");
printf("Must build wolfSSL (> 3.15.5) using ./configure --enable-pkcs7\n");
return 0;
}