char *err;
X509 *x509;
X509_NAME *name;
+#if (OPENSSL_VERSION_NUMBER >= 0x40000000L)
+ const
+#endif
+ X509_NAME *sname;
X509_STORE *store;
STACK_OF(X509) *chain;
STACK_OF(X509_NAME) *list;
return NGX_ERROR;
}
- name = X509_get_subject_name(x509);
- if (name == NULL) {
+ sname = X509_get_subject_name(x509);
+ if (sname == NULL) {
ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
"X509_get_subject_name(\"%s\") failed", cert->data);
sk_X509_NAME_pop_free(list, X509_NAME_free);
return NGX_ERROR;
}
- name = X509_NAME_dup(name);
+ name = X509_NAME_dup(sname);
if (name == NULL) {
sk_X509_NAME_pop_free(list, X509_NAME_free);
sk_X509_pop_free(chain, X509_free);
char *subject, *issuer;
int err, depth;
X509 *cert;
+#if (OPENSSL_VERSION_NUMBER >= 0x40000000L)
+ const
+#endif
X509_NAME *sname, *iname;
ngx_connection_t *c;
ngx_ssl_conn_t *ssl_conn;
{
BIO *bio;
X509 *cert;
+#if (OPENSSL_VERSION_NUMBER >= 0x40000000L)
+ const
+#endif
X509_NAME *name;
s->len = 0;
{
BIO *bio;
X509 *cert;
+#if (OPENSSL_VERSION_NUMBER >= 0x40000000L)
+ const
+#endif
X509_NAME *name;
s->len = 0;
char *p;
size_t len;
X509 *cert;
+#if (OPENSSL_VERSION_NUMBER >= 0x40000000L)
+ const
+#endif
X509_NAME *name;
s->len = 0;
char *p;
size_t len;
X509 *cert;
+#if (OPENSSL_VERSION_NUMBER >= 0x40000000L)
+ const
+#endif
X509_NAME *name;
s->len = 0;
#endif
+#if (OPENSSL_VERSION_NUMBER < 0x1010000fL)
+#define ASN1_STRING_get0_data(x) (x)->data
+#endif
+
+
#if (OPENSSL_VERSION_NUMBER >= 0x30000000L && !defined SSL_get_peer_certificate)
#define SSL_get_peer_certificate(s) SSL_get1_peer_certificate(s)
#endif
static ngx_int_t
ngx_ssl_ocsp_create_key(ngx_ssl_ocsp_ctx_t *ctx)
{
- u_char *p;
- X509_NAME *name;
- ASN1_INTEGER *serial;
+ u_char *p;
+ ngx_int_t length;
+ ASN1_INTEGER *serial;
+ const X509_NAME *name;
p = ngx_pnalloc(ctx->pool, 60);
if (p == NULL) {
p += 20;
serial = X509_get_serialNumber(ctx->cert);
- if (serial->length > 20) {
+ length = ASN1_STRING_length(serial);
+
+ if (length > 20) {
return NGX_ERROR;
}
- p = ngx_cpymem(p, serial->data, serial->length);
- ngx_memzero(p, 20 - serial->length);
+ p = ngx_cpymem(p, ASN1_STRING_get0_data(serial), length);
+ ngx_memzero(p, 20 - length);
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, ctx->log, 0,
"ssl ocsp key %xV", &ctx->key);