forked from bytecodealliance/wasm-tools
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update parsing of integrity metadata
- Loading branch information
1 parent
5995973
commit b0f0f0e
Showing
6 changed files
with
102 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -228,8 +228,8 @@ | |
(component | ||
(import "locked-dep=<a:b>" (func)) | ||
(import "locked-dep=<a:[email protected]>" (func)) | ||
(import "locked-dep=<a:b>,integrity=<a>" (func)) | ||
(import "locked-dep=<a:[email protected]>,integrity=<a>" (func)) | ||
(import "locked-dep=<a:b>,integrity=<sha256-a>" (func)) | ||
(import "locked-dep=<a:[email protected]>,integrity=<sha256-a>" (func)) | ||
) | ||
|
||
(assert_invalid | ||
|
@@ -269,7 +269,7 @@ | |
(component | ||
(import "url=<>" (func)) | ||
(import "url=<a>" (func)) | ||
(import "url=<a>,integrity=<a>" (func)) | ||
(import "url=<a>,integrity=<sha256-a>" (func)) | ||
) | ||
|
||
(assert_invalid | ||
|
@@ -280,6 +280,38 @@ | |
"failed to find `>`") | ||
|
||
(component | ||
(import "integrity=<>" (func)) | ||
(import "integrity=<a>" (func)) | ||
(import "integrity=<sha256-a>" (func)) | ||
(import "integrity=<sha384-a>" (func)) | ||
(import "integrity=<sha512-a>" (func)) | ||
(import "integrity=<sha512-a sha256-b>" (func)) | ||
(import "integrity=< sha512-a sha256-b >" (func)) | ||
(import "integrity=< sha512-a?abcd >" (func)) | ||
(import "integrity=<sha256-abcdefghijklmnopqrstuvwxyz>" (func)) | ||
(import "integrity=<sha256-ABCDEFGHIJKLMNOPQRSTUVWXYZ>" (func)) | ||
(import "integrity=<sha256-++++++++++++++++++++==>" (func)) | ||
(import "integrity=<sha256-////////////////////==>" (func)) | ||
) | ||
(assert_invalid | ||
(component (import "integrity=<>" (func))) | ||
"integrity hash cannot be empty") | ||
(assert_invalid | ||
(component (import "integrity=<sha256>" (func))) | ||
"expected `-` after hash algorithm") | ||
(assert_invalid | ||
(component (import "integrity=<sha256->" (func))) | ||
"not valid base64") | ||
(assert_invalid | ||
(component (import "integrity=<sha256-^^^^>" (func))) | ||
"not valid base64") | ||
(assert_invalid | ||
(component (import "integrity=<sha256-=========>" (func))) | ||
"not valid base64") | ||
(assert_invalid | ||
(component (import "integrity=<sha256-=>" (func))) | ||
"not valid base64") | ||
(assert_invalid | ||
(component (import "integrity=<sha256-==>" (func))) | ||
"not valid base64") | ||
(assert_invalid | ||
(component (import "integrity=<md5-ABC>" (func))) | ||
"unrecognized hash algorithm") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
(type (;1;) (func)) | ||
(import "locked-dep=<a:[email protected]>" (func (;1;) (type 1))) | ||
(type (;2;) (func)) | ||
(import "locked-dep=<a:b>,integrity=<a>" (func (;2;) (type 2))) | ||
(import "locked-dep=<a:b>,integrity=<sha256-a>" (func (;2;) (type 2))) | ||
(type (;3;) (func)) | ||
(import "locked-dep=<a:[email protected]>,integrity=<a>" (func (;3;) (type 3))) | ||
(import "locked-dep=<a:[email protected]>,integrity=<sha256-a>" (func (;3;) (type 3))) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 18 additions & 2 deletions
20
tests/snapshots/local/component-model/import.wast/59.print
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,22 @@ | ||
(component | ||
(type (;0;) (func)) | ||
(import "integrity=<>" (func (;0;) (type 0))) | ||
(import "integrity=<sha256-a>" (func (;0;) (type 0))) | ||
(type (;1;) (func)) | ||
(import "integrity=<a>" (func (;1;) (type 1))) | ||
(import "integrity=<sha384-a>" (func (;1;) (type 1))) | ||
(type (;2;) (func)) | ||
(import "integrity=<sha512-a>" (func (;2;) (type 2))) | ||
(type (;3;) (func)) | ||
(import "integrity=<sha512-a sha256-b>" (func (;3;) (type 3))) | ||
(type (;4;) (func)) | ||
(import "integrity=< sha512-a sha256-b >" (func (;4;) (type 4))) | ||
(type (;5;) (func)) | ||
(import "integrity=< sha512-a?abcd >" (func (;5;) (type 5))) | ||
(type (;6;) (func)) | ||
(import "integrity=<sha256-abcdefghijklmnopqrstuvwxyz>" (func (;6;) (type 6))) | ||
(type (;7;) (func)) | ||
(import "integrity=<sha256-ABCDEFGHIJKLMNOPQRSTUVWXYZ>" (func (;7;) (type 7))) | ||
(type (;8;) (func)) | ||
(import "integrity=<sha256-++++++++++++++++++++==>" (func (;8;) (type 8))) | ||
(type (;9;) (func)) | ||
(import "integrity=<sha256-////////////////////==>" (func (;9;) (type 9))) | ||
) |