Changeset 740 for vendor/current/source4/lib/tls
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (13 years ago)
- Location:
- vendor/current/source4/lib/tls
- Files:
-
- 2 added
- 2 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source4/lib/tls/tls.c
r414 r740 358 358 int ret; 359 359 TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx); 360 const char *keyfile = lp _tls_keyfile(tmp_ctx, lp_ctx);361 const char *certfile = lp _tls_certfile(tmp_ctx, lp_ctx);362 const char *cafile = lp _tls_cafile(tmp_ctx, lp_ctx);363 const char *crlfile = lp _tls_crlfile(tmp_ctx, lp_ctx);364 const char *dhpfile = lp _tls_dhpfile(tmp_ctx, lp_ctx);360 const char *keyfile = lpcfg_tls_keyfile(tmp_ctx, lp_ctx); 361 const char *certfile = lpcfg_tls_certfile(tmp_ctx, lp_ctx); 362 const char *cafile = lpcfg_tls_cafile(tmp_ctx, lp_ctx); 363 const char *crlfile = lpcfg_tls_crlfile(tmp_ctx, lp_ctx); 364 const char *dhpfile = lpcfg_tls_dhpfile(tmp_ctx, lp_ctx); 365 365 void tls_cert_generate(TALLOC_CTX *, const char *, const char *, const char *, const char *); 366 366 params = talloc(mem_ctx, struct tls_params); … … 370 370 } 371 371 372 if (!lp _tls_enabled(lp_ctx) || keyfile == NULL || *keyfile == 0) {372 if (!lpcfg_tls_enabled(lp_ctx) || keyfile == NULL || *keyfile == 0) { 373 373 params->tls_enabled = false; 374 374 talloc_free(tmp_ctx); … … 378 378 if (!file_exist(cafile)) { 379 379 char *hostname = talloc_asprintf(mem_ctx, "%s.%s", 380 lp_netbios_name(lp_ctx), lp_realm(lp_ctx)); 380 lpcfg_netbios_name(lp_ctx), 381 lpcfg_dnsdomain(lp_ctx)); 381 382 if (hostname == NULL) { 382 383 goto init_failed; -
vendor/current/source4/lib/tls/tls.h
r414 r740 66 66 const struct socket_ops *socket_tls_ops(enum socket_type type); 67 67 68 #endif 68 struct tstream_context; 69 struct tstream_tls_params; 70 71 NTSTATUS tstream_tls_params_client(TALLOC_CTX *mem_ctx, 72 const char *ca_file, 73 const char *crl_file, 74 struct tstream_tls_params **_tlsp); 75 76 NTSTATUS tstream_tls_params_server(TALLOC_CTX *mem_ctx, 77 const char *dns_host_name, 78 bool enabled, 79 const char *key_file, 80 const char *cert_file, 81 const char *ca_file, 82 const char *crl_file, 83 const char *dhp_file, 84 struct tstream_tls_params **_params); 85 86 bool tstream_tls_params_enabled(struct tstream_tls_params *params); 87 88 struct tevent_req *_tstream_tls_connect_send(TALLOC_CTX *mem_ctx, 89 struct tevent_context *ev, 90 struct tstream_context *plain_stream, 91 struct tstream_tls_params *tls_params, 92 const char *location); 93 #define tstream_tls_connect_send(mem_ctx, ev, plain_stream, tls_params); \ 94 _tstream_tls_connect_send(mem_ctx, ev, plain_stream, tls_params, __location__) 95 96 int tstream_tls_connect_recv(struct tevent_req *req, 97 int *perrno, 98 TALLOC_CTX *mem_ctx, 99 struct tstream_context **tls_stream); 100 101 struct tevent_req *_tstream_tls_accept_send(TALLOC_CTX *mem_ctx, 102 struct tevent_context *ev, 103 struct tstream_context *plain_stream, 104 struct tstream_tls_params *tls_params, 105 const char *location); 106 #define tstream_tls_accept_send(mem_ctx, ev, plain_stream, tls_params) \ 107 _tstream_tls_accept_send(mem_ctx, ev, plain_stream, tls_params, __location__) 108 109 int tstream_tls_accept_recv(struct tevent_req *req, 110 int *perrno, 111 TALLOC_CTX *mem_ctx, 112 struct tstream_context **tls_stream); 113 114 #endif /* _TLS_H_ */ -
vendor/current/source4/lib/tls/tlscert.c
r414 r740 139 139 bufsize = sizeof(buf); 140 140 TLSCHECK(gnutls_x509_crt_export(crt, GNUTLS_X509_FMT_PEM, buf, &bufsize)); 141 file_save(certfile, buf, bufsize); 141 if (!file_save(certfile, buf, bufsize)) { 142 DEBUG(0,("Unable to save certificate in %s parent dir exists ?\n", certfile)); 143 goto failed; 144 } 142 145 143 146 bufsize = sizeof(buf); 144 147 TLSCHECK(gnutls_x509_crt_export(cacrt, GNUTLS_X509_FMT_PEM, buf, &bufsize)); 145 file_save(cafile, buf, bufsize); 148 if (!file_save(cafile, buf, bufsize)) { 149 DEBUG(0,("Unable to save ca cert in %s parent dir exists ?\n", cafile)); 150 goto failed; 151 } 146 152 147 153 bufsize = sizeof(buf); 148 154 TLSCHECK(gnutls_x509_privkey_export(key, GNUTLS_X509_FMT_PEM, buf, &bufsize)); 149 file_save(keyfile, buf, bufsize); 155 if (!file_save(keyfile, buf, bufsize)) { 156 DEBUG(0,("Unable to save privatekey in %s parent dir exists ?\n", keyfile)); 157 goto failed; 158 } 150 159 151 160 gnutls_x509_privkey_deinit(key);
Note:
See TracChangeset
for help on using the changeset viewer.