• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/router/neon/src/

Lines Matching refs:cert

81     ne_ssl_certificate cert;
178 if (cc->cert.identity) ne_free(cc->cert.identity);
180 X509_free(cc->cert.subject);
216 void ne_ssl_cert_validity_time(const ne_ssl_certificate *cert,
220 *from = asn1time_to_timet(X509_get_notBefore(cert->subject));
223 *until = asn1time_to_timet(X509_get_notAfter(cert->subject));
231 static int check_identity(const ne_uri *server, X509 *cert, char **identity)
239 names = X509_get_ext_d2i(cert, NID_subject_alt_name, NULL, NULL);
311 X509_NAME *subj = X509_get_subject_name(cert);
345 static ne_ssl_certificate *populate_cert(ne_ssl_certificate *cert, X509 *x5)
347 cert->subj_dn.dn = X509_get_subject_name(x5);
348 cert->issuer_dn.dn = X509_get_issuer_name(x5);
349 cert->issuer = NULL;
350 cert->subject = x5;
351 /* Retrieve the cert identity; pass a dummy hostname to match. */
352 cert->identity = NULL;
353 check_identity(NULL, x5, &cert->identity);
354 return cert;
357 /* OpenSSL cert verification callback. This is invoked for *each*
358 * error which is encoutered whilst verifying the cert chain; multiple
359 * invocations for any particular cert in the chain are possible. */
377 /* Map the error code onto any of the exported cert validation
422 ne_ssl_certificate *cert = ne_malloc(sizeof *cert);
423 populate_cert(cert, X509_dup(sk_X509_value(chain, n)));
427 X509_print_fp(ne_debug_stream, cert->subject);
431 current = top = cert;
433 current->issuer = cert;
434 current = cert;
444 X509 *cert = chain->subject;
465 ret = check_identity(&server, cert, NULL);
499 populate_cert(&newcc->cert, cc->cert.subject);
501 cc->cert.subject->references++;
507 static int provide_client_cert(SSL *ssl, X509 **cert, EVP_PKEY **pkey)
541 cc->cert.subject->references++;
542 *cert = cc->cert.subject;
563 /* set client cert callback. */
597 int ne_ssl_context_keypair(ne_ssl_context *ctx, const char *cert,
604 ret = SSL_CTX_use_certificate_chain_file(ctx->ctx, cert);
688 /* For an SSLv2 connection, the cert chain will always be NULL. */
690 X509 *cert = SSL_get_peer_certificate(ssl);
691 if (cert) {
693 sk_X509_push(chain, cert);
716 ne_ssl_certificate *cert = make_chain(chain);
720 if (check_certificate(sess, ssl, cert)) {
723 ne_ssl_cert_free(cert);
727 sess->server_cert = cert;
745 const ne_ssl_dname *ne_ssl_cert_issuer(const ne_ssl_certificate *cert)
747 return &cert->issuer_dn;
750 const ne_ssl_dname *ne_ssl_cert_subject(const ne_ssl_certificate *cert)
752 return &cert->subj_dn;
755 const ne_ssl_certificate *ne_ssl_cert_signedby(const ne_ssl_certificate *cert)
757 return cert->issuer;
760 const char *ne_ssl_cert_identity(const ne_ssl_certificate *cert)
762 return cert->identity;
765 void ne_ssl_context_trustcert(ne_ssl_context *ctx, const ne_ssl_certificate *cert)
769 X509_STORE_add_cert(store, cert->subject);
821 X509 *cert;
839 if (PKCS12_parse(p12, NULL, &pkey, &cert, NULL) == 1) {
844 if (!cert || !pkey) {
849 name = X509_alias_get0(cert, &len);
856 populate_cert(&cc->cert, cert);
914 populate_cert(&cc->cert, x5);
927 X509 *cert;
930 if (PKCS12_parse(cc->p12, password, &pkey, &cert, NULL) != 1) {
935 if (X509_check_private_key(cert, pkey) != 1) {
937 X509_free(cert);
939 NE_DEBUG(NE_DBG_SSL, "Decrypted private key/cert are not matched.");
944 populate_cert(&cc->cert, cert);
953 return &cc->cert;
964 X509 *cert;
969 cert = PEM_read_X509(fp, NULL, NULL, NULL);
972 if (cert == NULL) {
979 return populate_cert(ne_calloc(sizeof(struct ne_ssl_certificate_s)), cert);
982 int ne_ssl_cert_write(const ne_ssl_certificate *cert, const char *filename)
988 if (PEM_write_X509(fp, cert->subject) != 1) {
1000 void ne_ssl_cert_free(ne_ssl_certificate *cert)
1002 X509_free(cert->subject);
1003 if (cert->issuer)
1004 ne_ssl_cert_free(cert->issuer);
1005 if (cert->identity)
1006 ne_free(cert->identity);
1007 ne_free(cert);
1040 char *ne_ssl_cert_export(const ne_ssl_certificate *cert)
1047 len = i2d_X509(cert->subject, NULL);
1050 i2d_X509(cert->subject, &p); /* p is incremented */
1061 int ne_ssl_cert_digest(const ne_ssl_certificate *cert, char *digest)
1067 if (!X509_digest(cert->subject, EVP_sha1(), sha1, &len) || len != 20) {