-
Notifications
You must be signed in to change notification settings - Fork 0
/
digest-failures.html
executable file
·70 lines (60 loc) · 2.66 KB
/
digest-failures.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<html>
<head>
<script type="text/javascript" src="DJS/encoding.js"></script>
<script type="text/javascript" src="DJS/hashing.js"></script>
<script type="text/javascript" src="DJS/aes.js"></script>
<script type="text/javascript" src="DJS/rsa.js"></script>
<script type="text/javascript" src="functions.js"></script>
<script type="text/javascript" src="algorithms.js"></script>
<script type="text/javascript" src="Key.js"></script>
<script type="text/javascript" src="generateKey.js"></script>
<script type="text/javascript" src="sign.js"></script>
<script type="text/javascript" src="decrypt.js"></script>
<script type="text/javascript" src="encrypt.js"></script>
<script type="text/javascript" src="exportKey.js"></script>
<script type="text/javascript" src="importKey.js"></script>
<script type="text/javascript" src="verify.js"></script>
<script type="text/javascript" src="digest.js"></script>
<script type="text/javascript" src="deriveKey.js"></script>
<script type="text/javascript" src="wrapKey.js"></script>
<script type="text/javascript" src="unwrapKey.js"></script>
<script type="text/javascript" src="../chrome/resources/common.js"></script>
<script type="text/javascript" src="../chrome/resources/js-test.js"></script>
<script type="text/javascript" src="subtlecrypto.js"></script>
<script type="text/javascript">
function init(){
var start = new Date().getTime();
window.crypto = crypto;
Promise.resolve(null).then(function(result) {
// Called with too few parameters.
return crypto.subtle.digest({name: 'SHA-1'});
}).then(failAndFinishJSTest, function(result) {
logError(result);
// "null" is not a valid data argument.
return crypto.subtle.digest({name: 'SHA-1'}, null);
}).then(failAndFinishJSTest, function(result) {
logError(result);
// 10 is not a valid data argument.
return crypto.subtle.digest({name: 'SHA-1'}, 10);
}).then(failAndFinishJSTest, function(result) {
logError(result);
// null is not a valid algorithm argument.
data = new Uint8Array([0]);
return crypto.subtle.digest(null, data);
}).then(failAndFinishJSTest, function(result) {
logError(result);
// "sha" is not a recognized algorithm name
return crypto.subtle.digest({name: 'SHA'}, data);
}).then(failAndFinishJSTest, function(result) {
logError(result);
// Algorithm lacks a name.
return crypto.subtle.digest({}, data);
}).then(failAndFinishJSTest, function(result) {
logError(result);
}).then(finishJSTest, failAndFinishJSTest);
}
</script>
</head>
<body onload="init()">
</body>
</html>