ReactOS 0.4.15-dev-7928-g68a8619
asn.c File Reference
#include "precomp.h"
Include dependency graph for asn.c:

Go to the source code of this file.

Functions

RD_BOOL ber_parse_header (STREAM s, int tagval, int *length)
 
void ber_out_header (STREAM s, int tagval, int length)
 
void ber_out_integer (STREAM s, int value)
 
RD_BOOL ber_in_header (STREAM s, int *tagval, int *decoded_len)
 

Function Documentation

◆ ber_in_header()

RD_BOOL ber_in_header ( STREAM  s,
int tagval,
int decoded_len 
)

Definition at line 90 of file asn.c.

91{
92 in_uint8(s, *tagval);
93 in_uint8(s, *decoded_len);
94
95 if (*decoded_len < 0x80)
96 return True;
97 else if (*decoded_len == 0x81)
98 {
99 in_uint8(s, *decoded_len);
100 return True;
101 }
102 else if (*decoded_len == 0x82)
103 {
104 in_uint16_be(s, *decoded_len);
105 return True;
106 }
107
108 return False;
109}
#define in_uint8(s, v)
Definition: parse.h:88
#define in_uint16_be(s, v)
Definition: parse.h:75
#define False
Definition: types.h:25
#define True
Definition: types.h:24
GLdouble s
Definition: gl.h:2039

◆ ber_out_header()

void ber_out_header ( STREAM  s,
int  tagval,
int  length 
)

Definition at line 61 of file asn.c.

62{
63 if (tagval > 0xff)
64 {
65 out_uint16_be(s, tagval);
66 }
67 else
68 {
69 out_uint8(s, tagval);
70 }
71
72 if (length >= 0x80)
73 {
74 out_uint8(s, 0x82);
76 }
77 else
79}
#define out_uint8(s, v)
Definition: parse.h:92
#define out_uint16_be(s, v)
Definition: parse.h:77
GLuint GLsizei GLsizei * length
Definition: glext.h:6040

Referenced by ber_out_integer(), mcs_out_domain_params(), and mcs_send_connect_initial().

◆ ber_out_integer()

void ber_out_integer ( STREAM  s,
int  value 
)

Definition at line 83 of file asn.c.

84{
87}
void ber_out_header(STREAM s, int tagval, int length)
Definition: asn.c:61
#define BER_TAG_INTEGER
Definition: constants.h:78
Definition: pdh_main.c:94

Referenced by mcs_out_domain_params().

◆ ber_parse_header()

RD_BOOL ber_parse_header ( STREAM  s,
int  tagval,
int length 
)

Definition at line 25 of file asn.c.

26{
27 int tag, len;
28
29 if (tagval > 0xff)
30 {
32 }
33 else
34 {
35 in_uint8(s, tag);
36 }
37
38 if (tag != tagval)
39 {
40 error("expected tag %d, got %d\n", tagval, tag);
41 return False;
42 }
43
44 in_uint8(s, len);
45
46 if (len & 0x80)
47 {
48 len &= ~0x80;
49 *length = 0;
50 while (len--)
51 next_be(s, *length);
52 }
53 else
54 *length = len;
55
56 return s_check(s);
57}
#define s_check(s)
Definition: parse.h:42
#define next_be(s, v)
Definition: parse.h:97
GLenum GLsizei len
Definition: glext.h:6722
#define error(str)
Definition: mkdosfs.c:1605
Definition: ecma_167.h:138

Referenced by mcs_parse_domain_params(), and mcs_recv_connect_response().