~ubuntu-branches/ubuntu/karmic/erlang/karmic-security

« back to all changes in this revision

Viewing changes to lib/ssl/src/ssl_manager.erl

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-05-01 10:14:38 UTC
  • mfrom: (3.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090501101438-6qlr6rsdxgyzrg2z
Tags: 1:13.b-dfsg-2
* Cleaned up patches: removed unneeded patch which helped to support
  different SCTP library versions, made sure that changes for m68k
  architecture applied only when building on this architecture.
* Removed duplicated information from binary packages descriptions.
* Don't require libsctp-dev build-dependency on solaris-i386 architecture
  which allows to build Erlang on Nexenta (thanks to Tim Spriggs for
  the suggestion).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
%%<copyright>
2
 
%% <year>2007-2008</year>
3
 
%% <holder>Ericsson AB, All Rights Reserved</holder>
4
 
%%</copyright>
5
 
%%<legalnotice>
 
1
%%
 
2
%% %CopyrightBegin%
 
3
%% 
 
4
%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
 
5
%% 
6
6
%% The contents of this file are subject to the Erlang Public License,
7
7
%% Version 1.1, (the "License"); you may not use this file except in
8
8
%% compliance with the License. You should have received a copy of the
9
9
%% Erlang Public License along with this software. If not, it can be
10
10
%% retrieved online at http://www.erlang.org/.
11
 
%%
 
11
%% 
12
12
%% Software distributed under the License is distributed on an "AS IS"
13
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
14
%% the License for the specific language governing rights and limitations
15
15
%% under the License.
 
16
%% 
 
17
%% %CopyrightEnd%
16
18
%%
17
 
%% The Initial Developer of the Original Code is Ericsson AB.
18
 
%%</legalnotice>
 
19
 
19
20
%%----------------------------------------------------------------------
20
21
%% Purpose: Manages ssl sessions and trusted certifacates
21
22
%%----------------------------------------------------------------------
158
159
%%                                      {stop, Reason, State}
159
160
%% Description: Handling call messages
160
161
%%--------------------------------------------------------------------
161
 
handle_call({{connection_init, TrustedcertsFile, Role}, Pid}, _From, 
162
 
            State = #state{certificate_db = Db,
163
 
                           session_cache = Cache}) ->
 
162
handle_call({{connection_init, "", _Role}, Pid}, _From, 
 
163
            #state{session_cache = Cache} = State) ->
 
164
    erlang:monitor(process, Pid),
 
165
    Result = {ok, make_ref(), Cache},
 
166
    {reply, Result, State};
 
167
 
 
168
handle_call({{connection_init, TrustedcertsFile, _Role}, Pid}, _From, 
 
169
            #state{certificate_db = Db,
 
170
                   session_cache = Cache} = State) ->
164
171
    erlang:monitor(process, Pid),
165
172
    Result = 
166
173
        case (catch ssl_certificate_db:add_trusted_certs(Pid, 
168
175
                                                         Db)) of
169
176
            {ok, Ref} ->
170
177
                {ok, Ref, Cache};
171
 
            _ when Role == client ->
172
 
                %% Client does not have to have any trusted certs
173
 
                %% depending on configuration a connection may
174
 
                %% be allowed anyway.
175
 
                {ok, make_ref(), Cache};
176
178
            Error ->
177
179
                {error, Error}
178
180
        end,