summaryrefslogtreecommitdiffstats
path: root/net/socket/nss_ssl_util.h
blob: 2a53fc75d30ab38866aa39c1b9fe3cd2d8dec933 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This file is only inclued in ssl_client_socket_nss.cc and
// ssl_server_socket_nss.cc to share common functions of NSS.

#ifndef NET_SOCKET_NSS_SSL_UTIL_H_
#define NET_SOCKET_NSS_SSL_UTIL_H_

#include <prerror.h>

namespace net {

class BoundNetLog;

// Initalize NSS SSL library.
void EnsureNSSSSLInit();

// Log a failed NSS funcion call.
void LogFailedNSSFunction(const BoundNetLog& net_log,
                          const char* function,
                          const char* param);

// Map network error code to NSS error code.
PRErrorCode MapErrorToNSS(int result);

// Map NSS error code to network error code.
int MapNSSError(PRErrorCode err);

// Map NSS error code from the first SSL handshake to network error code.
int MapNSSHandshakeError(PRErrorCode err);

}  // namespace net

#endif  // NET_SOCKET_NSS_SSL_UTIL_H_