Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

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  
    358358        int ret;
    359359        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);
    365365        void tls_cert_generate(TALLOC_CTX *, const char *, const char *, const char *, const char *);
    366366        params = talloc(mem_ctx, struct tls_params);
     
    370370        }
    371371
    372         if (!lp_tls_enabled(lp_ctx) || keyfile == NULL || *keyfile == 0) {
     372        if (!lpcfg_tls_enabled(lp_ctx) || keyfile == NULL || *keyfile == 0) {
    373373                params->tls_enabled = false;
    374374                talloc_free(tmp_ctx);
     
    378378        if (!file_exist(cafile)) {
    379379                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));
    381382                if (hostname == NULL) {
    382383                        goto init_failed;
  • vendor/current/source4/lib/tls/tls.h

    r414 r740  
    6666const struct socket_ops *socket_tls_ops(enum socket_type type);
    6767
    68 #endif
     68struct tstream_context;
     69struct tstream_tls_params;
     70
     71NTSTATUS 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
     76NTSTATUS 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
     86bool tstream_tls_params_enabled(struct tstream_tls_params *params);
     87
     88struct 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
     96int tstream_tls_connect_recv(struct tevent_req *req,
     97                             int *perrno,
     98                             TALLOC_CTX *mem_ctx,
     99                             struct tstream_context **tls_stream);
     100
     101struct 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
     109int 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  
    139139        bufsize = sizeof(buf);
    140140        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        }
    142145
    143146        bufsize = sizeof(buf);
    144147        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        }
    146152
    147153        bufsize = sizeof(buf);
    148154        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        }
    150159
    151160        gnutls_x509_privkey_deinit(key);
Note: See TracChangeset for help on using the changeset viewer.