1
/* -*- c-basic-offset: 8 -*-
2
FreeRDP: A Remote Desktop Protocol client.
3
ASN.1 Encoding and Decoding
5
Copyright (C) Marc-Andre Moreau <marcandre.moreau@gmail.com> 2009
7
This program is free software; you can redistribute it and/or modify
8
it under the terms of the GNU General Public License as published by
9
the Free Software Foundation; either version 2 of the License, or
10
(at your option) any later version.
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
17
You should have received a copy of the GNU General Public License
18
along with this program; if not, write to the Free Software
19
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
34
/* Parse an ASN.1 BER header */
36
ber_parse_header(rdpMcs * mcs, STREAM s, int tagval, int *length)
51
ui_error(mcs->sec->rdp->inst, "expected tag %d, got %d\n", tagval, tag);
70
/* Output an ASN.1 BER header */
72
ber_out_header(STREAM s, int tagval, int length)
76
out_uint16_be(s, tagval);
86
out_uint16_be(s, length);
92
/* Output an ASN.1 BER integer */
94
ber_out_integer(STREAM s, int value)
96
ber_out_header(s, BER_TAG_INTEGER, 2);
97
out_uint16_be(s, value);
100
#endif /* __ASN1_H */