Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/security/manager/ssl/nsTLSSocketProvider.cpp
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2
 *
3
 * This Source Code Form is subject to the terms of the Mozilla Public
4
 * License, v. 2.0. If a copy of the MPL was not distributed with this
5
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#include "mozilla/BasePrincipal.h"
8
#include "nsTLSSocketProvider.h"
9
#include "nsNSSIOLayer.h"
10
#include "nsError.h"
11
12
using mozilla::OriginAttributes;
13
14
nsTLSSocketProvider::nsTLSSocketProvider()
15
0
{
16
0
}
17
18
nsTLSSocketProvider::~nsTLSSocketProvider()
19
0
{
20
0
}
21
22
NS_IMPL_ISUPPORTS(nsTLSSocketProvider, nsISocketProvider)
23
24
NS_IMETHODIMP
25
nsTLSSocketProvider::NewSocket(int32_t family,
26
                               const char *host,
27
                               int32_t port,
28
                               nsIProxyInfo *proxy,
29
                               const OriginAttributes &originAttributes,
30
                               uint32_t flags,
31
                               uint32_t tlsFlags,
32
                               PRFileDesc **_result,
33
                               nsISupports **securityInfo)
34
0
{
35
0
  nsresult rv = nsSSLIOLayerNewSocket(family,
36
0
                                      host,
37
0
                                      port,
38
0
                                      proxy,
39
0
                                      originAttributes,
40
0
                                      _result,
41
0
                                      securityInfo,
42
0
                                      true,
43
0
                                      flags,
44
0
                                      tlsFlags);
45
0
46
0
  return (NS_FAILED(rv)) ? NS_ERROR_SOCKET_CREATE_FAILED : NS_OK;
47
0
}
48
49
// Add the SSL IO layer to an existing socket
50
NS_IMETHODIMP
51
nsTLSSocketProvider::AddToSocket(int32_t family,
52
                                 const char *host,
53
                                 int32_t port,
54
                                 nsIProxyInfo *proxy,
55
                                 const OriginAttributes &originAttributes,
56
                                 uint32_t flags,
57
                                 uint32_t tlsFlags,
58
                                 PRFileDesc *aSocket,
59
                                 nsISupports **securityInfo)
60
0
{
61
0
  nsresult rv = nsSSLIOLayerAddToSocket(family,
62
0
                                        host,
63
0
                                        port,
64
0
                                        proxy,
65
0
                                        originAttributes,
66
0
                                        aSocket,
67
0
                                        securityInfo,
68
0
                                        true,
69
0
                                        flags,
70
0
                                        tlsFlags);
71
0
72
0
  return (NS_FAILED(rv)) ? NS_ERROR_SOCKET_CREATE_FAILED : NS_OK;
73
0
}