You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Bump Go version to 1.25.1
* Update CHANGELOG entry
* Bump the version of golangci-lint
* Remove references to the ms_tls13kdf build tag
* Download go module dependencies before GODEBUG=fips140=only is set
* Exclude X25519 curve types when testing in FIPS-140 mode
* Stricter check
* Add missing license header
* Exclude X25519 curve types when testing in FIPS-140-only mode
* Use stricter check
* Update NOTICE files
* Remove IsFIPS140Only helper function
* Set GODEBUG=tlsmlkem=0 for FIPS140-only unit tests
* Remove replace directive from go.mod
* Try not pre-downloading dependencies
(cherry picked from commit 15b8c8a)
Copy file name to clipboardExpand all lines: magefile.go
+141Lines changed: 141 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -309,6 +309,12 @@ var (
309
309
ifisSnapshot() {
310
310
tags=append(tags, "snapshot")
311
311
}
312
+
<<<<<<<HEAD
313
+
=======
314
+
ifisFIPS() {
315
+
tags=append(tags, "requirefips")
316
+
}
317
+
>>>>>>>15b8c8a (BumpGoversionto1.25.1 (#5562))
312
318
returnstrings.Join(tags, ",")
313
319
})
314
320
@@ -453,11 +459,50 @@ func (Check) Notice() {
453
459
mg.SerialDeps(mg.F(genNotice))
454
460
}
455
461
462
+
<<<<<<<HEAD
456
463
// genNotice generates the NOTICE.txt
457
464
funcgenNotice() error {
458
465
tags:= []string{}
459
466
outFile:="NOTICE.txt"
460
467
log.Println("Generating NOTICE.txt.")
468
+
=======
469
+
// DetectFIPSCryptoImports will do a best effort attempt to ensure that the imports list for FIPS compatible artifacts does not contain any external crypto libraries.
470
+
// Specifically it will fail if the modules list contains an entry with: "crypto", "gokrb5", or "pbkdf2"
471
+
func (Check) DetectFIPSCryptoImports() error {
472
+
tags:= []string{"requirefips"}
473
+
mods, err:=getModules(tags...)
474
+
iferr!=nil {
475
+
returnerr
476
+
}
477
+
478
+
args:=append([]string{"list", "-m"}, mods...)
479
+
output, err:=sh.Output("go", args...)
480
+
iferr!=nil {
481
+
returnerr
482
+
}
483
+
for _, line:=rangestrings.Split(output, "\n") {
484
+
// keywords are crypto for x/crypto imports, gokrb5 for kerberos, and pbkdf2 for pbkdf2 generation
485
+
for _, keyword:=range []string{"crypto", "gokrb5", "pbkdf2"} {
486
+
ifstrings.Contains(line, keyword) {
487
+
err=errors.Join(err, fmt.Errorf("Detected import %s may implement crypto functionality", line))
488
+
}
489
+
}
490
+
}
491
+
returnerr
492
+
}
493
+
494
+
// genNotice generates the NOTICE.txt or the NOTICE-fips.txt file.
495
+
funcgenNotice(fipsbool) error {
496
+
tags:= []string{}
497
+
outFile:="NOTICE.txt"
498
+
iffips {
499
+
log.Println("Generating NOTICE-fips.txt.")
500
+
tags=append(tags, "requirefips")
501
+
outFile="NOTICE-fips.txt"
502
+
} else {
503
+
log.Println("Generating NOTICE.txt.")
504
+
}
505
+
>>>>>>>15b8c8a (BumpGoversionto1.25.1 (#5562))
461
506
462
507
// Clean up modfile and download all needed files before building NOTICE
0 commit comments