Integrate 0.9.8 NDS read-only lab, repair upstream hook and simplify setup guidance

This commit is contained in:
2026-11-30 21:13:35 +00:00
parent b9fe2e61d2
commit c3aa4688d8
57 changed files with 2894 additions and 36 deletions

View File

@@ -21,4 +21,20 @@ int main(void){uint8_t b[1400],out[1400];uint32_t addr=inet_addr("192.168.1.42")
n=req(b,6,"","service:bindery.novell:///MARS_PCAP","DEFAULT","svcaddr-ws","",0);r=R();assert(has(out,r,"svcaddr-ws")&&!has(out,r,"svcname-ws"));
n=req(b,1,"","service:bindery.novell","DEFAULT","","unsupported",0);assert(!R());
n=req(b,1,"","service:bindery.novell","DEFAULT","","",0);b[8]=1;assert(!R());b[8]=0;assert(!slp_response(b,n,out,21,"MARS_PCAP",addr,0));assert(!slp_response(b,n,out,sizeof out,"BAD(NAME)",addr,0));
srand(123);for(int i=0;i<100000;i++){n=rand()%sizeof b;for(size_t j=0;j<n;j++)b[j]=rand();(void)R();}puts("PASS SLPv2 query, attributes, scope/filter, no NDS advertisement, malformed packets and random inputs");}
/* NDAP opt-in and root service, no cross-talk with classic service. */
#define D() slp_response_tree(b,n,out,sizeof out,"MARS_PCAP",addr,0,"MARS_TREE")
n=req(b,1,"","service:ndap.novell","DEFAULT","(svcname-ws=MARS_TREE)","",1);r=D();assert(r>20&&get16(out+18)==1&&has(out,r,"service:ndap.novell:///MARS_TREE."));assert(!R());
n=req(b,1,"","service:ndap.novell","DEFAULT","(&(svcname-ws=MARS_TREE.)(enabled-ws=true))","",1);assert(D());
n=req(b,1,"","service:ndap.novell","DEFAULT","(svcname-ws=OTHER)","",1);assert(!D());
n=req(b,1,"","service:ndap.novell","OTHER","","",1);assert(!D());
n=req(b,1,"192.168.1.42","service:ndap.novell","DEFAULT","","",1);assert(!D());
n=req(b,6,"","service:ndap.novell:///MARS_TREE.","DEFAULT","svcaddr-ws,svcname-ws","",0);r=D();assert(r>20&&has(out,r,"(svcaddr-ws=2-1-6-C0A8012A020C0000000000000000)")&&has(out,r,"(svcname-ws=MARS_TREE.)"));
n=req(b,1,"","service:bindery.novell","DEFAULT","","",1);r=D();assert(r&&has(out,r,"service:bindery.novell:///MARS_PCAP")&&!has(out,r,"ndap"));
uint8_t q[4]={0,3,2,0x78},node[6]={0,0,0,0,0,1};uint32_t net=htonl(0x12345678);
assert(nds_sap_reply(q,4,out,sizeof out,"MARS_TREE",net,node)==66);
assert(get16(out)==4&&get16(out+2)==0x278&&!memcmp(out+4,"MARS_TREE",9)&&get32(out+52)==0x12345678&&!memcmp(out+56,node,6)&&get16(out+62)==0x451&&get16(out+64)==1);
for(size_t j=13;j<36;j++)assert(out[j]=='_');
q[1]=1;assert(nds_sap_reply(q,4,out,sizeof out,"MARS_TREE",net,node)==66&&get16(out)==2);
assert(!nds_sap_reply(q,4,out,65,"MARS_TREE",net,node));assert(!nds_sap_reply(q,3,out,sizeof out,"MARS_TREE",net,node));assert(!nds_sap_reply(q,4,out,sizeof out,"MARS_TREE_",net,node));q[3]=4;assert(!nds_sap_reply(q,4,out,sizeof out,"MARS_TREE",net,node));
puts("PASS optional NDAP root URL/attributes, scope, filters, unchanged bindery and NDS SAP query encoding");
srand(123);for(int i=0;i<100000;i++){n=rand()%sizeof b;for(size_t j=0;j<n;j++)b[j]=rand();(void)R();(void)D();(void)nds_sap_reply(b,n,out,sizeof out,"MARS_TREE",net,node);}puts("PASS SLPv2 query, attributes, scope/filter, no NDS advertisement, malformed packets and random inputs");}