Skip to content

Commit 3db4f57

Browse files
jgoertzen-sb jason.goertzen@sandboxquantum.comjgoertzen-sb
authored andcommitted
Resolving history issue
1 parent 9f20136 commit 3db4f57

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1377
-269
lines changed

.github/workflows/codeql.yml

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,22 @@ jobs:
3737
packages: liburcu-dev libuv1-dev libssl-dev libnghttp2-dev libxml2-dev liblmdb-dev libjson-c-dev pkg-config autoconf automake autotools-dev libtool-bin libjemalloc-dev libedit-dev libcap-dev libidn2-dev libkrb5-dev libmaxminddb-dev zlib1g-dev python3-ply astyle cmake gcc ninja-build python3-pytest python3-pytest-xdist unzip xsltproc doxygen graphviz python3-yaml valgrind
3838

3939
version: 1.0
40-
- name: Install liboqs 0.9.0
40+
- name: Install Openssl3.2.0
4141
run: |
42-
git clone --branch 0.9.0 https://github.com/open-quantum-safe/liboqs.git
42+
git clone --branch openssl-3.2.0 https://github.com/openssl/openssl.git
43+
cd openssl
44+
./Configure --prefix=$OPENSSL_ROOT_DIR --openssldir=$OPENSSL_ROOT_DIR no-docs -lm && make && make $NPROC install LIBDIR=lib
45+
env:
46+
OPENSSL_ROOT_DIR: ${{ runner.workspace }}/local_deps/ossl
47+
- name: Install liboqs from stateful-sigs branch
48+
run: |
49+
git clone --branch stateful-sigs https://github.com/open-quantum-safe/liboqs.git
4350
cd liboqs
4451
mkdir build
4552
cd build
46-
cmake -GNinja .. -DCMAKE_INSTALL_PREFIX=$liboqs_DIR && ninja && ninja run_tests && ninja install
53+
cmake -GNinja .. -DCMAKE_INSTALL_PREFIX=$liboqs_DIR -DOQS_EXPERIMENTAL_ENABLE_SIG_STFL_KEY_SIG_GEN=ON -D-DOQS_ENABLE_SIG_STFL_XMSS=ON && ninja && ninja run_tests && ninja install
4754
env:
4855
liboqs_DIR: ${{ runner.workspace }}/local_deps/oqs
49-
- name: Install Openssl3.2.0-beta1
50-
run: |
51-
git clone --branch openssl-3.2.0-beta1 https://github.com/openssl/openssl.git
52-
cd openssl
53-
./Configure --prefix=$OPENSSL_ROOT_DIR --openssldir=$OPENSSL_ROOT_DIR no-docs -lm && make && make $NPROC install LIBDIR=lib
54-
env:
55-
OPENSSL_ROOT_DIR: ${{ runner.workspace }}/local_deps/ossl
56-
5756
- name: Install OQS-provider
5857
run: |
5958
git clone https://github.com/open-quantum-safe/oqs-provider.git
@@ -68,22 +67,11 @@ jobs:
6867
uses: github/codeql-action/init@v2
6968
with:
7069
languages: ${{ matrix.language }}
71-
72-
#- name: Autobuild
73-
#uses: github/codeql-action/autobuild@v2
74-
#env:
75-
# OPENSSL_ROOT_DIR: ${{ runner.workspace }}/local_deps/ossl
76-
77-
# ℹ️ Command-line programs to run using the OS shell.
78-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
79-
80-
# If the Autobuild fails above, remove it and uncomment the following three lines.
81-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
8270
- name: Build bind9
8371
run: |
8472
cd ${{ runner.workspace }}/OQS-bind
8573
autoreconf -fi
86-
./configure --with-openssl=$OPENSSL_ROOT_DIR
74+
./configure LIBS="-loqs" --with-openssl=$OPENSSL_ROOT_DIR
8775
make -j $NPROC
8876
env:
8977
OPENSSL_ROOT_DIR: ${{ runner.workspace }}/local_deps/ossl

