1// Copyright (c) 2010 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// This file is only inclued in ssl_client_socket_nss.cc and
6// ssl_server_socket_nss.cc to share common functions of NSS.
7
8#ifndef NET_SOCKET_NSS_SSL_UTIL_H_
9#define NET_SOCKET_NSS_SSL_UTIL_H_
10
11#include <prerror.h>
12
13namespace net {
14
15class BoundNetLog;
16
17// Initalize NSS SSL library.
18void EnsureNSSSSLInit();
19
20// Log a failed NSS funcion call.
21void LogFailedNSSFunction(const BoundNetLog& net_log,
22                          const char* function,
23                          const char* param);
24
25// Map network error code to NSS error code.
26PRErrorCode MapErrorToNSS(int result);
27
28// Map NSS error code to network error code.
29int MapNSSError(PRErrorCode err);
30
31// Map NSS error code from the first SSL handshake to network error code.
32int MapNSSHandshakeError(PRErrorCode err);
33
34}  // namespace net
35
36#endif  // NET_SOCKET_NSS_SSL_UTIL_H_
37