pike.git/
lib/
modules/
Standards.pmod/
testsuite.in
Branch:
Tag:
Non-build tags
All tags
No tags
2014-08-27
2014-08-27 14:53:22 by Martin Nilsson <nilsson@opera.com>
01891ad9c8945d2830c08abb0ff82bd397096b0f (
11
lines) (+
11
/-
0
)
[
Show
|
Annotate
]
Branch:
8.0
Serialize TBSCertificate by storing the Sequence and regenerate the other fields.
437:
define(test_cert, ([[ test_true(Standards.X509.verify_certificate(Standards.PEM.Messages(#"$1")->parts->CERTIFICATE->body, ([])))
+
test_any([[
+
string der = Standards.PEM.Messages(#"$1")->parts->CERTIFICATE->body;
+
object o = decode_value(encode_value(Standards.X509.decode_certificate(der)));
+
/* TBS does not contain the full certificate... */
+
/* if( o->get_der() != der ) return -1; */
+
+
if( o->ext_basicConstraints != 1) return 2;
+
if( !o->public_key->pkc ) return 3;
+
return 1;
+
]], 1)
]])) dnl openssl req -x509 -nodes -days 365 -subj "/CN=PikeCert" -md5 -newkey rsa:2048 -out certfile.cer