Skip to content

Commit dc0143a

Browse files
committed
Everything works as expected now.
1 parent 6a07dd8 commit dc0143a

6 files changed

Lines changed: 34 additions & 35 deletions

X9.146/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ openssl x509 -in server-cert-pq.der -inform der -out server-P256-dilithium2-cer
101101
openssl pkey -in server-key.der -inform der -out server-P256-key.pem -outform pem
102102
103103
openssl pkey -in ../certs/dilithium_level2_server_key.der -inform der -out server-dilithium2-key-pq.pem -outform pem
104-
i
104+
105105
(last one must be done with OQS's openssl fork)
106106
```
107107
Then in wolfssl's source directory:
@@ -179,7 +179,7 @@ openssl x509 -in server-cert-pq.der -inform der -out server-P521-dilithium5-cer
179179
openssl pkey -in server-key.der -inform der -out server-P521-key.pem -outform pem
180180
181181
openssl pkey -in ../certs/dilithium_level5_server_key.der -inform der -out server-dilithium5-key-pq.pem -outform pem
182-
i
182+
183183
(last one must be done with OQS's openssl fork)
184184
```
185185
Then in wolfssl's source directory:
@@ -284,9 +284,9 @@ Generate the certificate chain:
284284

285285
```
286286
287-
./gen_dilithium_dual_keysig_root_cert
287+
./gen_rsa_dilithium_dual_keysig_root_cert
288288
289-
./gen_dilithium_dual_keysig_server_cert
289+
./gen_rsa_dilithium_dual_keysig_server_cert
290290
```
291291

292292
Convert the DER encoded resulting certificates and keys into PEM:
@@ -323,9 +323,9 @@ openssl genpkey -algorithm rsa -pkeyopt rsa_keygen_bits:3072 -out server-key.de
323323
Generate the certificate chain:
324324

325325
```
326-
./gen_falcon_dual_keysig_root_cert
326+
./gen_rsa_falcon_dual_keysig_root_cert
327327
328-
./gen_falcon_dual_keysig_server_cert
328+
./gen_rsa_falcon_dual_keysig_server_cert
329329
```
330330

331331
Convert the DER encoded resulting certificates and keys into PEM:

X9.146/gen_dual_keysig_cert.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <wolfssl/wolfcrypt/error-crypt.h>
3030
#include <wolfssl/wolfcrypt/logging.h>
3131

32-
#if defined(WOLFSSL_X9_146)
32+
#if defined(WOLFSSL_DUAL_ALG_CERTS)
3333

3434
#define LARGE_TEMP_SZ 4096
3535

@@ -288,7 +288,7 @@ static int do_certgen(int argc, char** argv)
288288

289289
/* Generate the DER for a pre-TBS. */
290290
XMEMSET(preTbsBuf, 0, preTbsSz);
291-
ret = GeneratePreTBS(&preTBS, preTbsBuf, preTbsSz);
291+
ret = wc_GeneratePreTBS(&preTBS, preTbsBuf, preTbsSz);
292292
if (ret < 0) goto exit;
293293
printf("PreTBS is %d bytes.\n", ret);
294294
preTbsSz = ret;
@@ -367,8 +367,8 @@ int main(int argc, char** argv)
367367

368368
int main(int argc, char** argv)
369369
{
370-
printf("Please compile wolfSSL with --enable-x9-146 or "
371-
"CFLAGS=\"-DWOLFSSL_X9_146\"");
370+
printf("Please compile wolfSSL with --enable-dual-alg-certs "
371+
"or CFLAGS=\"-DWOLFSSL_DUAL_ALG_CERTS\"");
372372
return 0;
373373
}
374374

X9.146/gen_ecdsa_dilithium_dual_keysig_cert.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <wolfssl/wolfcrypt/error-crypt.h>
3030
#include <wolfssl/wolfcrypt/logging.h>
3131

32-
#if defined(WOLFSSL_X9_146) && defined(HAVE_LIBOQS)
32+
#if defined(WOLFSSL_DUAL_ALG_CERTS) && defined(HAVE_LIBOQS)
3333

3434
#define LARGE_TEMP_SZ 9216
3535

@@ -149,9 +149,9 @@ static int do_certgen(int argc, char** argv)
149149
#endif
150150

151151
if (argc != 2)
152-
usage();
152+
usage(argv[0]);
153153

154-
switch (argv[1])
154+
switch (argv[1][0])
155155
{
156156
case '2':
157157
level = 2;
@@ -169,7 +169,7 @@ static int do_certgen(int argc, char** argv)
169169
altPrivFile = altPrivFile5;
170170
break;
171171
default:
172-
usage();
172+
usage(argv[0]);
173173
break;
174174
}
175175

@@ -342,7 +342,7 @@ static int do_certgen(int argc, char** argv)
342342

343343
/* Generate the DER for a pre-TBS. */
344344
XMEMSET(preTbsBuf, 0, preTbsSz);
345-
ret = GeneratePreTBS(&preTBS, preTbsBuf, preTbsSz);
345+
ret = wc_GeneratePreTBS(&preTBS, preTbsBuf, preTbsSz);
346346
if (ret < 0) goto exit;
347347
printf("PreTBS is %d bytes.\n", ret);
348348
preTbsSz = ret;
@@ -443,8 +443,8 @@ int main(int argc, char** argv)
443443

444444
int main(int argc, char** argv)
445445
{
446-
printf("Please compile wolfSSL with --enable-x9-146 --with-liboqs or "
447-
"CFLAGS=\"-DWOLFSSL_X9_146 -DHAVE_LIBOQS\"");
446+
printf("Please compile wolfSSL with --enable-dual-alg-certs --with-liboqs "
447+
"or CFLAGS=\"-DWOLFSSL_DUAL_ALG_CERTS -DHAVE_LIBOQS\"");
448448
return 0;
449449
}
450450

X9.146/gen_ecdsa_falcon_dual_keysig_cert.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <wolfssl/wolfcrypt/error-crypt.h>
3030
#include <wolfssl/wolfcrypt/logging.h>
3131

32-
#if defined(WOLFSSL_X9_146) && defined(HAVE_LIBOQS)
32+
#if defined(WOLFSSL_DUAL_ALG_CERTS) && defined(HAVE_LIBOQS)
3333

3434
#define LARGE_TEMP_SZ 9216
3535

@@ -146,12 +146,12 @@ static int do_certgen(int argc, char** argv)
146146
#endif
147147

148148
if (argc != 2)
149-
usage();
149+
usage(argv[0]);
150150

151-
switch (argv[1])
151+
switch (argv[1][0])
152152
{
153153
case '1':
154-
level = 2;
154+
level = 1;
155155
sapkiFile = sapkiFile1;
156156
altPrivFile = altPrivFile1;
157157
break;
@@ -161,7 +161,7 @@ static int do_certgen(int argc, char** argv)
161161
altPrivFile = altPrivFile5;
162162
break;
163163
default:
164-
usage();
164+
usage(argv[0]);
165165
break;
166166
}
167167

@@ -325,7 +325,7 @@ static int do_certgen(int argc, char** argv)
325325

326326
/* Generate the DER for a pre-TBS. */
327327
XMEMSET(preTbsBuf, 0, preTbsSz);
328-
ret = GeneratePreTBS(&preTBS, preTbsBuf, preTbsSz);
328+
ret = wc_GeneratePreTBS(&preTBS, preTbsBuf, preTbsSz);
329329
if (ret < 0) goto exit;
330330
printf("PreTBS is %d bytes.\n", ret);
331331
preTbsSz = ret;
@@ -420,8 +420,8 @@ int main(int argc, char** argv)
420420

421421
int main(int argc, char** argv)
422422
{
423-
printf("Please compile wolfSSL with --enable-x9-146 --with-liboqs or "
424-
"CFLAGS=\"-DWOLFSSL_X9_146 -DHAVE_LIBOQS\"");
423+
printf("Please compile wolfSSL with --enable-dual-alg-certs --with-liboqs "
424+
"or CFLAGS=\"-DWOLFSSL_DUAL_ALG_CERTS -DHAVE_LIBOQS\"");
425425
return 0;
426426
}
427427

X9.146/gen_rsa_dilithium_dual_keysig_cert.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <wolfssl/wolfcrypt/error-crypt.h>
3030
#include <wolfssl/wolfcrypt/logging.h>
3131

32-
#if defined(WOLFSSL_X9_146) && defined(HAVE_LIBOQS)
32+
#if defined(WOLFSSL_DUAL_ALG_CERTS) && defined(HAVE_LIBOQS)
3333

3434
#define LARGE_TEMP_SZ 9216
3535

@@ -86,8 +86,6 @@ static int do_certgen(int argc, char** argv)
8686
FILE* file;
8787
Cert newCert;
8888
DecodedCert preTBS;
89-
char *sapkiFile = NULL;
90-
char *altPrivFile = NULL;
9189

9290
#ifndef GEN_ROOT_CERT
9391
byte caCertBuf[LARGE_TEMP_SZ];
@@ -271,7 +269,7 @@ static int do_certgen(int argc, char** argv)
271269

272270
/* Generate the DER for a pre-TBS. */
273271
XMEMSET(preTbsBuf, 0, preTbsSz);
274-
ret = GeneratePreTBS(&preTBS, preTbsBuf, preTbsSz);
272+
ret = wc_GeneratePreTBS(&preTBS, preTbsBuf, preTbsSz);
275273
if (ret < 0) goto exit;
276274
printf("PreTBS is %d bytes.\n", ret);
277275
preTbsSz = ret;
@@ -351,8 +349,8 @@ int main(int argc, char** argv)
351349

352350
int main(int argc, char** argv)
353351
{
354-
printf("Please compile wolfSSL with --enable-x9-146 --with-liboqs or "
355-
"CFLAGS=\"-DWOLFSSL_X9_146 -DHAVE_LIBOQS\"");
352+
printf("Please compile wolfSSL with --enable-dual-alg-certs --with-liboqs "
353+
"or CFLAGS=\"-DWOLFSSL_DUAL_ALG_CERTS -DHAVE_LIBOQS\"");
356354
return 0;
357355
}
358356

X9.146/gen_rsa_falcon_dual_keysig_cert.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <wolfssl/wolfcrypt/error-crypt.h>
3030
#include <wolfssl/wolfcrypt/logging.h>
3131

32-
#if defined(WOLFSSL_X9_146) && defined(HAVE_LIBOQS)
32+
#if defined(WOLFSSL_DUAL_ALG_CERTS) && defined(HAVE_LIBOQS)
3333

3434
#define LARGE_TEMP_SZ 9216
3535

@@ -268,7 +268,7 @@ static int do_certgen(int argc, char** argv)
268268

269269
/* Generate the DER for a pre-TBS. */
270270
XMEMSET(preTbsBuf, 0, preTbsSz);
271-
ret = GeneratePreTBS(&preTBS, preTbsBuf, preTbsSz);
271+
ret = wc_GeneratePreTBS(&preTBS, preTbsBuf, preTbsSz);
272272
if (ret < 0) goto exit;
273273
printf("PreTBS is %d bytes.\n", ret);
274274
preTbsSz = ret;
@@ -348,8 +348,9 @@ int main(int argc, char** argv)
348348

349349
int main(int argc, char** argv)
350350
{
351-
printf("Please compile wolfSSL with --enable-x9-146 --with-liboqs or "
352-
"CFLAGS=\"-DWOLFSSL_X9_146 -DHAVE_LIBOQS\"");
351+
printf("Please compile wolfSSL with --enable-dual-alg-certs --with-liboqs "
352+
"or CFLAGS=\"-DWOLFSSL_DUAL_ALG_CERTS -DHAVE_LIBOQS\"");
353+
353354
return 0;
354355
}
355356

0 commit comments

Comments
 (0)