Branch: Tag:

2013-11-19

2013-11-19 14:05:50 by Martin Nilsson <nilsson@opera.com>

Added support for validating SHA-2 256/384/512 certificates.

281:    "public_key": 1,   ]) ]])    + test_any([[ +  // openssl req -x509 -nodes -days 365 -subj "/CN=PikeCert" -sha256 -newkey rsa:2048 -out certfile.cer +  return !!Standards.X509.verify_certificate(Standards.PEM.Messages( + #"-----BEGIN CERTIFICATE----- + MIIC+TCCAeGgAwIBAgIJANOmQYB8BiA6MA0GCSqGSIb3DQEBCwUAMBMxETAPBgNV + BAMMCFBpa2VDZXJ0MB4XDTEzMTExOTEzNDQxOVoXDTE0MTExOTEzNDQxOVowEzER + MA8GA1UEAwwIUGlrZUNlcnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB + AQC8sZtnnq7b8tBSZIM9MC5h9in8zF5jerv1JmS5aU85O3GYfN/862GxR4i6sxhM + 7kGlS/qGv65iGp/ld2vBwGZnQVa/Q+d51dyPPsgGzU3DsHsHogdwrKKDuo4RbFcB + AgTSzmZtHaEzaKQdl9l3fxAdcH0uLxLswYD0hvIHcTLJQKg+YNUIMWlGOiEfY8N9 + NV+CD1pUHRUi8t3jvst7IzPL2XfcsBa504lR6qTOaLFKGzlVRJ9tZGnM7OOLCRPB + s0SH/gEhz7BXtAwS7AZLyClTND84peGyc+yNEbl3KAcGjSgWQUmCFskWgLKSl4vF + /86Gw/pUne4MXOXj4GymIft1AgMBAAGjUDBOMB0GA1UdDgQWBBT2CgtRG0/MHJwJ + MoaBbbusDfjNHjAfBgNVHSMEGDAWgBT2CgtRG0/MHJwJMoaBbbusDfjNHjAMBgNV + HRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQClIqFapK5qFrAs0hvcHBBnHofn + zOe/+w6iEDfZfDr0HPnJ82ud/jze1h5oqWOjfVJxU1uerexr1zY9CAw02r5lbPDY + MQpq+dh+QEl47TXmfPRLhP1VDrhf4imZRiOBy7VMXJ9ry3VixclN3nkntcx3SbB9 + Qo2hMzbvtyF1uleBIyZhECN4THU5O2+FDwFOX4ZQGxQK/ANCNDN1rCAb5ndcYcKk + sMC/92tm3x5q8EHS1Yil4Q8BIiuj+2psKX9UZGAbMxB1czubQkyl9mNiV9V8PpGc + Vue27gwE5EFxe0/5NwQmjkyH6xD6KQx71T1pRdLr8MiAD1YhPsXx61VkDgtm + -----END CERTIFICATE-----")->parts->CERTIFICATE->body, ([])); + ]], 1) +  + test_any([[ +  // openssl req -x509 -nodes -days 365 -subj "/CN=PikeCert" -sha384 -newkey rsa:2048 -out certfile.cer +  return !!Standards.X509.verify_certificate(Standards.PEM.Messages( + #"-----BEGIN CERTIFICATE----- + MIIC+TCCAeGgAwIBAgIJAL7hTIcdxBC2MA0GCSqGSIb3DQEBDAUAMBMxETAPBgNV + BAMMCFBpa2VDZXJ0MB4XDTEzMTExOTEzNDkyMFoXDTE0MTExOTEzNDkyMFowEzER + MA8GA1UEAwwIUGlrZUNlcnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB + AQDrtRukBd5IMIJiKYDDnPYKOyxL1prfDZQK7imVUaPaJ7nFC4xEAdmslALwqatl + u17imWe/cVeL6Hrk6hfpbIIKTD21JaJDIeSfdBhnB5PrRrf2t7w7i9ycP17tPc+X + f24OIJLdSnG8hIhFfFF3ycKSAP95C6o+bMufPcHfbo4krDRC6sH9CmYjzTad7yLd + 5XZxQDZWzVrEGPDBqICie4dxXr3Z8cGaX8K0yJ/EcRit4JJ0DCEjqw5VzAcp0Ueb + 7cJBqR3RdjICfEzIk9b7JRGCxfzYdInE6lFdiz+qD7oZfKnLqJnxa0Bko5p7dLNl + 68AB0PhdSPlf/+OCq/CORVNvAgMBAAGjUDBOMB0GA1UdDgQWBBRrbb+EgxdZHmib + f6S9MXaLlz6gbjAfBgNVHSMEGDAWgBRrbb+EgxdZHmibf6S9MXaLlz6gbjAMBgNV + HRMEBTADAQH/MA0GCSqGSIb3DQEBDAUAA4IBAQBA/Bi+wAm4gvb2nQ2krHRX9Mqn + /shpH9ac3XtaZqTxcgmQngCWJCalYetHIwyTghMijDfwZv4fVx2I7Ss9Ay3rB5a0 + EocTN81NI3zQ7tCXvh99lEKXkZ0SwYdCHRFOr3C7yadoFRrXFOkjKKkv44AZptc6 + dddT4IhF0ccFNVops9yUkgdiSaZL+iWBKzPxNSP2m785ldzfpAaBfkIjtQm0LUtP + Mc8wNpKQCO3ldK2Paq+At0aaPXlRVIUtS9/w0MYL90w/3iDzR3OtTvb85I87G3A1 + xuStSBwdb6EpBU2Ige9qw5TVaulCBjAmdOUIJRwU5UoWTktcmrsM0aqjf+/R + -----END CERTIFICATE-----")->parts->CERTIFICATE->body, ([])); + ]], 1) +  + test_any([[ +  // openssl req -x509 -nodes -days 365 -subj "/CN=PikeCert" -sha512 -newkey rsa:2048 -out certfile.cer +  return !!Standards.X509.verify_certificate(Standards.PEM.Messages( + #"-----BEGIN CERTIFICATE----- + MIIC+TCCAeGgAwIBAgIJANPdhgZsaxbZMA0GCSqGSIb3DQEBDQUAMBMxETAPBgNV + BAMMCFBpa2VDZXJ0MB4XDTEzMTExOTEzNTg1M1oXDTE0MTExOTEzNTg1M1owEzER + MA8GA1UEAwwIUGlrZUNlcnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB + AQCh38qv4Sycmsg7mWX3uH5yV+lBcu9YK1Mr2RxomZ3Qmh0SNWHkUqySXZ6UAgy/ + rptf938jqtEm3XQ6BRwjGqcSjoPo0IaE/Zm3LmJHf0vDEckn0pz8yA5gXHVxVxlL + M40VtTH+LYrW8ZagwUUj2KppZSbWC91JJ61l8hody8zEIiwhm4Y4G2FYhFZZNPGK + btEL6cJCoFplkocWjHidnW2X33EGrY5vtp5W3bGbpzfxKjSAZVDGiCbfnam7GrhU + 8jDWpZEaCPiFVT2hY5Hz509FQlZpyOqzjhgfQPU5bGWphBzHpnma3ehvATdo5tjE + yHNXJLtlBR31ysfSHWUilvNhAgMBAAGjUDBOMB0GA1UdDgQWBBTlP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