From ef49f309e7154768c1ea03b08bcf8cb3ce8d0a32 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
Date: Thu, 23 Jan 2003 23:46:53 +0100
Subject: [PATCH] * testsuite/Makefile.am (TS_PROGS): Added pkcs1-test.

* testsuite/pkcs1-test.c: New test.

Rev: src/nettle/testsuite/.cvsignore:1.22
Rev: src/nettle/testsuite/Makefile.am:1.37
Rev: src/nettle/testsuite/pkcs1-test.c:1.1
---
 testsuite/.cvsignore   |  1 +
 testsuite/.gitignore   |  1 +
 testsuite/Makefile.am  |  1 +
 testsuite/pkcs1-test.c | 23 +++++++++++++++++++++++
 4 files changed, 26 insertions(+)
 create mode 100644 testsuite/pkcs1-test.c

diff --git a/testsuite/.cvsignore b/testsuite/.cvsignore
index d327f1f6..141de16f 100644
--- a/testsuite/.cvsignore
+++ b/testsuite/.cvsignore
@@ -19,6 +19,7 @@ hmac-test
 knuth-lfib-test
 md5-compat-test
 md5-test
+pkcs1-test
 rsa-keygen-test
 rsa-test
 rsa2sexp-test
diff --git a/testsuite/.gitignore b/testsuite/.gitignore
index 389266bb..c1e23523 100644
--- a/testsuite/.gitignore
+++ b/testsuite/.gitignore
@@ -19,6 +19,7 @@
 /knuth-lfib-test
 /md5-compat-test
 /md5-test
+/pkcs1-test
 /rsa-keygen-test
 /rsa-test
 /rsa2sexp-test
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index d39c53e3..d530f798 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -14,6 +14,7 @@ TS_PROGS = aes-test arcfour-test blowfish-test cast128-test \
 	   rsa2sexp-test sexp2rsa-test \
 	   knuth-lfib-test \
 	   cbc-test hmac-test bignum-test \
+	   pkcs1-test \
 	   rsa-test rsa-keygen-test \
 	   dsa-test dsa-keygen-test \
 	   yarrow-test
diff --git a/testsuite/pkcs1-test.c b/testsuite/pkcs1-test.c
new file mode 100644
index 00000000..90e99b73
--- /dev/null
+++ b/testsuite/pkcs1-test.c
@@ -0,0 +1,23 @@
+#include "testutils.h"
+
+#include "pkcs1.h"
+
+int
+test_main(void)
+{
+#if WITH_PUBLIC_KEY
+  
+  uint8_t buffer[16];
+  uint8_t expected[16] = {    1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+			   0xff, 0xff, 0xff, 0xff, 0,    'a',  'b',  'c' };
+
+  pkcs1_signature_prefix(sizeof(buffer), buffer,
+			 3, "abc");
+
+  ASSERT(MEMEQ(sizeof(buffer), buffer, expected));
+
+  SUCCESS();
+#else /* !WITH_PUBLIC_KEY */
+  SKIP();
+#endif /* !WITH_PUBLIC_KEY */
+}
-- 
GitLab