~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/asn1/src/asn1ct_constructed_ber.erl

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
%%
2
2
%% %CopyrightBegin%
3
 
%% 
4
 
%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
5
 
%% 
 
3
%%
 
4
%% Copyright Ericsson AB 1997-2010. 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
 
%% 
 
16
%%
17
17
%% %CopyrightEnd%
18
18
%%
19
19
%%
71
71
            ok
72
72
    end,
73
73
 
74
 
    {SeqOrSet,TableConsInfo,CompList} = 
 
74
    {SeqOrSet,TableConsInfo,CompList0} =
75
75
        case D#type.def of
76
76
            #'SEQUENCE'{tablecinf=TCI,components=CL} -> 
77
77
                {'SEQUENCE',TCI,CL};
78
78
            #'SET'{tablecinf=TCI,components=CL} -> 
79
79
                {'SET',TCI,CL}
80
80
        end,
 
81
    %% filter away extensionAdditiongroup markers
 
82
    CompList = filter_complist(CompList0),
81
83
    Ext = extensible(CompList),
82
84
    CompList1 = case CompList of
83
85
                    {Rl1,El,Rl2} -> Rl1 ++ El ++ Rl2;
189
191
gen_decode_sequence(Erules,Typename,D) when is_record(D,type) ->
190
192
    asn1ct_name:start(),
191
193
    asn1ct_name:new(tag),
192
 
    #'SEQUENCE'{tablecinf=TableConsInfo,components=CList} = D#type.def,
 
194
    #'SEQUENCE'{tablecinf=TableConsInfo,components=CList0} = D#type.def,
 
195
 
 
196
    %% filter away extensionAdditiongroup markers
 
197
    CList = filter_complist(CList0),
 
198
 
193
199
    Ext = extensible(CList),
194
200
    {CompList,CompList2} = case CList of
195
201
                   {Rl1,El,Rl2} -> {Rl1 ++ El ++ Rl2,CList};
369
375
    asn1ct_name:clear(),
370
376
    asn1ct_name:new(term),
371
377
    asn1ct_name:new(tag),
372
 
    #'SET'{components=TCompList} = D#type.def,
 
378
    #'SET'{components=TCompList0} = D#type.def,
 
379
 
 
380
    %% filter away extensionAdditiongroup markers
 
381
    TCompList = filter_complist(TCompList0),
373
382
    Ext = extensible(TCompList),
374
383
    ToOptional = fun(mandatory) ->
375
384
                         'OPTIONAL';
1473
1482
    {ext,length(RootList)+1,length(ExtList)};
1474
1483
extensible({_Rl1,_ExtL,_Rl2}) ->
1475
1484
    extensible.
 
1485
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
1486
%% filter away ExtensionAdditionGroup start and end marks since these
 
1487
%% have no significance for the BER encoding
 
1488
%%
 
1489
filter_complist(CompList) when is_list(CompList) ->
 
1490
    lists:filter(fun(#'ExtensionAdditionGroup'{}) ->
 
1491
                         false;
 
1492
                    ('ExtensionAdditionGroupEnd') ->
 
1493
                         false;
 
1494
                    (_) ->
 
1495
                         true
 
1496
                 end, CompList);
 
1497
filter_complist({Root,Ext}) ->
 
1498
    {Root,filter_complist(Ext)};
 
1499
filter_complist({Root1,Ext,Root2}) ->
 
1500
    {Root1,filter_complist(Ext),Root2}.
1476
1501
 
1477
1502
print_attribute_comment(InnerType,Pos,Prop) ->
1478
1503
    CommentLine = "%%-------------------------------------------------",