bin/delv/delv.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -635,11 +635,11 @@ key_fromconfig(const cfg_obj_t *key, dns_client_t *client, dns_view_t *toview) {
635635
dns_rdata_ds_t ds;
636636
uint32_t rdata1, rdata2, rdata3;
637637
const char *datastr = NULL, *keynamestr = NULL, *atstr = NULL;
638-
// OQS updated from 4096 to 8192
639-
unsigned char data[8192];
638+
// OQS updated from 4096 to 39000
639+
unsigned char data[39000];
640640
isc_buffer_t databuf;
641-
// OQS updated from 4096 to 8192
642-
unsigned char rrdata[8192];
641+
// OQS updated from 4096 to 39000
642+
unsigned char rrdata[39000];
643643
isc_buffer_t rrdatabuf;
644644
isc_region_t r;
645645
dns_fixedname_t fkeyname;

bin/dig/host.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ printsection(dns_message_t *msg, dns_section_t sectionid,
209209
isc_result_t result, loopresult;
210210
isc_region_t r;
211211
dns_name_t empty_name;
212-
// OQS updated from 4096 to 8192
213-
char tbuf[8192] = { 0 };
212+
// OQS updated from 4096 to 65355
213+
char tbuf[65355] = { 0 };
214214
bool first;
215215
bool no_rdata = (sectionid == DNS_SECTION_QUESTION);
216216

@@ -330,8 +330,8 @@ printrdata(dns_message_t *msg, dns_rdataset_t *rdataset,
330330
isc_buffer_t target;
331331
isc_result_t result;
332332
isc_region_t r;
333-
// OQS updated from 4096 to 8192
334-
char tbuf[8192];
333+
// OQS updated from 4096 to 39000
334+
char tbuf[39000];
335335

336336
UNUSED(msg);
337337
if (headers) {

bin/dnssec/dnssec-keyfromlabel.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,8 @@ main(int argc, char **argv) {
401401
case DST_ALG_FALCON512:
402402
case DST_ALG_DILITHIUM2:
403403
case DST_ALG_SPHINCSSHA256128S:
404+
case DST_ALG_XMSS:
405+
case DST_ALG_XMSSMT:
404406
break;
405407
default:
406408
fatal("%s is incompatible with NSEC3; "

bin/dnssec/dnssec-keygen.c

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
#include <dns/secalg.h>
5656

5757
#include <dst/dst.h>
58+
#include <dst/xmss.h>
5859

5960
#include <isccfg/cfg.h>
6061
#include <isccfg/grammar.h>
@@ -64,6 +65,7 @@
6465
#include <openssl/err.h>
6566
#include <openssl/provider.h>
6667
#endif
68+
#include <oqs/oqs.h>
6769

6870
#include "dnssectool.h"
6971

@@ -305,7 +307,6 @@ kasp_from_conf(cfg_obj_t *config, isc_mem_t *mctx, const char *name,
305307
dns_kasp_detach(&kasp);
306308
}
307309
}
308-
309310
static void
310311
keygen(keygen_ctx_t *ctx, isc_mem_t *mctx, int argc, char **argv) {
311312
char filename[255];
@@ -354,7 +355,6 @@ keygen(keygen_ctx_t *ctx, isc_mem_t *mctx, int argc, char **argv) {
354355
break;
355356
}
356357
}
357-
358358
if (ctx->use_nsec3) {
359359
switch (ctx->alg) {
360360
case DST_ALG_RSASHA1:
@@ -370,6 +370,8 @@ keygen(keygen_ctx_t *ctx, isc_mem_t *mctx, int argc, char **argv) {
370370
case DST_ALG_FALCON512:
371371
case DST_ALG_DILITHIUM2:
372372
case DST_ALG_SPHINCSSHA256128S:
373+
case DST_ALG_XMSS:
374+
case DST_ALG_XMSSMT:
373375
break;
374376
default:
375377
fatal("algorithm %s is incompatible with NSEC3"
@@ -423,6 +425,8 @@ keygen(keygen_ctx_t *ctx, isc_mem_t *mctx, int argc, char **argv) {
423425
case DST_ALG_FALCON512:
424426
case DST_ALG_DILITHIUM2:
425427
case DST_ALG_SPHINCSSHA256128S:
428+
case DST_ALG_XMSS:
429+
case DST_ALG_XMSSMT:
426430
break;
427431
default:
428432
fatal("key size not specified (-b option)");
@@ -596,6 +600,32 @@ keygen(keygen_ctx_t *ctx, isc_mem_t *mctx, int argc, char **argv) {
596600
case DST_ALG_SPHINCSSHA256128S:
597601
ctx->size = 256;
598602
break;
603+
case DST_ALG_XMSS:
604+
if (ctx->algname == NULL) {
605+
fatal("XMSS has a NULL algorithm name");
606+
}
607+
param = xmss_name_to_oid(ctx->algname);
608+
if (param == -1) {
609+
fatal("XMSS failed to get param based on algname");
610+
}
611+
ctx->size = xmss_name_to_bits(ctx->algname);
612+
if (ctx->size == -1) {
613+
fatal("XMSS failed to get bits based on param");
614+
}
615+
break;
616+
case DST_ALG_XMSSMT:
617+
if (ctx->algname == NULL) {
618+
fatal("XMSSMT has a NULL algorithm name");
619+
}
620+
param = xmssmt_name_to_oid(ctx->algname);
621+
if (param == -1) {
622+
fatal("XMSSMT failed to get param based on algname");
623+
}
624+
ctx->size = xmssmt_name_to_bits(ctx->algname);
625+
if (ctx->size == -1) {
626+
fatal("XMSSMT failed to get bits based on param");
627+
}
628+
break;
599629
}
600630

601631
if (ctx->nametype == NULL) {
@@ -690,7 +720,6 @@ keygen(keygen_ctx_t *ctx, isc_mem_t *mctx, int argc, char **argv) {
690720
fatal("failed to generate key %s/%s: %s\n", namestr,
691721
algstr, isc_result_totext(ret));
692722
}
693-
694723
dst_key_setbits(key, ctx->dbits);
695724
/*
696725
* Set key timing metadata (unless using -C)
@@ -890,7 +919,6 @@ main(int argc, char **argv) {
890919
OSSL_PROVIDER *fips = NULL, *base = NULL, *oqs = NULL,
891920
*default_provider = NULL;
892921
#endif
893-
894922
keygen_ctx_t ctx = {
895923
.options = DST_TYPE_PRIVATE | DST_TYPE_PUBLIC,
896924
.prepub = -1,
@@ -1233,8 +1261,18 @@ main(int argc, char **argv) {
12331261
if (algname == NULL) {
12341262
fatal("no algorithm specified");
12351263
}
1236-
r.base = algname;
1237-
r.length = strlen(algname);
1264+
if (strncmp(algname, "XMSSMT", 6) == 0) {
1265+
ctx.algname = (char *)xmssmt_bindname_to_name(algname);
1266+
r.base = (char *)"XMSSMT";
1267+
r.length = strlen("XMSSMT");
1268+
} else if (strncmp(algname, "XMSS", 4) == 0) {
1269+
ctx.algname = (char *)xmss_bindname_to_name(algname);
1270+
r.base = (char *)"XMSS";
1271+
r.length = strlen("XMSS");
1272+
} else {
1273+
r.base = algname;
1274+
r.length = strlen(algname);
1275+
}
12381276
ret = dns_secalg_fromtext(&ctx.alg, &r);
12391277
if (ret != ISC_R_SUCCESS) {
12401278
fatal("unknown algorithm %s", algname);

bin/dnssec/dnssec-signzone.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ static int nsec_datatype = dns_rdatatype_nsec;
111111
#define REVOKE(x) ((dst_key_flags(x) & DNS_KEYFLAG_REVOKE) != 0)
112112

113113
#define BUFSIZE \
114-
8192 // OQS increased from 2049 to 8192 to account for SPHINCS+ 128S
115-
// signatures.
114+
39000 // OQS increased from 2049 to 39000 to account for
115+
// XMSSMT-SHAKE256_60/12 signatures.
116116
#define MAXDSKEYS 8
117117

118118
#define SIGNER_EVENTCLASS ISC_EVENTCLASS(0x4453)

bin/dnssec/dnssectool.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,6 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
502502
if (result == ISC_R_NOTFOUND) {
503503
return (false);
504504
}
505-
506505
while (!ISC_LIST_EMPTY(matchkeys) && !conflict) {
507506
key = ISC_LIST_HEAD(matchkeys);
508507
if (dst_key_alg(key->key) != alg) {

bin/named/config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ options {\n\
7373
max-rsa-exponent-size 0; /* no limit */\n\
7474
max-udp-size 1232;\n\
7575
memstatistics-file \"named.memstats\";\n\
76-
nocookie-udp-size 8192;\n/*OQS updated from 4096*/\
76+
nocookie-udp-size 65355;\n/*OQS updated from 4096*/\
7777
notify-rate 20;\n\
7878
nta-lifetime 3600;\n\
7979
nta-recheck 300;\n\

bin/named/fuzz.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ fuzz_thread_client(void *arg) {
113113
goto next;
114114
}
115115

116-
// OQS updated from 4096 to 8192
116+
// OQS updated from 4096 to 65355
117117
/*
118-
* Ignore packets that are larger than 8192 bytes.
118+
* Ignore packets that are larger than 65355 bytes.
119119
*/
120-
if (length > 8192) {
120+
if (length > 65355) {
121121
/*
122122
* AFL_CMIN doesn't support persistent mode, so
123123
* shutdown the server.
@@ -367,8 +367,8 @@ fuzz_thread_resolver(void *arg) {
367367
continue;
368368
}
369369

370-
// OQS updated from 4096 to 8192
371-
if (length > 8192) {
370+
// OQS updated from 4096 to 65355
371+
if (length > 65355) {
372372
if (getenv("AFL_CMIN")) {
373373
free(buf);
374374
free(rbuf);

0 commit comments

Comments
 (0)