-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmemtest.js
83 lines (63 loc) · 2.77 KB
/
memtest.js
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
71
72
73
74
75
76
77
78
79
80
81
82
83
var x509 = require('./');
try {
var parsed = x509.parseCert("AAA");
} catch(err) {}
console.log("1", x509.info());
try {
x509.parseCert("BBB");
} catch(err) {}
console.log("2", x509.info());
try {
x509.parseCert("CCC");
} catch(err) {}
console.log("3", x509.info());
try {
x509.parseCert("DDD");
} catch(err) {}
console.log("4", x509.info());
var cert= '-----BEGIN CERTIFICATE-----\n' +
'MIIFRTCCBC2gAwIBAgIHJ6yuMLnzIzANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE\n' +
'BhMCVVMxEDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAY\n' +
'BgNVBAoTEUdvRGFkZHkuY29tLCBJbmMuMTMwMQYDVQQLEypodHRwOi8vY2VydGlm\n' +
'aWNhdGVzLmdvZGFkZHkuY29tL3JlcG9zaXRvcnkxMDAuBgNVBAMTJ0dvIERhZGR5\n' +
'IFNlY3VyZSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTERMA8GA1UEBRMIMDc5Njky\n' +
'ODcwHhcNMTMwNDI2MTQ1MTE3WhcNMTQwNDI2MTQ1MTE3WjA9MSEwHwYDVQQLExhE\n' +
'b21haW4gQ29udHJvbCBWYWxpZGF0ZWQxGDAWBgNVBAMTD3d3dy5hY2FsaW5lLmNv\n' +
'bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ9t6lDUaTlQiRZF8V5\n' +
'x9/IpwPO3hjVzApA20GysXt5r/VZ+blSgkt42NQUdQYNXX5E1H42CtAwg8giLqw6\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MQETYSC8FWn6LVTURRWwA/NIqM4AEGO+d3qwwchmw6pZX7R3+4DZ8f\n' +
'3IjOuovhqGt0EJEPRKqzbFzrjFCoRYpgn52aijBdZGLJaPvZOKT5fJ6ntsbgO0xK\n' +
'dd9L2ODL/CJzS/RRRhO0k76vCq88kX1pham8yXH6mYLcCrUcWY1HcgC/y/5EESWH\n' +
'Y5+UfLaeUH5QU3Wtg2qwo5fUDG8ox8PlNXKEs6u38/x84GKJdOmpzAP8/a/HPECM\n' +
'S0cBxC+UItcO\n' +
'-----END CERTIFICATE-----\n';
x509.parseCert(cert);
console.log("5", x509.info());
x509.parseCert(cert);
console.log("6", x509.info());
x509.parseCert(cert);
console.log("7", x509.info());
var str = "CCC";
for(var i = 0;i < 5;++i)
str = str + str;
for(var i = 8;i <= 20;++i) {
try {
x509.parseCert(str);
} catch(err) {}
console.log(i, x509.info());
}