OLD | NEW |
1 /* This Source Code Form is subject to the terms of the Mozilla Public | 1 /* This Source Code Form is subject to the terms of the Mozilla Public |
2 * License, v. 2.0. If a copy of the MPL was not distributed with this | 2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 | 4 |
5 /* | 5 /* |
6 * Utility routines to complement the ASN.1 encoding and decoding functions. | 6 * Utility routines to complement the ASN.1 encoding and decoding functions. |
7 * | |
8 * $Id$ | |
9 */ | 7 */ |
10 | 8 |
11 #include "secasn1.h" | 9 #include "secasn1.h" |
12 | 10 |
13 | 11 |
14 /* | 12 /* |
15 * We have a length that needs to be encoded; how many bytes will the | 13 * We have a length that needs to be encoded; how many bytes will the |
16 * encoding take? | 14 * encoding take? |
17 * | 15 * |
18 * The rules are that 0 - 0x7f takes one byte (the length itself is the | 16 * The rules are that 0 - 0x7f takes one byte (the length itself is the |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 return PR_FALSE; /* no choice means not simple */ | 88 return PR_FALSE; /* no choice means not simple */ |
91 } | 89 } |
92 while (++theTemplate && theTemplate->kind) { | 90 while (++theTemplate && theTemplate->kind) { |
93 if (theTemplate->kind & (~SEC_ASN1_TAGNUM_MASK)) { | 91 if (theTemplate->kind & (~SEC_ASN1_TAGNUM_MASK)) { |
94 return PR_FALSE; /* complex type */ | 92 return PR_FALSE; /* complex type */ |
95 } | 93 } |
96 } | 94 } |
97 return PR_TRUE; /* choice of primitive types */ | 95 return PR_TRUE; /* choice of primitive types */ |
98 } | 96 } |
99 | 97 |
OLD | NEW |