mirror of
				https://github.com/jart/cosmopolitan.git
				synced 2025-10-26 19:16:41 +00:00 
			
		
		
		
	Make it possible to compile redbean with chibicc
This cuts build latency down from 5 seconds to 500 milliseconds.
This commit is contained in:
		
							parent
							
								
									552525cbdd
								
							
						
					
					
						commit
						6ff46ca373
					
				
					 50 changed files with 898 additions and 824 deletions
				
			
		
							
								
								
									
										40
									
								
								third_party/chibicc/as.c
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										40
									
								
								third_party/chibicc/as.c
									
										
									
									
										vendored
									
									
								
							|  | @ -1752,6 +1752,14 @@ static void OnSize(struct As *a, struct Slice s) { | |||
|   a->symbols.p[i].size = GetInt(a); | ||||
| } | ||||
| 
 | ||||
| static void OnEqu(struct As *a, struct Slice s) { | ||||
|   int i, j; | ||||
|   i = GetSymbol(a, a->things.p[a->i++].i); | ||||
|   ConsumeComma(a); | ||||
|   a->symbols.p[i].offset = GetInt(a); | ||||
|   a->symbols.p[i].section = SHN_ABS; | ||||
| } | ||||
| 
 | ||||
| static void OnComm(struct As *a, struct Slice s) { | ||||
|   int i; | ||||
|   i = GetSymbol(a, a->things.p[a->i++].i); | ||||
|  | @ -2132,12 +2140,24 @@ static void EmitRexOpModrm(struct As *a, long op, int reg, int modrm, int disp, | |||
|   EmitOpModrm(a, op, reg, modrm, disp, skew); | ||||
| } | ||||
| 
 | ||||
| static void OnLea(struct As *a, struct Slice s) { | ||||
| static void OnLoad(struct As *a, struct Slice s, int op) { | ||||
|   int modrm, reg, disp; | ||||
|   modrm = ParseModrm(a, &disp); | ||||
|   ConsumeComma(a); | ||||
|   reg = GetRegisterReg(a); | ||||
|   EmitRexOpModrm(a, 0x8D, reg, modrm, disp, 0); | ||||
|   EmitRexOpModrm(a, op, reg, modrm, disp, 0); | ||||
| } | ||||
| 
 | ||||
| static void OnLea(struct As *a, struct Slice s) { | ||||
|   return OnLoad(a, s, 0x8D); | ||||
| } | ||||
| 
 | ||||
| static void OnLar(struct As *a, struct Slice s) { | ||||
|   return OnLoad(a, s, 0x0f02); | ||||
| } | ||||
| 
 | ||||
| static void OnLsl(struct As *a, struct Slice s) { | ||||
|   return OnLoad(a, s, 0x0f03); | ||||
| } | ||||
| 
 | ||||
| static void OnMov(struct As *a, struct Slice s) { | ||||
|  | @ -2593,6 +2613,12 @@ static void OnPush(struct As *a, struct Slice s) { | |||
|   } | ||||
| } | ||||
| 
 | ||||
| static void OnRdpid(struct As *a, struct Slice s) { | ||||
|   int modrm, disp; | ||||
|   EmitVarword(a, 0xf30fc7); | ||||
|   EmitByte(a, 0370 | GetRegisterReg(a)); | ||||
| } | ||||
| 
 | ||||
| static void OnPop(struct As *a, struct Slice s) { | ||||
|   int modrm, disp; | ||||
|   modrm = RemoveRexw(ParseModrm(a, &disp)); | ||||
|  | @ -2901,6 +2927,7 @@ static void OnMinsd(struct As *a, struct Slice s) { OpSse(a, 0xF20F5D); } | |||
| static void OnMinss(struct As *a, struct Slice s) { OpSse(a, 0xF30F5D); } | ||||
| static void OnMovmskpd(struct As *a, struct Slice s) { OpSse(a, 0x660F50); } | ||||
| static void OnMovmskps(struct As *a, struct Slice s) { OpSse(a, 0x0F50); } | ||||
| static void OnMovntdq(struct As *a, struct Slice s) { OpMovntdq(a); } | ||||
| static void OnMovsb(struct As *a, struct Slice s) { EmitByte(a, 0xA4); } | ||||
| static void OnMovsl(struct As *a, struct Slice s) { EmitByte(a, 0xA5); } | ||||
| static void OnMovsq(struct As *a, struct Slice s) { EmitVarword(a, 0x48A5); } | ||||
|  | @ -3013,12 +3040,13 @@ static void OnPunpcklbw(struct As *a, struct Slice s) { OpSse(a, 0x660F60); } | |||
| static void OnPunpckldq(struct As *a, struct Slice s) { OpSse(a, 0x660F62); } | ||||
| static void OnPunpcklqdq(struct As *a, struct Slice s) { OpSse(a, 0x660F6C); } | ||||
| static void OnPunpcklwd(struct As *a, struct Slice s) { OpSse(a, 0x660F61); } | ||||
| static void OnMovntdq(struct As *a, struct Slice s) { OpMovntdq(a); } | ||||
| static void OnPxor(struct As *a, struct Slice s) { OpSse(a, 0x660FEF); } | ||||
| static void OnRcl(struct As *a, struct Slice s) { OpBsu(a, s, 2); } | ||||
| static void OnRcpps(struct As *a, struct Slice s) { OpSse(a, 0x0F53); } | ||||
| static void OnRcpss(struct As *a, struct Slice s) { OpSse(a, 0xF30F53); } | ||||
| static void OnRcr(struct As *a, struct Slice s) { OpBsu(a, s, 3); } | ||||
| static void OnRdtsc(struct As *a, struct Slice s) { EmitVarword(a, 0x0f31); } | ||||
| static void OnRdtscp(struct As *a, struct Slice s) { EmitVarword(a, 0x0f01f9); } | ||||
| static void OnRol(struct As *a, struct Slice s) { OpBsu(a, s, 0); } | ||||
| static void OnRor(struct As *a, struct Slice s) { OpBsu(a, s, 1); } | ||||
| static void OnRoundsd(struct As *a, struct Slice s) { OpSseIb(a, 0x660F3A0B); } | ||||
|  | @ -3088,6 +3116,7 @@ static const struct Directive8 { | |||
|     {".comm", OnComm},         //
 | ||||
|     {".data", OnData},         //
 | ||||
|     {".double", OnDouble},     //
 | ||||
|     {".equ", OnEqu},           //
 | ||||
|     {".err", OnErr},           //
 | ||||
|     {".error", OnError},       //
 | ||||
|     {".file", OnFile},         //
 | ||||
|  | @ -3329,12 +3358,14 @@ static const struct Directive8 { | |||
|     {"jpo", OnJnp},            //
 | ||||
|     {"js", OnJs},              //
 | ||||
|     {"jz", OnJz},              //
 | ||||
|     {"lar", OnLar},            //
 | ||||
|     {"lea", OnLea},            //
 | ||||
|     {"leave", OnLeave},        //
 | ||||
|     {"lodsb", OnLodsb},        //
 | ||||
|     {"lodsl", OnLodsl},        //
 | ||||
|     {"lodsq", OnLodsq},        //
 | ||||
|     {"lodsw", OnLodsw},        //
 | ||||
|     {"lsl", OnLsl},            //
 | ||||
|     {"maxpd", OnMaxpd},        //
 | ||||
|     {"maxps", OnMaxps},        //
 | ||||
|     {"maxsd", OnMaxsd},        //
 | ||||
|  | @ -3507,6 +3538,9 @@ static const struct Directive8 { | |||
|     {"rcrl", OnRcr},           //
 | ||||
|     {"rcrq", OnRcr},           //
 | ||||
|     {"rcrw", OnRcr},           //
 | ||||
|     {"rdpid", OnRdpid},        //
 | ||||
|     {"rdtsc", OnRdtsc},        //
 | ||||
|     {"rdtscp", OnRdtscp},      //
 | ||||
|     {"ret", OnRet},            //
 | ||||
|     {"rol", OnRol},            //
 | ||||
|     {"rolb", OnRol},           //
 | ||||
|  |  | |||
							
								
								
									
										12
									
								
								third_party/chibicc/cast.c
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								third_party/chibicc/cast.c
									
										
									
									
										vendored
									
									
								
							|  | @ -39,12 +39,12 @@ | |||
|   "\taddsd\t%xmm0,%xmm0\n"  \ | ||||
|   "2:" | ||||
| 
 | ||||
| #define u64f80                             \ | ||||
|   PUSHPOPRAX("fildq\t(%rsp)\n"             \ | ||||
|              "\ttest\t%rax,%rax\n"         \ | ||||
|              "\tjns\t1f\n"                 \ | ||||
|              "\tmov\t$0x5f800000,(%rsp)\n" \ | ||||
|              "\tfadds\t(%rsp)\n"           \ | ||||
| #define u64f80                              \ | ||||
|   PUSHPOPRAX("fildq\t(%rsp)\n"              \ | ||||
|              "\ttest\t%rax,%rax\n"          \ | ||||
|              "\tjns\t1f\n"                  \ | ||||
|              "\tmovq\t$0x5f800000,(%rsp)\n" \ | ||||
|              "\tfadds\t(%rsp)\n"            \ | ||||
|              "1:") | ||||
| 
 | ||||
| #define i32i8   "movsbl\t%al,%eax" | ||||
|  |  | |||
							
								
								
									
										2
									
								
								third_party/chibicc/chibicc.mk
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								third_party/chibicc/chibicc.mk
									
										
									
									
										vendored
									
									
								
							|  | @ -134,6 +134,8 @@ o/$(MODE)/third_party/chibicc/chibicc.o:				\ | |||
| o/$(MODE)/third_party/chibicc/chibicc.chibicc.o:			\ | ||||
| 		CHIBICC_FLAGS += $(THIRD_PARTY_CHIBICC_DEFINES) | ||||
| 
 | ||||
| o/$(MODE)/%.chibicc.o: %.s o/$(MODE)/third_party/chibicc/chibicc.com.dbg | ||||
| 	@$(COMPILE) -ACHIBICC -T$@ $(CHIBICC) $(CHIBICC_FLAGS) -c -o $@ $< | ||||
| o/$(MODE)/%.chibicc.o: %.c o/$(MODE)/third_party/chibicc/chibicc.com.dbg | ||||
| 	@$(COMPILE) -ACHIBICC -T$@ $(CHIBICC) $(CHIBICC_FLAGS) -c -o $@ $< | ||||
| o/$(MODE)/%.chibicc2.o: %.c o/$(MODE)/third_party/chibicc/chibicc2.com.dbg | ||||
|  |  | |||
							
								
								
									
										4
									
								
								third_party/chibicc/codegen.c
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								third_party/chibicc/codegen.c
									
										
									
									
										vendored
									
									
								
							|  | @ -192,9 +192,9 @@ void print_loc(int64_t file, int64_t line) { | |||
|   if (file != lastfile || line != lastline) { | ||||
|     locbuf = malloc(2 + 4 + 1 + 20 + 1 + 20 + 1); | ||||
|     p = stpcpy(locbuf, "\t.loc\t"); | ||||
|     p += int64toarray_radix10(file, p); | ||||
|     p = FormatInt64(p, file); | ||||
|     *p++ = ' '; | ||||
|     int64toarray_radix10(line, p); | ||||
|     FormatInt64(p, line); | ||||
|     emitlin(locbuf); | ||||
|     free(locbuf); | ||||
|     lastfile = file; | ||||
|  |  | |||
							
								
								
									
										35
									
								
								third_party/chibicc/parse.c
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										35
									
								
								third_party/chibicc/parse.c
									
										
									
									
										vendored
									
									
								
							|  | @ -19,6 +19,7 @@ | |||
| #include "libc/dce.h" | ||||
| #include "libc/intrin/asan.internal.h" | ||||
| #include "libc/log/libfatal.internal.h" | ||||
| #include "libc/log/log.h" | ||||
| #include "libc/mem/mem.h" | ||||
| #include "libc/nexgen32e/ffs.h" | ||||
| #include "libc/testlib/testlib.h" | ||||
|  | @ -352,7 +353,10 @@ static Obj *new_string_literal(char *p, Type *ty) { | |||
| } | ||||
| 
 | ||||
| static char *get_ident(Token *tok) { | ||||
|   if (tok->kind != TK_IDENT) error_tok(tok, "expected an identifier"); | ||||
|   if (tok->kind != TK_IDENT) { | ||||
|     __die(); | ||||
|     error_tok(tok, "expected an identifier"); | ||||
|   } | ||||
|   return strndup(tok->loc, tok->len); | ||||
| } | ||||
| 
 | ||||
|  | @ -1088,6 +1092,10 @@ static Type *enum_specifier(Token **rest, Token *tok) { | |||
|   int val = 0; | ||||
|   while (!consume_end(rest, tok)) { | ||||
|     if (i++ > 0) tok = skip(tok, ','); | ||||
|     if (tok->kind == TK_JAVADOWN) { | ||||
|       current_javadown = tok; | ||||
|       tok = tok->next; | ||||
|     } | ||||
|     char *name = get_ident(tok); | ||||
|     tok = tok->next; | ||||
|     if (EQUAL(tok, "=")) val = const_expr(&tok, tok->next); | ||||
|  | @ -1282,6 +1290,10 @@ static void array_designator(Token **rest, Token *tok, Type *ty, int *begin, | |||
| static Member *struct_designator(Token **rest, Token *tok, Type *ty) { | ||||
|   Token *start = tok; | ||||
|   tok = skip(tok, '.'); | ||||
|   if (tok->kind == TK_JAVADOWN) { | ||||
|     current_javadown = tok; | ||||
|     tok = tok->next; | ||||
|   } | ||||
|   if (tok->kind != TK_IDENT) error_tok(tok, "expected a field designator"); | ||||
|   for (Member *mem = ty->members; mem; mem = mem->next) { | ||||
|     // Anonymous struct member
 | ||||
|  | @ -2775,6 +2787,10 @@ static void struct_members(Token **rest, Token *tok, Type *ty) { | |||
|     // Regular struct members
 | ||||
|     while (!CONSUME(&tok, tok, ";")) { | ||||
|       if (!first) tok = skip(tok, ','); | ||||
|       if (tok->kind == TK_JAVADOWN) { | ||||
|         current_javadown = tok; | ||||
|         tok = tok->next; | ||||
|       } | ||||
|       first = false; | ||||
|       Member *mem = calloc(1, sizeof(Member)); | ||||
|       mem->ty = declarator(&tok, tok, basety); | ||||
|  | @ -2833,6 +2849,10 @@ static Type *struct_union_decl(Token **rest, Token *tok) { | |||
|   ty->name = tag; | ||||
|   tok = skip(tok, '{'); | ||||
|   // Construct a struct object.
 | ||||
|   if (tok->kind == TK_JAVADOWN) { | ||||
|     current_javadown = tok; | ||||
|     tok = tok->next; | ||||
|   } | ||||
|   struct_members(&tok, tok, ty); | ||||
|   *rest = attribute_list(tok, ty, type_attributes); | ||||
|   if (tag) { | ||||
|  | @ -3510,7 +3530,9 @@ static Node *primary(Token **rest, Token *tok) { | |||
| static Token *parse_typedef(Token *tok, Type *basety) { | ||||
|   bool first = true; | ||||
|   while (!CONSUME(&tok, tok, ";")) { | ||||
|     if (!first) tok = skip(tok, ','); | ||||
|     if (!first) { | ||||
|       tok = skip(tok, ','); | ||||
|     } | ||||
|     first = false; | ||||
|     Type *ty = declarator(&tok, tok, basety); | ||||
|     if (!ty->name) error_tok(ty->name_pos, "typedef name omitted"); | ||||
|  | @ -3648,11 +3670,18 @@ static Token *function(Token *tok, Type *basety, VarAttr *attr) { | |||
| 
 | ||||
| static Token *global_variable(Token *tok, Type *basety, VarAttr *attr) { | ||||
|   bool first = true; | ||||
|   bool isjavadown = tok->kind == TK_JAVADOWN; | ||||
|   while (!CONSUME(&tok, tok, ";")) { | ||||
|     if (!first) tok = skip(tok, ','); | ||||
|     first = false; | ||||
|     Type *ty = declarator(&tok, tok, basety); | ||||
|     if (!ty->name) error_tok(ty->name_pos, "variable name omitted"); | ||||
|     if (!ty->name) { | ||||
|       if (isjavadown) { | ||||
|         return tok; | ||||
|       } else { | ||||
|         error_tok(ty->name_pos, "variable name omitted"); | ||||
|       } | ||||
|     } | ||||
|     Obj *var = new_gvar(get_ident(ty->name), ty); | ||||
|     if (!var->tok) var->tok = ty->name; | ||||
|     var->javadown = current_javadown; | ||||
|  |  | |||
							
								
								
									
										11
									
								
								third_party/chibicc/preprocess.c
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								third_party/chibicc/preprocess.c
									
										
									
									
										vendored
									
									
								
							|  | @ -284,7 +284,9 @@ static long eval_const_expr(Token **rest, Token *tok) { | |||
|   convert_pp_tokens(expr); | ||||
|   Token *rest2; | ||||
|   long val = const_expr(&rest2, expr); | ||||
|   if (rest2->kind != TK_EOF) error_tok(rest2, "extra token"); | ||||
|   if (rest2->kind != TK_EOF && rest2->kind != TK_JAVADOWN) { | ||||
|     error_tok(rest2, "extra token"); | ||||
|   } | ||||
|   __arena_pop(); | ||||
|   return val; | ||||
| } | ||||
|  | @ -324,7 +326,12 @@ static MacroParam *read_macro_params(Token **rest, Token *tok, | |||
|       *rest = skip(tok->next, ')'); | ||||
|       return head.next; | ||||
|     } | ||||
|     if (tok->kind != TK_IDENT) error_tok(tok, "expected an identifier"); | ||||
|     if (tok->kind == TK_JAVADOWN) { | ||||
|       tok = tok->next; | ||||
|     } | ||||
|     if (tok->kind != TK_IDENT) { | ||||
|       error_tok(tok, "expected an identifier"); | ||||
|     } | ||||
|     if (EQUAL(tok->next, "...")) { | ||||
|       *va_args_name = strndup(tok->loc, tok->len); | ||||
|       *rest = skip(tok->next->next, ')'); | ||||
|  |  | |||
							
								
								
									
										4
									
								
								third_party/chibicc/tokenize.c
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								third_party/chibicc/tokenize.c
									
										
									
									
										vendored
									
									
								
							|  | @ -97,10 +97,12 @@ bool consume(Token **rest, Token *tok, char *str, size_t n) { | |||
| 
 | ||||
| // Ensure that the current token is `op`.
 | ||||
| Token *skip(Token *tok, char op) { | ||||
|   while (tok->kind == TK_JAVADOWN) { | ||||
|     tok = tok->next; | ||||
|   } | ||||
|   if (tok->len == 1 && *tok->loc == op) { | ||||
|     return tok->next; | ||||
|   } else { | ||||
|     // __die();
 | ||||
|     error_tok(tok, "expected '%c'", op); | ||||
|   } | ||||
| } | ||||
|  |  | |||
							
								
								
									
										14
									
								
								third_party/mbedtls/aes.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								third_party/mbedtls/aes.h
									
										
									
									
										vendored
									
									
								
							|  | @ -5,21 +5,21 @@ COSMOPOLITAN_C_START_ | |||
| /* clang-format off */ | ||||
| 
 | ||||
| /* padlock.c and aesni.c rely on these values! */ | ||||
| #define MBEDTLS_AES_ENCRYPT     1 /**< AES encryption. */ | ||||
| #define MBEDTLS_AES_DECRYPT     0 /**< AES decryption. */ | ||||
| #define MBEDTLS_AES_ENCRYPT     1 /*< AES encryption. */ | ||||
| #define MBEDTLS_AES_DECRYPT     0 /*< AES decryption. */ | ||||
| 
 | ||||
| /* Error codes in range 0x0020-0x0022 */ | ||||
| #define MBEDTLS_ERR_AES_INVALID_KEY_LENGTH                -0x0020  /**< Invalid key length. */ | ||||
| #define MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH              -0x0022  /**< Invalid data input length. */ | ||||
| #define MBEDTLS_ERR_AES_INVALID_KEY_LENGTH                -0x0020  /*< Invalid key length. */ | ||||
| #define MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH              -0x0022  /*< Invalid data input length. */ | ||||
| 
 | ||||
| /* Error codes in range 0x0021-0x0025 */ | ||||
| #define MBEDTLS_ERR_AES_BAD_INPUT_DATA                    -0x0021  /**< Invalid input data. */ | ||||
| #define MBEDTLS_ERR_AES_BAD_INPUT_DATA                    -0x0021  /*< Invalid input data. */ | ||||
| 
 | ||||
| /* MBEDTLS_ERR_AES_FEATURE_UNAVAILABLE is deprecated and should not be used. */ | ||||
| #define MBEDTLS_ERR_AES_FEATURE_UNAVAILABLE               -0x0023  /**< Feature not available. For example, an unsupported AES key size. */ | ||||
| #define MBEDTLS_ERR_AES_FEATURE_UNAVAILABLE               -0x0023  /*< Feature not available. For example, an unsupported AES key size. */ | ||||
| 
 | ||||
| /* MBEDTLS_ERR_AES_HW_ACCEL_FAILED is deprecated and should not be used. */ | ||||
| #define MBEDTLS_ERR_AES_HW_ACCEL_FAILED                   -0x0025  /**< AES hardware accelerator failed. */ | ||||
| #define MBEDTLS_ERR_AES_HW_ACCEL_FAILED                   -0x0025  /*< AES hardware accelerator failed. */ | ||||
| 
 | ||||
| /**
 | ||||
|  * \brief The AES context-type definition. | ||||
|  |  | |||
							
								
								
									
										38
									
								
								third_party/mbedtls/asn1.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										38
									
								
								third_party/mbedtls/asn1.h
									
										
									
									
										vendored
									
									
								
							|  | @ -16,13 +16,13 @@ | |||
|  * ASN1 is a standard to specify data structures. | ||||
|  * \{ | ||||
|  */ | ||||
| #define MBEDTLS_ERR_ASN1_OUT_OF_DATA                      -0x0060  /**< Out of data when parsing an ASN1 data structure. */ | ||||
| #define MBEDTLS_ERR_ASN1_UNEXPECTED_TAG                   -0x0062  /**< ASN1 tag was of an unexpected value. */ | ||||
| #define MBEDTLS_ERR_ASN1_INVALID_LENGTH                   -0x0064  /**< Error when trying to determine the length or invalid length. */ | ||||
| #define MBEDTLS_ERR_ASN1_LENGTH_MISMATCH                  -0x0066  /**< Actual length differs from expected length. */ | ||||
| #define MBEDTLS_ERR_ASN1_INVALID_DATA                     -0x0068  /**< Data is invalid. */ | ||||
| #define MBEDTLS_ERR_ASN1_ALLOC_FAILED                     -0x006A  /**< Memory allocation failed */ | ||||
| #define MBEDTLS_ERR_ASN1_BUF_TOO_SMALL                    -0x006C  /**< Buffer too small when writing ASN.1 data structure. */ | ||||
| #define MBEDTLS_ERR_ASN1_OUT_OF_DATA                      -0x0060  /*< Out of data when parsing an ASN1 data structure. */ | ||||
| #define MBEDTLS_ERR_ASN1_UNEXPECTED_TAG                   -0x0062  /*< ASN1 tag was of an unexpected value. */ | ||||
| #define MBEDTLS_ERR_ASN1_INVALID_LENGTH                   -0x0064  /*< Error when trying to determine the length or invalid length. */ | ||||
| #define MBEDTLS_ERR_ASN1_LENGTH_MISMATCH                  -0x0066  /*< Actual length differs from expected length. */ | ||||
| #define MBEDTLS_ERR_ASN1_INVALID_DATA                     -0x0068  /*< Data is invalid. */ | ||||
| #define MBEDTLS_ERR_ASN1_ALLOC_FAILED                     -0x006A  /*< Memory allocation failed */ | ||||
| #define MBEDTLS_ERR_ASN1_BUF_TOO_SMALL                    -0x006C  /*< Buffer too small when writing ASN.1 data structure. */ | ||||
| 
 | ||||
| /* \} name */ | ||||
| 
 | ||||
|  | @ -118,9 +118,9 @@ extern "C" { | |||
|  */ | ||||
| typedef struct mbedtls_asn1_buf | ||||
| { | ||||
|     int tag;                /**< ASN1 type, e.g. MBEDTLS_ASN1_UTF8_STRING. */ | ||||
|     size_t len;             /**< ASN1 length, in octets. */ | ||||
|     unsigned char *p;       /**< ASN1 data, e.g. in ASCII. */ | ||||
|     int tag;                /*< ASN1 type, e.g. MBEDTLS_ASN1_UTF8_STRING. */ | ||||
|     size_t len;             /*< ASN1 length, in octets. */ | ||||
|     unsigned char *p;       /*< ASN1 data, e.g. in ASCII. */ | ||||
| } | ||||
| mbedtls_asn1_buf; | ||||
| 
 | ||||
|  | @ -129,9 +129,9 @@ mbedtls_asn1_buf; | |||
|  */ | ||||
| typedef struct mbedtls_asn1_bitstring | ||||
| { | ||||
|     size_t len;                 /**< ASN1 length, in octets. */ | ||||
|     unsigned char unused_bits;  /**< Number of unused bits at the end of the string */ | ||||
|     unsigned char *p;           /**< Raw ASN1 data for the bit string */ | ||||
|     size_t len;                 /*< ASN1 length, in octets. */ | ||||
|     unsigned char unused_bits;  /*< Number of unused bits at the end of the string */ | ||||
|     unsigned char *p;           /*< Raw ASN1 data for the bit string */ | ||||
| } | ||||
| mbedtls_asn1_bitstring; | ||||
| 
 | ||||
|  | @ -140,8 +140,8 @@ mbedtls_asn1_bitstring; | |||
|  */ | ||||
| typedef struct mbedtls_asn1_sequence | ||||
| { | ||||
|     mbedtls_asn1_buf buf;                   /**< Buffer containing the given ASN.1 item. */ | ||||
|     struct mbedtls_asn1_sequence *next;    /**< The next entry in the sequence. */ | ||||
|     mbedtls_asn1_buf buf;                   /*< Buffer containing the given ASN.1 item. */ | ||||
|     struct mbedtls_asn1_sequence *next;    /*< The next entry in the sequence. */ | ||||
| } | ||||
| mbedtls_asn1_sequence; | ||||
| 
 | ||||
|  | @ -150,10 +150,10 @@ mbedtls_asn1_sequence; | |||
|  */ | ||||
| typedef struct mbedtls_asn1_named_data | ||||
| { | ||||
|     mbedtls_asn1_buf oid;                   /**< The object identifier. */ | ||||
|     mbedtls_asn1_buf val;                   /**< The named value. */ | ||||
|     struct mbedtls_asn1_named_data *next;  /**< The next entry in the sequence. */ | ||||
|     unsigned char next_merged;      /**< Merge next item into the current one? */ | ||||
|     mbedtls_asn1_buf oid;                   /*< The object identifier. */ | ||||
|     mbedtls_asn1_buf val;                   /*< The named value. */ | ||||
|     struct mbedtls_asn1_named_data *next;  /*< The next entry in the sequence. */ | ||||
|     unsigned char next_merged;      /*< Merge next item into the current one? */ | ||||
| } | ||||
| mbedtls_asn1_named_data; | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										4
									
								
								third_party/mbedtls/base64.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								third_party/mbedtls/base64.h
									
										
									
									
										vendored
									
									
								
							|  | @ -4,8 +4,8 @@ | |||
| COSMOPOLITAN_C_START_ | ||||
| /* clang-format off */ | ||||
| 
 | ||||
| #define MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL   -0x002A  /**< Output buffer too small. */ | ||||
| #define MBEDTLS_ERR_BASE64_INVALID_CHARACTER  -0x002C  /**< Invalid character in input. */ | ||||
| #define MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL   -0x002A  /*< Output buffer too small. */ | ||||
| #define MBEDTLS_ERR_BASE64_INVALID_CHARACTER  -0x002C  /*< Invalid character in input. */ | ||||
| 
 | ||||
| int mbedtls_base64_encode(unsigned char *, size_t, size_t *, const unsigned char *, size_t); | ||||
| int mbedtls_base64_decode(unsigned char *, size_t, size_t *, const unsigned char *, size_t); | ||||
|  |  | |||
							
								
								
									
										26
									
								
								third_party/mbedtls/bignum.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										26
									
								
								third_party/mbedtls/bignum.h
									
										
									
									
										vendored
									
									
								
							|  | @ -7,14 +7,14 @@ | |||
| COSMOPOLITAN_C_START_ | ||||
| /* clang-format off */ | ||||
| 
 | ||||
| #define MBEDTLS_ERR_MPI_FILE_IO_ERROR                     -0x0002  /**< An error occurred while reading from or writing to a file. */ | ||||
| #define MBEDTLS_ERR_MPI_BAD_INPUT_DATA                    -0x0004  /**< Bad input parameters to function. */ | ||||
| #define MBEDTLS_ERR_MPI_INVALID_CHARACTER                 -0x0006  /**< There is an invalid character in the digit string. */ | ||||
| #define MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL                  -0x0008  /**< The buffer is too small to write to. */ | ||||
| #define MBEDTLS_ERR_MPI_NEGATIVE_VALUE                    -0x000A  /**< The input arguments are negative or result in illegal output. */ | ||||
| #define MBEDTLS_ERR_MPI_DIVISION_BY_ZERO                  -0x000C  /**< The input argument for division is zero, which is not allowed. */ | ||||
| #define MBEDTLS_ERR_MPI_NOT_ACCEPTABLE                    -0x000E  /**< The input arguments are not acceptable. */ | ||||
| #define MBEDTLS_ERR_MPI_ALLOC_FAILED                      -0x0010  /**< Memory allocation failed. */ | ||||
| #define MBEDTLS_ERR_MPI_FILE_IO_ERROR                     -0x0002  /*< An error occurred while reading from or writing to a file. */ | ||||
| #define MBEDTLS_ERR_MPI_BAD_INPUT_DATA                    -0x0004  /*< Bad input parameters to function. */ | ||||
| #define MBEDTLS_ERR_MPI_INVALID_CHARACTER                 -0x0006  /*< There is an invalid character in the digit string. */ | ||||
| #define MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL                  -0x0008  /*< The buffer is too small to write to. */ | ||||
| #define MBEDTLS_ERR_MPI_NEGATIVE_VALUE                    -0x000A  /*< The input arguments are negative or result in illegal output. */ | ||||
| #define MBEDTLS_ERR_MPI_DIVISION_BY_ZERO                  -0x000C  /*< The input argument for division is zero, which is not allowed. */ | ||||
| #define MBEDTLS_ERR_MPI_NOT_ACCEPTABLE                    -0x000E  /*< The input arguments are not acceptable. */ | ||||
| #define MBEDTLS_ERR_MPI_ALLOC_FAILED                      -0x0010  /*< Memory allocation failed. */ | ||||
| #define MBEDTLS_MPI_CHK(f)       \ | ||||
|     do                           \ | ||||
|     {                            \ | ||||
|  | @ -37,7 +37,7 @@ COSMOPOLITAN_C_START_ | |||
|  * | ||||
|  * Reduction in size, reduces speed. | ||||
|  */ | ||||
| #define MBEDTLS_MPI_WINDOW_SIZE                           6        /**< Maximum window size used. */ | ||||
| #define MBEDTLS_MPI_WINDOW_SIZE                           6        /*< Maximum window size used. */ | ||||
| #endif /* !MBEDTLS_MPI_WINDOW_SIZE */ | ||||
| 
 | ||||
| #if !defined(MBEDTLS_MPI_MAX_SIZE) | ||||
|  | @ -48,10 +48,10 @@ COSMOPOLITAN_C_START_ | |||
|  * Note: Calculations can temporarily result in larger MPIs. So the number | ||||
|  * of limbs required (MBEDTLS_MPI_MAX_LIMBS) is higher. | ||||
|  */ | ||||
| #define MBEDTLS_MPI_MAX_SIZE                              1024     /**< Maximum number of bytes for usable MPIs. */ | ||||
| #define MBEDTLS_MPI_MAX_SIZE                              1024     /*< Maximum number of bytes for usable MPIs. */ | ||||
| #endif /* !MBEDTLS_MPI_MAX_SIZE */ | ||||
| 
 | ||||
| #define MBEDTLS_MPI_MAX_BITS                              ( 8 * MBEDTLS_MPI_MAX_SIZE )    /**< Maximum number of bits for usable MPIs. */ | ||||
| #define MBEDTLS_MPI_MAX_BITS                              ( 8 * MBEDTLS_MPI_MAX_SIZE )    /*< Maximum number of bits for usable MPIs. */ | ||||
| 
 | ||||
| /*
 | ||||
|  * When reading from files with mbedtls_mpi_read_file() and writing to files with | ||||
|  | @ -96,8 +96,8 @@ mbedtls_mpi forcealign(16); | |||
|  * mbedtls_mpi_gen_prime(). | ||||
|  */ | ||||
| typedef enum { | ||||
|     MBEDTLS_MPI_GEN_PRIME_FLAG_DH =      0x0001, /**< (X-1)/2 is prime too */ | ||||
|     MBEDTLS_MPI_GEN_PRIME_FLAG_LOW_ERR = 0x0002, /**< lower error rate from 2<sup>-80</sup> to 2<sup>-128</sup> */ | ||||
|     MBEDTLS_MPI_GEN_PRIME_FLAG_DH =      0x0001, /*< (X-1)/2 is prime too */ | ||||
|     MBEDTLS_MPI_GEN_PRIME_FLAG_LOW_ERR = 0x0002, /*< lower error rate from 2<sup>-80</sup> to 2<sup>-128</sup> */ | ||||
| } mbedtls_mpi_gen_prime_flag_t; | ||||
| 
 | ||||
| int mbedtls_mpi_add_abs( mbedtls_mpi *, const mbedtls_mpi *, const mbedtls_mpi * ); | ||||
|  |  | |||
							
								
								
									
										6
									
								
								third_party/mbedtls/ccm.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								third_party/mbedtls/ccm.h
									
										
									
									
										vendored
									
									
								
							|  | @ -5,13 +5,13 @@ | |||
| COSMOPOLITAN_C_START_ | ||||
| 
 | ||||
| #define MBEDTLS_ERR_CCM_BAD_INPUT \ | ||||
|   -0x000D /**< Bad input parameters to the function. */ | ||||
|   -0x000D /*< Bad input parameters to the function. */ | ||||
| #define MBEDTLS_ERR_CCM_AUTH_FAILED \ | ||||
|   -0x000F /**< Authenticated decryption failed. */ | ||||
|   -0x000F /*< Authenticated decryption failed. */ | ||||
| 
 | ||||
| /* MBEDTLS_ERR_CCM_HW_ACCEL_FAILED is deprecated and should not be used. */ | ||||
| #define MBEDTLS_ERR_CCM_HW_ACCEL_FAILED \ | ||||
|   -0x0011 /**< CCM hardware accelerator failed. */ | ||||
|   -0x0011 /*< CCM hardware accelerator failed. */ | ||||
| 
 | ||||
| /**
 | ||||
|  * \brief    The CCM context-type definition. The CCM context is passed | ||||
|  |  | |||
							
								
								
									
										2
									
								
								third_party/mbedtls/chacha20.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								third_party/mbedtls/chacha20.h
									
										
									
									
										vendored
									
									
								
							|  | @ -4,7 +4,7 @@ | |||
| COSMOPOLITAN_C_START_ | ||||
| /* clang-format off */ | ||||
| 
 | ||||
| #define MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA         -0x0051 /**< Invalid input parameter(s). */ | ||||
| #define MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA         -0x0051 /*< Invalid input parameter(s). */ | ||||
| 
 | ||||
| typedef struct mbedtls_chacha20_context | ||||
| { | ||||
|  |  | |||
							
								
								
									
										20
									
								
								third_party/mbedtls/chachapoly.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										20
									
								
								third_party/mbedtls/chachapoly.h
									
										
									
									
										vendored
									
									
								
							|  | @ -4,8 +4,8 @@ | |||
| #include "third_party/mbedtls/poly1305.h" | ||||
| /* clang-format off */ | ||||
| 
 | ||||
| #define MBEDTLS_ERR_CHACHAPOLY_BAD_STATE            -0x0054 /**< The requested operation is not permitted in the current state. */ | ||||
| #define MBEDTLS_ERR_CHACHAPOLY_AUTH_FAILED          -0x0056 /**< Authenticated decryption failed: data was not authentic. */ | ||||
| #define MBEDTLS_ERR_CHACHAPOLY_BAD_STATE            -0x0054 /*< The requested operation is not permitted in the current state. */ | ||||
| #define MBEDTLS_ERR_CHACHAPOLY_AUTH_FAILED          -0x0056 /*< Authenticated decryption failed: data was not authentic. */ | ||||
| 
 | ||||
| #ifdef __cplusplus | ||||
| extern "C" { | ||||
|  | @ -13,8 +13,8 @@ extern "C" { | |||
| 
 | ||||
| typedef enum | ||||
| { | ||||
|     MBEDTLS_CHACHAPOLY_ENCRYPT,     /**< The mode value for performing encryption. */ | ||||
|     MBEDTLS_CHACHAPOLY_DECRYPT      /**< The mode value for performing decryption. */ | ||||
|     MBEDTLS_CHACHAPOLY_ENCRYPT,     /*< The mode value for performing encryption. */ | ||||
|     MBEDTLS_CHACHAPOLY_DECRYPT      /*< The mode value for performing decryption. */ | ||||
| } | ||||
| mbedtls_chachapoly_mode_t; | ||||
| 
 | ||||
|  | @ -24,12 +24,12 @@ mbedtls_chachapoly_mode_t; | |||
| 
 | ||||
| typedef struct mbedtls_chachapoly_context | ||||
| { | ||||
|     mbedtls_chacha20_context chacha20_ctx;  /**< The ChaCha20 context. */ | ||||
|     mbedtls_poly1305_context poly1305_ctx;  /**< The Poly1305 context. */ | ||||
|     uint64_t aad_len;                       /**< The length (bytes) of the Additional Authenticated Data. */ | ||||
|     uint64_t ciphertext_len;                /**< The length (bytes) of the ciphertext. */ | ||||
|     int state;                              /**< The current state of the context. */ | ||||
|     mbedtls_chachapoly_mode_t mode;         /**< Cipher mode (encrypt or decrypt). */ | ||||
|     mbedtls_chacha20_context chacha20_ctx;  /*< The ChaCha20 context. */ | ||||
|     mbedtls_poly1305_context poly1305_ctx;  /*< The Poly1305 context. */ | ||||
|     uint64_t aad_len;                       /*< The length (bytes) of the Additional Authenticated Data. */ | ||||
|     uint64_t ciphertext_len;                /*< The length (bytes) of the ciphertext. */ | ||||
|     int state;                              /*< The current state of the context. */ | ||||
|     mbedtls_chachapoly_mode_t mode;         /*< Cipher mode (encrypt or decrypt). */ | ||||
| } | ||||
| mbedtls_chachapoly_context; | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										236
									
								
								third_party/mbedtls/cipher.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										236
									
								
								third_party/mbedtls/cipher.h
									
										
									
									
										vendored
									
									
								
							|  | @ -4,19 +4,19 @@ | |||
| #include "third_party/mbedtls/platform.h" | ||||
| /* clang-format off */ | ||||
| 
 | ||||
| #define MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE  -0x6080  /**< The selected feature is not available. */ | ||||
| #define MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA       -0x6100  /**< Bad input parameters. */ | ||||
| #define MBEDTLS_ERR_CIPHER_ALLOC_FAILED         -0x6180  /**< Failed to allocate memory. */ | ||||
| #define MBEDTLS_ERR_CIPHER_INVALID_PADDING      -0x6200  /**< Input data contains invalid padding and is rejected. */ | ||||
| #define MBEDTLS_ERR_CIPHER_FULL_BLOCK_EXPECTED  -0x6280  /**< Decryption of block requires a full block. */ | ||||
| #define MBEDTLS_ERR_CIPHER_AUTH_FAILED          -0x6300  /**< Authentication failed (for AEAD modes). */ | ||||
| #define MBEDTLS_ERR_CIPHER_INVALID_CONTEXT      -0x6380  /**< The context is invalid. For example, because it was freed. */ | ||||
| #define MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE  -0x6080  /*< The selected feature is not available. */ | ||||
| #define MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA       -0x6100  /*< Bad input parameters. */ | ||||
| #define MBEDTLS_ERR_CIPHER_ALLOC_FAILED         -0x6180  /*< Failed to allocate memory. */ | ||||
| #define MBEDTLS_ERR_CIPHER_INVALID_PADDING      -0x6200  /*< Input data contains invalid padding and is rejected. */ | ||||
| #define MBEDTLS_ERR_CIPHER_FULL_BLOCK_EXPECTED  -0x6280  /*< Decryption of block requires a full block. */ | ||||
| #define MBEDTLS_ERR_CIPHER_AUTH_FAILED          -0x6300  /*< Authentication failed (for AEAD modes). */ | ||||
| #define MBEDTLS_ERR_CIPHER_INVALID_CONTEXT      -0x6380  /*< The context is invalid. For example, because it was freed. */ | ||||
| 
 | ||||
| /* MBEDTLS_ERR_CIPHER_HW_ACCEL_FAILED is deprecated and should not be used. */ | ||||
| #define MBEDTLS_ERR_CIPHER_HW_ACCEL_FAILED      -0x6400  /**< Cipher hardware accelerator failed. */ | ||||
| #define MBEDTLS_ERR_CIPHER_HW_ACCEL_FAILED      -0x6400  /*< Cipher hardware accelerator failed. */ | ||||
| 
 | ||||
| #define MBEDTLS_CIPHER_VARIABLE_IV_LEN     0x01    /**< Cipher accepts IVs of variable length. */ | ||||
| #define MBEDTLS_CIPHER_VARIABLE_KEY_LEN    0x02    /**< Cipher accepts keys of variable length. */ | ||||
| #define MBEDTLS_CIPHER_VARIABLE_IV_LEN     0x01    /*< Cipher accepts IVs of variable length. */ | ||||
| #define MBEDTLS_CIPHER_VARIABLE_KEY_LEN    0x02    /*< Cipher accepts keys of variable length. */ | ||||
| 
 | ||||
| #ifdef __cplusplus | ||||
| extern "C" { | ||||
|  | @ -30,16 +30,16 @@ extern "C" { | |||
|  *            ciphers instead. | ||||
|  */ | ||||
| typedef enum { | ||||
|     MBEDTLS_CIPHER_ID_NONE = 0,  /**< Placeholder to mark the end of cipher ID lists. */ | ||||
|     MBEDTLS_CIPHER_ID_NULL,      /**< The identity cipher, treated as a stream cipher. */ | ||||
|     MBEDTLS_CIPHER_ID_AES,       /**< The AES cipher. */ | ||||
|     MBEDTLS_CIPHER_ID_DES,       /**< The DES cipher. */ | ||||
|     MBEDTLS_CIPHER_ID_3DES,      /**< The Triple DES cipher. */ | ||||
|     MBEDTLS_CIPHER_ID_CAMELLIA,  /**< The Camellia cipher. */ | ||||
|     MBEDTLS_CIPHER_ID_BLOWFISH,  /**< The Blowfish cipher. */ | ||||
|     MBEDTLS_CIPHER_ID_ARC4,      /**< The RC4 cipher. */ | ||||
|     MBEDTLS_CIPHER_ID_ARIA,      /**< The Aria cipher. */ | ||||
|     MBEDTLS_CIPHER_ID_CHACHA20,  /**< The ChaCha20 cipher. */ | ||||
|     MBEDTLS_CIPHER_ID_NONE = 0,  /*< Placeholder to mark the end of cipher ID lists. */ | ||||
|     MBEDTLS_CIPHER_ID_NULL,      /*< The identity cipher, treated as a stream cipher. */ | ||||
|     MBEDTLS_CIPHER_ID_AES,       /*< The AES cipher. */ | ||||
|     MBEDTLS_CIPHER_ID_DES,       /*< The DES cipher. */ | ||||
|     MBEDTLS_CIPHER_ID_3DES,      /*< The Triple DES cipher. */ | ||||
|     MBEDTLS_CIPHER_ID_CAMELLIA,  /*< The Camellia cipher. */ | ||||
|     MBEDTLS_CIPHER_ID_BLOWFISH,  /*< The Blowfish cipher. */ | ||||
|     MBEDTLS_CIPHER_ID_ARC4,      /*< The RC4 cipher. */ | ||||
|     MBEDTLS_CIPHER_ID_ARIA,      /*< The Aria cipher. */ | ||||
|     MBEDTLS_CIPHER_ID_CHACHA20,  /*< The ChaCha20 cipher. */ | ||||
| } mbedtls_cipher_id_t; | ||||
| 
 | ||||
| /**
 | ||||
|  | @ -50,112 +50,112 @@ typedef enum { | |||
|  *            ciphers instead. | ||||
|  */ | ||||
| typedef enum { | ||||
|     MBEDTLS_CIPHER_NONE = 0,             /**< Placeholder to mark the end of cipher-pair lists. */ | ||||
|     MBEDTLS_CIPHER_NULL,                 /**< The identity stream cipher. */ | ||||
|     MBEDTLS_CIPHER_AES_128_ECB,          /**< AES cipher with 128-bit ECB mode. */ | ||||
|     MBEDTLS_CIPHER_AES_192_ECB,          /**< AES cipher with 192-bit ECB mode. */ | ||||
|     MBEDTLS_CIPHER_AES_256_ECB,          /**< AES cipher with 256-bit ECB mode. */ | ||||
|     MBEDTLS_CIPHER_AES_128_CBC,          /**< AES cipher with 128-bit CBC mode. */ | ||||
|     MBEDTLS_CIPHER_AES_192_CBC,          /**< AES cipher with 192-bit CBC mode. */ | ||||
|     MBEDTLS_CIPHER_AES_256_CBC,          /**< AES cipher with 256-bit CBC mode. */ | ||||
|     MBEDTLS_CIPHER_AES_128_CFB128,       /**< AES cipher with 128-bit CFB128 mode. */ | ||||
|     MBEDTLS_CIPHER_AES_192_CFB128,       /**< AES cipher with 192-bit CFB128 mode. */ | ||||
|     MBEDTLS_CIPHER_AES_256_CFB128,       /**< AES cipher with 256-bit CFB128 mode. */ | ||||
|     MBEDTLS_CIPHER_AES_128_CTR,          /**< AES cipher with 128-bit CTR mode. */ | ||||
|     MBEDTLS_CIPHER_AES_192_CTR,          /**< AES cipher with 192-bit CTR mode. */ | ||||
|     MBEDTLS_CIPHER_AES_256_CTR,          /**< AES cipher with 256-bit CTR mode. */ | ||||
|     MBEDTLS_CIPHER_AES_128_GCM,          /**< AES cipher with 128-bit GCM mode. */ | ||||
|     MBEDTLS_CIPHER_AES_192_GCM,          /**< AES cipher with 192-bit GCM mode. */ | ||||
|     MBEDTLS_CIPHER_AES_256_GCM,          /**< AES cipher with 256-bit GCM mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_128_ECB,     /**< Camellia cipher with 128-bit ECB mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_192_ECB,     /**< Camellia cipher with 192-bit ECB mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_256_ECB,     /**< Camellia cipher with 256-bit ECB mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_128_CBC,     /**< Camellia cipher with 128-bit CBC mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_192_CBC,     /**< Camellia cipher with 192-bit CBC mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_256_CBC,     /**< Camellia cipher with 256-bit CBC mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_128_CFB128,  /**< Camellia cipher with 128-bit CFB128 mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_192_CFB128,  /**< Camellia cipher with 192-bit CFB128 mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_256_CFB128,  /**< Camellia cipher with 256-bit CFB128 mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_128_CTR,     /**< Camellia cipher with 128-bit CTR mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_192_CTR,     /**< Camellia cipher with 192-bit CTR mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_256_CTR,     /**< Camellia cipher with 256-bit CTR mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_128_GCM,     /**< Camellia cipher with 128-bit GCM mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_192_GCM,     /**< Camellia cipher with 192-bit GCM mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_256_GCM,     /**< Camellia cipher with 256-bit GCM mode. */ | ||||
|     MBEDTLS_CIPHER_DES_ECB,              /**< DES cipher with ECB mode. */ | ||||
|     MBEDTLS_CIPHER_DES_CBC,              /**< DES cipher with CBC mode. */ | ||||
|     MBEDTLS_CIPHER_DES_EDE_ECB,          /**< DES cipher with EDE ECB mode. */ | ||||
|     MBEDTLS_CIPHER_DES_EDE_CBC,          /**< DES cipher with EDE CBC mode. */ | ||||
|     MBEDTLS_CIPHER_DES_EDE3_ECB,         /**< DES cipher with EDE3 ECB mode. */ | ||||
|     MBEDTLS_CIPHER_DES_EDE3_CBC,         /**< DES cipher with EDE3 CBC mode. */ | ||||
|     MBEDTLS_CIPHER_BLOWFISH_ECB,         /**< Blowfish cipher with ECB mode. */ | ||||
|     MBEDTLS_CIPHER_BLOWFISH_CBC,         /**< Blowfish cipher with CBC mode. */ | ||||
|     MBEDTLS_CIPHER_BLOWFISH_CFB64,       /**< Blowfish cipher with CFB64 mode. */ | ||||
|     MBEDTLS_CIPHER_BLOWFISH_CTR,         /**< Blowfish cipher with CTR mode. */ | ||||
|     MBEDTLS_CIPHER_ARC4_128,             /**< RC4 cipher with 128-bit mode. */ | ||||
|     MBEDTLS_CIPHER_AES_128_CCM,          /**< AES cipher with 128-bit CCM mode. */ | ||||
|     MBEDTLS_CIPHER_AES_192_CCM,          /**< AES cipher with 192-bit CCM mode. */ | ||||
|     MBEDTLS_CIPHER_AES_256_CCM,          /**< AES cipher with 256-bit CCM mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_128_CCM,     /**< Camellia cipher with 128-bit CCM mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_192_CCM,     /**< Camellia cipher with 192-bit CCM mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_256_CCM,     /**< Camellia cipher with 256-bit CCM mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_128_ECB,         /**< Aria cipher with 128-bit key and ECB mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_192_ECB,         /**< Aria cipher with 192-bit key and ECB mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_256_ECB,         /**< Aria cipher with 256-bit key and ECB mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_128_CBC,         /**< Aria cipher with 128-bit key and CBC mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_192_CBC,         /**< Aria cipher with 192-bit key and CBC mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_256_CBC,         /**< Aria cipher with 256-bit key and CBC mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_128_CFB128,      /**< Aria cipher with 128-bit key and CFB-128 mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_192_CFB128,      /**< Aria cipher with 192-bit key and CFB-128 mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_256_CFB128,      /**< Aria cipher with 256-bit key and CFB-128 mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_128_CTR,         /**< Aria cipher with 128-bit key and CTR mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_192_CTR,         /**< Aria cipher with 192-bit key and CTR mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_256_CTR,         /**< Aria cipher with 256-bit key and CTR mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_128_GCM,         /**< Aria cipher with 128-bit key and GCM mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_192_GCM,         /**< Aria cipher with 192-bit key and GCM mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_256_GCM,         /**< Aria cipher with 256-bit key and GCM mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_128_CCM,         /**< Aria cipher with 128-bit key and CCM mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_192_CCM,         /**< Aria cipher with 192-bit key and CCM mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_256_CCM,         /**< Aria cipher with 256-bit key and CCM mode. */ | ||||
|     MBEDTLS_CIPHER_AES_128_OFB,          /**< AES 128-bit cipher in OFB mode. */ | ||||
|     MBEDTLS_CIPHER_AES_192_OFB,          /**< AES 192-bit cipher in OFB mode. */ | ||||
|     MBEDTLS_CIPHER_AES_256_OFB,          /**< AES 256-bit cipher in OFB mode. */ | ||||
|     MBEDTLS_CIPHER_AES_128_XTS,          /**< AES 128-bit cipher in XTS block mode. */ | ||||
|     MBEDTLS_CIPHER_AES_256_XTS,          /**< AES 256-bit cipher in XTS block mode. */ | ||||
|     MBEDTLS_CIPHER_CHACHA20,             /**< ChaCha20 stream cipher. */ | ||||
|     MBEDTLS_CIPHER_CHACHA20_POLY1305,    /**< ChaCha20-Poly1305 AEAD cipher. */ | ||||
|     MBEDTLS_CIPHER_AES_128_KW,           /**< AES cipher with 128-bit NIST KW mode. */ | ||||
|     MBEDTLS_CIPHER_AES_192_KW,           /**< AES cipher with 192-bit NIST KW mode. */ | ||||
|     MBEDTLS_CIPHER_AES_256_KW,           /**< AES cipher with 256-bit NIST KW mode. */ | ||||
|     MBEDTLS_CIPHER_AES_128_KWP,          /**< AES cipher with 128-bit NIST KWP mode. */ | ||||
|     MBEDTLS_CIPHER_AES_192_KWP,          /**< AES cipher with 192-bit NIST KWP mode. */ | ||||
|     MBEDTLS_CIPHER_AES_256_KWP,          /**< AES cipher with 256-bit NIST KWP mode. */ | ||||
|     MBEDTLS_CIPHER_NONE = 0,             /*< Placeholder to mark the end of cipher-pair lists. */ | ||||
|     MBEDTLS_CIPHER_NULL,                 /*< The identity stream cipher. */ | ||||
|     MBEDTLS_CIPHER_AES_128_ECB,          /*< AES cipher with 128-bit ECB mode. */ | ||||
|     MBEDTLS_CIPHER_AES_192_ECB,          /*< AES cipher with 192-bit ECB mode. */ | ||||
|     MBEDTLS_CIPHER_AES_256_ECB,          /*< AES cipher with 256-bit ECB mode. */ | ||||
|     MBEDTLS_CIPHER_AES_128_CBC,          /*< AES cipher with 128-bit CBC mode. */ | ||||
|     MBEDTLS_CIPHER_AES_192_CBC,          /*< AES cipher with 192-bit CBC mode. */ | ||||
|     MBEDTLS_CIPHER_AES_256_CBC,          /*< AES cipher with 256-bit CBC mode. */ | ||||
|     MBEDTLS_CIPHER_AES_128_CFB128,       /*< AES cipher with 128-bit CFB128 mode. */ | ||||
|     MBEDTLS_CIPHER_AES_192_CFB128,       /*< AES cipher with 192-bit CFB128 mode. */ | ||||
|     MBEDTLS_CIPHER_AES_256_CFB128,       /*< AES cipher with 256-bit CFB128 mode. */ | ||||
|     MBEDTLS_CIPHER_AES_128_CTR,          /*< AES cipher with 128-bit CTR mode. */ | ||||
|     MBEDTLS_CIPHER_AES_192_CTR,          /*< AES cipher with 192-bit CTR mode. */ | ||||
|     MBEDTLS_CIPHER_AES_256_CTR,          /*< AES cipher with 256-bit CTR mode. */ | ||||
|     MBEDTLS_CIPHER_AES_128_GCM,          /*< AES cipher with 128-bit GCM mode. */ | ||||
|     MBEDTLS_CIPHER_AES_192_GCM,          /*< AES cipher with 192-bit GCM mode. */ | ||||
|     MBEDTLS_CIPHER_AES_256_GCM,          /*< AES cipher with 256-bit GCM mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_128_ECB,     /*< Camellia cipher with 128-bit ECB mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_192_ECB,     /*< Camellia cipher with 192-bit ECB mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_256_ECB,     /*< Camellia cipher with 256-bit ECB mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_128_CBC,     /*< Camellia cipher with 128-bit CBC mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_192_CBC,     /*< Camellia cipher with 192-bit CBC mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_256_CBC,     /*< Camellia cipher with 256-bit CBC mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_128_CFB128,  /*< Camellia cipher with 128-bit CFB128 mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_192_CFB128,  /*< Camellia cipher with 192-bit CFB128 mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_256_CFB128,  /*< Camellia cipher with 256-bit CFB128 mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_128_CTR,     /*< Camellia cipher with 128-bit CTR mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_192_CTR,     /*< Camellia cipher with 192-bit CTR mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_256_CTR,     /*< Camellia cipher with 256-bit CTR mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_128_GCM,     /*< Camellia cipher with 128-bit GCM mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_192_GCM,     /*< Camellia cipher with 192-bit GCM mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_256_GCM,     /*< Camellia cipher with 256-bit GCM mode. */ | ||||
|     MBEDTLS_CIPHER_DES_ECB,              /*< DES cipher with ECB mode. */ | ||||
|     MBEDTLS_CIPHER_DES_CBC,              /*< DES cipher with CBC mode. */ | ||||
|     MBEDTLS_CIPHER_DES_EDE_ECB,          /*< DES cipher with EDE ECB mode. */ | ||||
|     MBEDTLS_CIPHER_DES_EDE_CBC,          /*< DES cipher with EDE CBC mode. */ | ||||
|     MBEDTLS_CIPHER_DES_EDE3_ECB,         /*< DES cipher with EDE3 ECB mode. */ | ||||
|     MBEDTLS_CIPHER_DES_EDE3_CBC,         /*< DES cipher with EDE3 CBC mode. */ | ||||
|     MBEDTLS_CIPHER_BLOWFISH_ECB,         /*< Blowfish cipher with ECB mode. */ | ||||
|     MBEDTLS_CIPHER_BLOWFISH_CBC,         /*< Blowfish cipher with CBC mode. */ | ||||
|     MBEDTLS_CIPHER_BLOWFISH_CFB64,       /*< Blowfish cipher with CFB64 mode. */ | ||||
|     MBEDTLS_CIPHER_BLOWFISH_CTR,         /*< Blowfish cipher with CTR mode. */ | ||||
|     MBEDTLS_CIPHER_ARC4_128,             /*< RC4 cipher with 128-bit mode. */ | ||||
|     MBEDTLS_CIPHER_AES_128_CCM,          /*< AES cipher with 128-bit CCM mode. */ | ||||
|     MBEDTLS_CIPHER_AES_192_CCM,          /*< AES cipher with 192-bit CCM mode. */ | ||||
|     MBEDTLS_CIPHER_AES_256_CCM,          /*< AES cipher with 256-bit CCM mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_128_CCM,     /*< Camellia cipher with 128-bit CCM mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_192_CCM,     /*< Camellia cipher with 192-bit CCM mode. */ | ||||
|     MBEDTLS_CIPHER_CAMELLIA_256_CCM,     /*< Camellia cipher with 256-bit CCM mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_128_ECB,         /*< Aria cipher with 128-bit key and ECB mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_192_ECB,         /*< Aria cipher with 192-bit key and ECB mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_256_ECB,         /*< Aria cipher with 256-bit key and ECB mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_128_CBC,         /*< Aria cipher with 128-bit key and CBC mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_192_CBC,         /*< Aria cipher with 192-bit key and CBC mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_256_CBC,         /*< Aria cipher with 256-bit key and CBC mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_128_CFB128,      /*< Aria cipher with 128-bit key and CFB-128 mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_192_CFB128,      /*< Aria cipher with 192-bit key and CFB-128 mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_256_CFB128,      /*< Aria cipher with 256-bit key and CFB-128 mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_128_CTR,         /*< Aria cipher with 128-bit key and CTR mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_192_CTR,         /*< Aria cipher with 192-bit key and CTR mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_256_CTR,         /*< Aria cipher with 256-bit key and CTR mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_128_GCM,         /*< Aria cipher with 128-bit key and GCM mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_192_GCM,         /*< Aria cipher with 192-bit key and GCM mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_256_GCM,         /*< Aria cipher with 256-bit key and GCM mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_128_CCM,         /*< Aria cipher with 128-bit key and CCM mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_192_CCM,         /*< Aria cipher with 192-bit key and CCM mode. */ | ||||
|     MBEDTLS_CIPHER_ARIA_256_CCM,         /*< Aria cipher with 256-bit key and CCM mode. */ | ||||
|     MBEDTLS_CIPHER_AES_128_OFB,          /*< AES 128-bit cipher in OFB mode. */ | ||||
|     MBEDTLS_CIPHER_AES_192_OFB,          /*< AES 192-bit cipher in OFB mode. */ | ||||
|     MBEDTLS_CIPHER_AES_256_OFB,          /*< AES 256-bit cipher in OFB mode. */ | ||||
|     MBEDTLS_CIPHER_AES_128_XTS,          /*< AES 128-bit cipher in XTS block mode. */ | ||||
|     MBEDTLS_CIPHER_AES_256_XTS,          /*< AES 256-bit cipher in XTS block mode. */ | ||||
|     MBEDTLS_CIPHER_CHACHA20,             /*< ChaCha20 stream cipher. */ | ||||
|     MBEDTLS_CIPHER_CHACHA20_POLY1305,    /*< ChaCha20-Poly1305 AEAD cipher. */ | ||||
|     MBEDTLS_CIPHER_AES_128_KW,           /*< AES cipher with 128-bit NIST KW mode. */ | ||||
|     MBEDTLS_CIPHER_AES_192_KW,           /*< AES cipher with 192-bit NIST KW mode. */ | ||||
|     MBEDTLS_CIPHER_AES_256_KW,           /*< AES cipher with 256-bit NIST KW mode. */ | ||||
|     MBEDTLS_CIPHER_AES_128_KWP,          /*< AES cipher with 128-bit NIST KWP mode. */ | ||||
|     MBEDTLS_CIPHER_AES_192_KWP,          /*< AES cipher with 192-bit NIST KWP mode. */ | ||||
|     MBEDTLS_CIPHER_AES_256_KWP,          /*< AES cipher with 256-bit NIST KWP mode. */ | ||||
| } mbedtls_cipher_type_t; | ||||
| 
 | ||||
| /** Supported cipher modes. */ | ||||
| typedef enum { | ||||
|     MBEDTLS_MODE_NONE = 0,               /**< None.                        */ | ||||
|     MBEDTLS_MODE_ECB,                    /**< The ECB cipher mode.         */ | ||||
|     MBEDTLS_MODE_CBC,                    /**< The CBC cipher mode.         */ | ||||
|     MBEDTLS_MODE_CFB,                    /**< The CFB cipher mode.         */ | ||||
|     MBEDTLS_MODE_OFB,                    /**< The OFB cipher mode.         */ | ||||
|     MBEDTLS_MODE_CTR,                    /**< The CTR cipher mode.         */ | ||||
|     MBEDTLS_MODE_GCM,                    /**< The GCM cipher mode.         */ | ||||
|     MBEDTLS_MODE_STREAM,                 /**< The stream cipher mode.      */ | ||||
|     MBEDTLS_MODE_CCM,                    /**< The CCM cipher mode.         */ | ||||
|     MBEDTLS_MODE_XTS,                    /**< The XTS cipher mode.         */ | ||||
|     MBEDTLS_MODE_CHACHAPOLY,             /**< The ChaCha-Poly cipher mode. */ | ||||
|     MBEDTLS_MODE_KW,                     /**< The SP800-38F KW mode */ | ||||
|     MBEDTLS_MODE_KWP,                    /**< The SP800-38F KWP mode */ | ||||
|     MBEDTLS_MODE_NONE = 0,               /*< None.                        */ | ||||
|     MBEDTLS_MODE_ECB,                    /*< The ECB cipher mode.         */ | ||||
|     MBEDTLS_MODE_CBC,                    /*< The CBC cipher mode.         */ | ||||
|     MBEDTLS_MODE_CFB,                    /*< The CFB cipher mode.         */ | ||||
|     MBEDTLS_MODE_OFB,                    /*< The OFB cipher mode.         */ | ||||
|     MBEDTLS_MODE_CTR,                    /*< The CTR cipher mode.         */ | ||||
|     MBEDTLS_MODE_GCM,                    /*< The GCM cipher mode.         */ | ||||
|     MBEDTLS_MODE_STREAM,                 /*< The stream cipher mode.      */ | ||||
|     MBEDTLS_MODE_CCM,                    /*< The CCM cipher mode.         */ | ||||
|     MBEDTLS_MODE_XTS,                    /*< The XTS cipher mode.         */ | ||||
|     MBEDTLS_MODE_CHACHAPOLY,             /*< The ChaCha-Poly cipher mode. */ | ||||
|     MBEDTLS_MODE_KW,                     /*< The SP800-38F KW mode */ | ||||
|     MBEDTLS_MODE_KWP,                    /*< The SP800-38F KWP mode */ | ||||
| } mbedtls_cipher_mode_t; | ||||
| 
 | ||||
| /** Supported cipher padding types. */ | ||||
| typedef enum { | ||||
|     MBEDTLS_PADDING_PKCS7 = 0,     /**< PKCS7 padding (default).        */ | ||||
|     MBEDTLS_PADDING_ONE_AND_ZEROS, /**< ISO/IEC 7816-4 padding.         */ | ||||
|     MBEDTLS_PADDING_ZEROS_AND_LEN, /**< ANSI X.923 padding.             */ | ||||
|     MBEDTLS_PADDING_ZEROS,         /**< Zero padding (not reversible). */ | ||||
|     MBEDTLS_PADDING_NONE,          /**< Never pad (full blocks only).   */ | ||||
|     MBEDTLS_PADDING_PKCS7 = 0,     /*< PKCS7 padding (default).        */ | ||||
|     MBEDTLS_PADDING_ONE_AND_ZEROS, /*< ISO/IEC 7816-4 padding.         */ | ||||
|     MBEDTLS_PADDING_ZEROS_AND_LEN, /*< ANSI X.923 padding.             */ | ||||
|     MBEDTLS_PADDING_ZEROS,         /*< Zero padding (not reversible). */ | ||||
|     MBEDTLS_PADDING_NONE,          /*< Never pad (full blocks only).   */ | ||||
| } mbedtls_cipher_padding_t; | ||||
| 
 | ||||
| /** Type of operation. */ | ||||
|  |  | |||
							
								
								
									
										30
									
								
								third_party/mbedtls/ctr_drbg.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										30
									
								
								third_party/mbedtls/ctr_drbg.h
									
										
									
									
										vendored
									
									
								
							|  | @ -5,31 +5,31 @@ | |||
| COSMOPOLITAN_C_START_ | ||||
| /* clang-format off */ | ||||
| 
 | ||||
| #define MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED        -0x0034  /**< The entropy source failed. */ | ||||
| #define MBEDTLS_ERR_CTR_DRBG_REQUEST_TOO_BIG              -0x0036  /**< The requested random buffer length is too big. */ | ||||
| #define MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG                -0x0038  /**< The input (entropy + additional data) is too large. */ | ||||
| #define MBEDTLS_ERR_CTR_DRBG_FILE_IO_ERROR                -0x003A  /**< Read or write error in file. */ | ||||
| #define MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED        -0x0034  /*< The entropy source failed. */ | ||||
| #define MBEDTLS_ERR_CTR_DRBG_REQUEST_TOO_BIG              -0x0036  /*< The requested random buffer length is too big. */ | ||||
| #define MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG                -0x0038  /*< The input (entropy + additional data) is too large. */ | ||||
| #define MBEDTLS_ERR_CTR_DRBG_FILE_IO_ERROR                -0x003A  /*< Read or write error in file. */ | ||||
| 
 | ||||
| #define MBEDTLS_CTR_DRBG_BLOCKSIZE          16 /**< The block size used by the cipher. */ | ||||
| #define MBEDTLS_CTR_DRBG_BLOCKSIZE          16 /*< The block size used by the cipher. */ | ||||
| 
 | ||||
| #if defined(MBEDTLS_CTR_DRBG_USE_128_BIT_KEY) | ||||
| #define MBEDTLS_CTR_DRBG_KEYSIZE            16 | ||||
| /**< The key size in bytes used by the cipher.
 | ||||
| /*< The key size in bytes used by the cipher.
 | ||||
|  * | ||||
|  * Compile-time choice: 16 bytes (128 bits) | ||||
|  * because #MBEDTLS_CTR_DRBG_USE_128_BIT_KEY is enabled. | ||||
|  */ | ||||
| #else | ||||
| #define MBEDTLS_CTR_DRBG_KEYSIZE            32 | ||||
| /**< The key size in bytes used by the cipher.
 | ||||
| /*< The key size in bytes used by the cipher.
 | ||||
|  * | ||||
|  * Compile-time choice: 32 bytes (256 bits) | ||||
|  * because \c MBEDTLS_CTR_DRBG_USE_128_BIT_KEY is disabled. | ||||
|  */ | ||||
| #endif | ||||
| 
 | ||||
| #define MBEDTLS_CTR_DRBG_KEYBITS            ( MBEDTLS_CTR_DRBG_KEYSIZE * 8 ) /**< The key size for the DRBG operation, in bits. */ | ||||
| #define MBEDTLS_CTR_DRBG_SEEDLEN            ( MBEDTLS_CTR_DRBG_KEYSIZE + MBEDTLS_CTR_DRBG_BLOCKSIZE ) /**< The seed length, calculated as (counter + AES key). */ | ||||
| #define MBEDTLS_CTR_DRBG_KEYBITS            ( MBEDTLS_CTR_DRBG_KEYSIZE * 8 ) /*< The key size for the DRBG operation, in bits. */ | ||||
| #define MBEDTLS_CTR_DRBG_SEEDLEN            ( MBEDTLS_CTR_DRBG_KEYSIZE + MBEDTLS_CTR_DRBG_BLOCKSIZE ) /*< The seed length, calculated as (counter + AES key). */ | ||||
| 
 | ||||
| /**
 | ||||
|  * \name SECTION: Module settings | ||||
|  | @ -68,30 +68,30 @@ COSMOPOLITAN_C_START_ | |||
| 
 | ||||
| #if !defined(MBEDTLS_CTR_DRBG_RESEED_INTERVAL) | ||||
| #define MBEDTLS_CTR_DRBG_RESEED_INTERVAL    10000 | ||||
| /**< The interval before reseed is performed by default. */ | ||||
| /*< The interval before reseed is performed by default. */ | ||||
| #endif | ||||
| 
 | ||||
| #if !defined(MBEDTLS_CTR_DRBG_MAX_INPUT) | ||||
| #define MBEDTLS_CTR_DRBG_MAX_INPUT          256 | ||||
| /**< The maximum number of additional input Bytes. */ | ||||
| /*< The maximum number of additional input Bytes. */ | ||||
| #endif | ||||
| 
 | ||||
| #if !defined(MBEDTLS_CTR_DRBG_MAX_REQUEST) | ||||
| #define MBEDTLS_CTR_DRBG_MAX_REQUEST        1024 | ||||
| /**< The maximum number of requested Bytes per call. */ | ||||
| /*< The maximum number of requested Bytes per call. */ | ||||
| #endif | ||||
| 
 | ||||
| #if !defined(MBEDTLS_CTR_DRBG_MAX_SEED_INPUT) | ||||
| #define MBEDTLS_CTR_DRBG_MAX_SEED_INPUT     384 | ||||
| /**< The maximum size of seed or reseed buffer in bytes. */ | ||||
| /*< The maximum size of seed or reseed buffer in bytes. */ | ||||
| #endif | ||||
| 
 | ||||
| /* \} name SECTION: Module settings */ | ||||
| 
 | ||||
| #define MBEDTLS_CTR_DRBG_PR_OFF             0 | ||||
| /**< Prediction resistance is disabled. */ | ||||
| /*< Prediction resistance is disabled. */ | ||||
| #define MBEDTLS_CTR_DRBG_PR_ON              1 | ||||
| /**< Prediction resistance is enabled. */ | ||||
| /*< Prediction resistance is enabled. */ | ||||
| 
 | ||||
| #if MBEDTLS_CTR_DRBG_ENTROPY_LEN >= MBEDTLS_CTR_DRBG_KEYSIZE * 3 / 2 | ||||
| /** The default length of the nonce read from the entropy source.
 | ||||
|  |  | |||
							
								
								
									
										4
									
								
								third_party/mbedtls/des.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								third_party/mbedtls/des.h
									
										
									
									
										vendored
									
									
								
							|  | @ -6,10 +6,10 @@ | |||
| #define MBEDTLS_DES_ENCRYPT     1 | ||||
| #define MBEDTLS_DES_DECRYPT     0 | ||||
| 
 | ||||
| #define MBEDTLS_ERR_DES_INVALID_INPUT_LENGTH              -0x0032  /**< The data input has an invalid length. */ | ||||
| #define MBEDTLS_ERR_DES_INVALID_INPUT_LENGTH              -0x0032  /*< The data input has an invalid length. */ | ||||
| 
 | ||||
| /* MBEDTLS_ERR_DES_HW_ACCEL_FAILED is deprecated and should not be used. */ | ||||
| #define MBEDTLS_ERR_DES_HW_ACCEL_FAILED                   -0x0033  /**< DES hardware accelerator failed. */ | ||||
| #define MBEDTLS_ERR_DES_HW_ACCEL_FAILED                   -0x0033  /*< DES hardware accelerator failed. */ | ||||
| 
 | ||||
| #define MBEDTLS_DES_KEY_SIZE    8 | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										22
									
								
								third_party/mbedtls/dhm.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										22
									
								
								third_party/mbedtls/dhm.h
									
										
									
									
										vendored
									
									
								
							|  | @ -7,20 +7,20 @@ | |||
| /*
 | ||||
|  * DHM Error codes | ||||
|  */ | ||||
| #define MBEDTLS_ERR_DHM_BAD_INPUT_DATA                    -0x3080  /**< Bad input parameters. */ | ||||
| #define MBEDTLS_ERR_DHM_READ_PARAMS_FAILED                -0x3100  /**< Reading of the DHM parameters failed. */ | ||||
| #define MBEDTLS_ERR_DHM_MAKE_PARAMS_FAILED                -0x3180  /**< Making of the DHM parameters failed. */ | ||||
| #define MBEDTLS_ERR_DHM_READ_PUBLIC_FAILED                -0x3200  /**< Reading of the public values failed. */ | ||||
| #define MBEDTLS_ERR_DHM_MAKE_PUBLIC_FAILED                -0x3280  /**< Making of the public value failed. */ | ||||
| #define MBEDTLS_ERR_DHM_CALC_SECRET_FAILED                -0x3300  /**< Calculation of the DHM secret failed. */ | ||||
| #define MBEDTLS_ERR_DHM_INVALID_FORMAT                    -0x3380  /**< The ASN.1 data is not formatted correctly. */ | ||||
| #define MBEDTLS_ERR_DHM_ALLOC_FAILED                      -0x3400  /**< Allocation of memory failed. */ | ||||
| #define MBEDTLS_ERR_DHM_FILE_IO_ERROR                     -0x3480  /**< Read or write of file failed. */ | ||||
| #define MBEDTLS_ERR_DHM_BAD_INPUT_DATA                    -0x3080  /*< Bad input parameters. */ | ||||
| #define MBEDTLS_ERR_DHM_READ_PARAMS_FAILED                -0x3100  /*< Reading of the DHM parameters failed. */ | ||||
| #define MBEDTLS_ERR_DHM_MAKE_PARAMS_FAILED                -0x3180  /*< Making of the DHM parameters failed. */ | ||||
| #define MBEDTLS_ERR_DHM_READ_PUBLIC_FAILED                -0x3200  /*< Reading of the public values failed. */ | ||||
| #define MBEDTLS_ERR_DHM_MAKE_PUBLIC_FAILED                -0x3280  /*< Making of the public value failed. */ | ||||
| #define MBEDTLS_ERR_DHM_CALC_SECRET_FAILED                -0x3300  /*< Calculation of the DHM secret failed. */ | ||||
| #define MBEDTLS_ERR_DHM_INVALID_FORMAT                    -0x3380  /*< The ASN.1 data is not formatted correctly. */ | ||||
| #define MBEDTLS_ERR_DHM_ALLOC_FAILED                      -0x3400  /*< Allocation of memory failed. */ | ||||
| #define MBEDTLS_ERR_DHM_FILE_IO_ERROR                     -0x3480  /*< Read or write of file failed. */ | ||||
| 
 | ||||
| /* MBEDTLS_ERR_DHM_HW_ACCEL_FAILED is deprecated and should not be used. */ | ||||
| #define MBEDTLS_ERR_DHM_HW_ACCEL_FAILED                   -0x3500  /**< DHM hardware accelerator failed. */ | ||||
| #define MBEDTLS_ERR_DHM_HW_ACCEL_FAILED                   -0x3500  /*< DHM hardware accelerator failed. */ | ||||
| 
 | ||||
| #define MBEDTLS_ERR_DHM_SET_GROUP_FAILED                  -0x3580  /**< Setting the modulus and generator failed. */ | ||||
| #define MBEDTLS_ERR_DHM_SET_GROUP_FAILED                  -0x3580  /*< Setting the modulus and generator failed. */ | ||||
| 
 | ||||
| #ifdef __cplusplus | ||||
| extern "C" { | ||||
|  |  | |||
							
								
								
									
										4
									
								
								third_party/mbedtls/ecdh.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								third_party/mbedtls/ecdh.h
									
										
									
									
										vendored
									
									
								
							|  | @ -14,8 +14,8 @@ extern "C" { | |||
|  */ | ||||
| typedef enum | ||||
| { | ||||
|     MBEDTLS_ECDH_OURS,   /**< Our key. */ | ||||
|     MBEDTLS_ECDH_THEIRS, /**< The key of the peer. */ | ||||
|     MBEDTLS_ECDH_OURS,   /*< Our key. */ | ||||
|     MBEDTLS_ECDH_THEIRS, /*< The key of the peer. */ | ||||
| } mbedtls_ecdh_side; | ||||
| 
 | ||||
| #if !defined(MBEDTLS_ECDH_LEGACY_CONTEXT) | ||||
|  |  | |||
							
								
								
									
										32
									
								
								third_party/mbedtls/ecp.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										32
									
								
								third_party/mbedtls/ecp.h
									
										
									
									
										vendored
									
									
								
							|  | @ -6,16 +6,16 @@ | |||
| COSMOPOLITAN_C_START_ | ||||
| /* clang-format off */ | ||||
| 
 | ||||
| #define MBEDTLS_ERR_ECP_BAD_INPUT_DATA                    -0x4F80  /**< Bad input parameters to function. */ | ||||
| #define MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL                  -0x4F00  /**< The buffer is too small to write to. */ | ||||
| #define MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE               -0x4E80  /**< The requested feature is not available, for example, the requested curve is not supported. */ | ||||
| #define MBEDTLS_ERR_ECP_VERIFY_FAILED                     -0x4E00  /**< The signature is not valid. */ | ||||
| #define MBEDTLS_ERR_ECP_ALLOC_FAILED                      -0x4D80  /**< Memory allocation failed. */ | ||||
| #define MBEDTLS_ERR_ECP_RANDOM_FAILED                     -0x4D00  /**< Generation of random value, such as ephemeral key, failed. */ | ||||
| #define MBEDTLS_ERR_ECP_INVALID_KEY                       -0x4C80  /**< Invalid private or public key. */ | ||||
| #define MBEDTLS_ERR_ECP_SIG_LEN_MISMATCH                  -0x4C00  /**< The buffer contains a valid signature followed by more data. */ | ||||
| #define MBEDTLS_ERR_ECP_HW_ACCEL_FAILED                   -0x4B80  /**< The ECP hardware accelerator failed. */ | ||||
| #define MBEDTLS_ERR_ECP_IN_PROGRESS                       -0x4B00  /**< Operation in progress, call again with the same parameters to continue. */ | ||||
| #define MBEDTLS_ERR_ECP_BAD_INPUT_DATA                    -0x4F80  /*< Bad input parameters to function. */ | ||||
| #define MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL                  -0x4F00  /*< The buffer is too small to write to. */ | ||||
| #define MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE               -0x4E80  /*< The requested feature is not available, for example, the requested curve is not supported. */ | ||||
| #define MBEDTLS_ERR_ECP_VERIFY_FAILED                     -0x4E00  /*< The signature is not valid. */ | ||||
| #define MBEDTLS_ERR_ECP_ALLOC_FAILED                      -0x4D80  /*< Memory allocation failed. */ | ||||
| #define MBEDTLS_ERR_ECP_RANDOM_FAILED                     -0x4D00  /*< Generation of random value, such as ephemeral key, failed. */ | ||||
| #define MBEDTLS_ERR_ECP_INVALID_KEY                       -0x4C80  /*< Invalid private or public key. */ | ||||
| #define MBEDTLS_ERR_ECP_SIG_LEN_MISMATCH                  -0x4C00  /*< The buffer contains a valid signature followed by more data. */ | ||||
| #define MBEDTLS_ERR_ECP_HW_ACCEL_FAILED                   -0x4B80  /*< The ECP hardware accelerator failed. */ | ||||
| #define MBEDTLS_ERR_ECP_IN_PROGRESS                       -0x4B00  /*< Operation in progress, call again with the same parameters to continue. */ | ||||
| 
 | ||||
| /**
 | ||||
|  * Domain-parameter identifiers: curve, subgroup, and generator. | ||||
|  | @ -65,9 +65,9 @@ typedef enum | |||
|  */ | ||||
| #define MBEDTLS_ECP_DP_MAX     12 | ||||
| 
 | ||||
| #define MBEDTLS_ECP_PF_UNCOMPRESSED    0   /**< Uncompressed point format (RFC4492) */ | ||||
| #define MBEDTLS_ECP_PF_COMPRESSED      1   /**< Compressed point format (RFC4492) */ | ||||
| #define MBEDTLS_ECP_TLS_NAMED_CURVE    3   /**< The named_curve of ECCurveType (RFC4492) */ | ||||
| #define MBEDTLS_ECP_PF_UNCOMPRESSED    0   /*< Uncompressed point format (RFC4492) */ | ||||
| #define MBEDTLS_ECP_PF_COMPRESSED      1   /*< Compressed point format (RFC4492) */ | ||||
| #define MBEDTLS_ECP_TLS_NAMED_CURVE    3   /*< The named_curve of ECCurveType (RFC4492) */ | ||||
| 
 | ||||
| /*
 | ||||
|  * Curve types | ||||
|  | @ -187,7 +187,7 @@ mbedtls_ecp_group; | |||
| /**
 | ||||
|  * The maximum size of the groups, that is, of \c N and \c P. | ||||
|  */ | ||||
| #define MBEDTLS_ECP_MAX_BITS     521   /**< The maximum size of groups, in bits. */ | ||||
| #define MBEDTLS_ECP_MAX_BITS     521   /*< The maximum size of groups, in bits. */ | ||||
| #endif | ||||
| 
 | ||||
| #define MBEDTLS_ECP_MAX_BYTES    ( ( MBEDTLS_ECP_MAX_BITS + 7 ) / 8 ) | ||||
|  | @ -213,7 +213,7 @@ mbedtls_ecp_group; | |||
|  *      224       475     475     453     398     342 | ||||
|  *      192       640     640     633     587     476 | ||||
|  */ | ||||
| #define MBEDTLS_ECP_WINDOW_SIZE    6   /**< The maximum window size used. */ | ||||
| #define MBEDTLS_ECP_WINDOW_SIZE    6   /*< The maximum window size used. */ | ||||
| #endif /* MBEDTLS_ECP_WINDOW_SIZE */ | ||||
| 
 | ||||
| #if !defined(MBEDTLS_ECP_FIXED_POINT_OPTIM) | ||||
|  | @ -228,7 +228,7 @@ mbedtls_ecp_group; | |||
|  * | ||||
|  * Change this value to 0 to reduce peak memory usage. | ||||
|  */ | ||||
| #define MBEDTLS_ECP_FIXED_POINT_OPTIM  1   /**< Enable fixed-point speed-up. */ | ||||
| #define MBEDTLS_ECP_FIXED_POINT_OPTIM  1   /*< Enable fixed-point speed-up. */ | ||||
| #endif /* MBEDTLS_ECP_FIXED_POINT_OPTIM */ | ||||
| 
 | ||||
| /* \} name SECTION: Module settings */ | ||||
|  |  | |||
							
								
								
									
										2
									
								
								third_party/mbedtls/entropy.c
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								third_party/mbedtls/entropy.c
									
										
									
									
										vendored
									
									
								
							|  | @ -57,7 +57,7 @@ asm(".include \"libc/disclaimer.inc\""); | |||
| #warning "**** THIS BUILD IS *NOT* SUITABLE FOR PRODUCTION USE " | ||||
| #endif | ||||
| 
 | ||||
| #define ENTROPY_MAX_LOOP    256     /**< Maximum amount to loop before error */ | ||||
| #define ENTROPY_MAX_LOOP    256     /*< Maximum amount to loop before error */ | ||||
| 
 | ||||
| /**
 | ||||
|  * \brief           Initialize the context | ||||
|  |  | |||
							
								
								
									
										34
									
								
								third_party/mbedtls/entropy.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										34
									
								
								third_party/mbedtls/entropy.h
									
										
									
									
										vendored
									
									
								
							|  | @ -14,31 +14,31 @@ COSMOPOLITAN_C_START_ | |||
| #endif | ||||
| #endif | ||||
| 
 | ||||
| #define MBEDTLS_ERR_ENTROPY_SOURCE_FAILED                 -0x003C  /**< Critical entropy source failure. */ | ||||
| #define MBEDTLS_ERR_ENTROPY_MAX_SOURCES                   -0x003E  /**< No more sources can be added. */ | ||||
| #define MBEDTLS_ERR_ENTROPY_NO_SOURCES_DEFINED            -0x0040  /**< No sources have been added to poll. */ | ||||
| #define MBEDTLS_ERR_ENTROPY_NO_STRONG_SOURCE              -0x003D  /**< No strong sources have been added to poll. */ | ||||
| #define MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR                 -0x003F  /**< Read/write error in file. */ | ||||
| #define MBEDTLS_ERR_ENTROPY_SOURCE_FAILED                 -0x003C  /*< Critical entropy source failure. */ | ||||
| #define MBEDTLS_ERR_ENTROPY_MAX_SOURCES                   -0x003E  /*< No more sources can be added. */ | ||||
| #define MBEDTLS_ERR_ENTROPY_NO_SOURCES_DEFINED            -0x0040  /*< No sources have been added to poll. */ | ||||
| #define MBEDTLS_ERR_ENTROPY_NO_STRONG_SOURCE              -0x003D  /*< No strong sources have been added to poll. */ | ||||
| #define MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR                 -0x003F  /*< Read/write error in file. */ | ||||
| 
 | ||||
| #if !defined(MBEDTLS_ENTROPY_MAX_SOURCES) | ||||
| #define MBEDTLS_ENTROPY_MAX_SOURCES     20      /**< Maximum number of sources supported */ | ||||
| #define MBEDTLS_ENTROPY_MAX_SOURCES     20      /*< Maximum number of sources supported */ | ||||
| #endif | ||||
| 
 | ||||
| #if !defined(MBEDTLS_ENTROPY_MAX_GATHER) | ||||
| #define MBEDTLS_ENTROPY_MAX_GATHER      128     /**< Maximum amount requested from entropy sources */ | ||||
| #define MBEDTLS_ENTROPY_MAX_GATHER      128     /*< Maximum amount requested from entropy sources */ | ||||
| #endif | ||||
| 
 | ||||
| #if defined(MBEDTLS_ENTROPY_SHA512_ACCUMULATOR) | ||||
| #define MBEDTLS_ENTROPY_BLOCK_SIZE      64      /**< Block size of entropy accumulator (SHA-512) */ | ||||
| #define MBEDTLS_ENTROPY_BLOCK_SIZE      64      /*< Block size of entropy accumulator (SHA-512) */ | ||||
| #else | ||||
| #define MBEDTLS_ENTROPY_BLOCK_SIZE      32      /**< Block size of entropy accumulator (SHA-256) */ | ||||
| #define MBEDTLS_ENTROPY_BLOCK_SIZE      32      /*< Block size of entropy accumulator (SHA-256) */ | ||||
| #endif | ||||
| 
 | ||||
| #define MBEDTLS_ENTROPY_MAX_SEED_SIZE   1024    /**< Maximum size of seed we read from seed file */ | ||||
| #define MBEDTLS_ENTROPY_MAX_SEED_SIZE   1024    /*< Maximum size of seed we read from seed file */ | ||||
| #define MBEDTLS_ENTROPY_SOURCE_MANUAL   MBEDTLS_ENTROPY_MAX_SOURCES | ||||
| 
 | ||||
| #define MBEDTLS_ENTROPY_SOURCE_STRONG   1       /**< Entropy source is strong   */ | ||||
| #define MBEDTLS_ENTROPY_SOURCE_WEAK     0       /**< Entropy source is weak     */ | ||||
| #define MBEDTLS_ENTROPY_SOURCE_STRONG   1       /*< Entropy source is strong   */ | ||||
| #define MBEDTLS_ENTROPY_SOURCE_WEAK     0       /*< Entropy source is weak     */ | ||||
| 
 | ||||
| /**
 | ||||
|  * \brief           Entropy poll callback pointer | ||||
|  | @ -58,11 +58,11 @@ typedef int (*mbedtls_entropy_f_source_ptr)(void *data, unsigned char *output, s | |||
|  */ | ||||
| typedef struct mbedtls_entropy_source_state | ||||
| { | ||||
|     mbedtls_entropy_f_source_ptr    f_source;   /**< The entropy source callback */ | ||||
|     void *          p_source;   /**< The callback data pointer */ | ||||
|     size_t          size;       /**< Amount received in bytes */ | ||||
|     size_t          threshold;  /**< Minimum bytes required before release */ | ||||
|     int             strong;     /**< Is the source strong? */ | ||||
|     mbedtls_entropy_f_source_ptr    f_source;   /*< The entropy source callback */ | ||||
|     void *          p_source;   /*< The callback data pointer */ | ||||
|     size_t          size;       /*< Amount received in bytes */ | ||||
|     size_t          threshold;  /*< Minimum bytes required before release */ | ||||
|     int             strong;     /*< Is the source strong? */ | ||||
| } | ||||
| mbedtls_entropy_source_state; | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										6
									
								
								third_party/mbedtls/entropy_poll.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								third_party/mbedtls/entropy_poll.h
									
										
									
									
										vendored
									
									
								
							|  | @ -9,7 +9,7 @@ int mbedtls_hardware_poll(void *, unsigned char *, size_t, size_t *); | |||
| 
 | ||||
| COSMOPOLITAN_C_END_ | ||||
| /* clang-format off */ | ||||
| #define MBEDTLS_ENTROPY_MIN_PLATFORM     32     /**< Minimum for platform source    */ | ||||
| #define MBEDTLS_ENTROPY_MIN_HARDCLOCK     4     /**< Minimum for mbedtls_timing_hardclock()        */ | ||||
| #define MBEDTLS_ENTROPY_MIN_HARDWARE     32     /**< Minimum for the hardware source */ | ||||
| #define MBEDTLS_ENTROPY_MIN_PLATFORM     32     /*< Minimum for platform source    */ | ||||
| #define MBEDTLS_ENTROPY_MIN_HARDCLOCK     4     /*< Minimum for mbedtls_timing_hardclock()        */ | ||||
| #define MBEDTLS_ENTROPY_MIN_HARDWARE     32     /*< Minimum for the hardware source */ | ||||
| #endif /* COSMOPOLITAN_THIRD_PARTY_MBEDTLS_ENTROPY_POLL_H_ */ | ||||
|  |  | |||
							
								
								
									
										4
									
								
								third_party/mbedtls/error.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								third_party/mbedtls/error.h
									
										
									
									
										vendored
									
									
								
							|  | @ -84,8 +84,8 @@ | |||
| extern "C" { | ||||
| #endif | ||||
| 
 | ||||
| #define MBEDTLS_ERR_ERROR_GENERIC_ERROR       -0x0001  /**< Generic error */ | ||||
| #define MBEDTLS_ERR_THIS_CORRUPTION -0x006E  /**< This is a bug in the library */ | ||||
| #define MBEDTLS_ERR_ERROR_GENERIC_ERROR       -0x0001  /*< Generic error */ | ||||
| #define MBEDTLS_ERR_THIS_CORRUPTION -0x006E  /*< This is a bug in the library */ | ||||
| 
 | ||||
| /**
 | ||||
|  * \brief Translate a mbed TLS error code into a string representation, | ||||
|  |  | |||
							
								
								
									
										4
									
								
								third_party/mbedtls/gcm.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								third_party/mbedtls/gcm.h
									
										
									
									
										vendored
									
									
								
							|  | @ -8,8 +8,8 @@ COSMOPOLITAN_C_START_ | |||
| #define MBEDTLS_GCM_ENCRYPT     1 | ||||
| #define MBEDTLS_GCM_DECRYPT     0 | ||||
| 
 | ||||
| #define MBEDTLS_ERR_GCM_AUTH_FAILED                       -0x0012  /**< Authenticated decryption failed. */ | ||||
| #define MBEDTLS_ERR_GCM_BAD_INPUT                         -0x0014  /**< Bad input parameters to function. */ | ||||
| #define MBEDTLS_ERR_GCM_AUTH_FAILED                       -0x0012  /*< Authenticated decryption failed. */ | ||||
| #define MBEDTLS_ERR_GCM_BAD_INPUT                         -0x0014  /*< Bad input parameters to function. */ | ||||
| 
 | ||||
| typedef struct mbedtls_gcm_context { | ||||
|     mbedtls_cipher_context_t cipher_ctx;  /*!< The cipher context used. */ | ||||
|  |  | |||
							
								
								
									
										2
									
								
								third_party/mbedtls/getalertdescription.c
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								third_party/mbedtls/getalertdescription.c
									
										
									
									
										vendored
									
									
								
							|  | @ -77,7 +77,7 @@ const char *GetAlertDescription(unsigned char x) { | |||
|     case MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_EXT: /* 110 */ | ||||
|       return "unsupported_extension"; | ||||
|     default: | ||||
|       int64toarray_radix10(x, buf); | ||||
|       FormatUint32(buf, x); | ||||
|       return buf; | ||||
|   } | ||||
| } | ||||
|  |  | |||
							
								
								
									
										2
									
								
								third_party/mbedtls/hkdf.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								third_party/mbedtls/hkdf.h
									
										
									
									
										vendored
									
									
								
							|  | @ -6,7 +6,7 @@ | |||
| COSMOPOLITAN_C_START_ | ||||
| 
 | ||||
| /* clang-format off */ | ||||
| #define MBEDTLS_ERR_HKDF_BAD_INPUT_DATA  -0x5F80  /**< Bad input parameters to function. */ | ||||
| #define MBEDTLS_ERR_HKDF_BAD_INPUT_DATA  -0x5F80  /*< Bad input parameters to function. */ | ||||
| /* clang-format on */ | ||||
| 
 | ||||
| int mbedtls_hkdf(const mbedtls_md_info_t *, const unsigned char *, size_t, | ||||
|  |  | |||
							
								
								
									
										20
									
								
								third_party/mbedtls/hmac_drbg.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										20
									
								
								third_party/mbedtls/hmac_drbg.h
									
										
									
									
										vendored
									
									
								
							|  | @ -5,29 +5,29 @@ | |||
| COSMOPOLITAN_C_START_ | ||||
| /* clang-format off */ | ||||
| 
 | ||||
| #define MBEDTLS_ERR_HMAC_DRBG_REQUEST_TOO_BIG              -0x0003  /**< Too many random requested in single call. */ | ||||
| #define MBEDTLS_ERR_HMAC_DRBG_INPUT_TOO_BIG                -0x0005  /**< Input too large (Entropy + additional). */ | ||||
| #define MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR                -0x0007  /**< Read/write error in file. */ | ||||
| #define MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED        -0x0009  /**< The entropy source failed. */ | ||||
| #define MBEDTLS_ERR_HMAC_DRBG_REQUEST_TOO_BIG              -0x0003  /*< Too many random requested in single call. */ | ||||
| #define MBEDTLS_ERR_HMAC_DRBG_INPUT_TOO_BIG                -0x0005  /*< Input too large (Entropy + additional). */ | ||||
| #define MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR                -0x0007  /*< Read/write error in file. */ | ||||
| #define MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED        -0x0009  /*< The entropy source failed. */ | ||||
| 
 | ||||
| #if !defined(MBEDTLS_HMAC_DRBG_RESEED_INTERVAL) | ||||
| #define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL   10000   /**< Interval before reseed is performed by default */ | ||||
| #define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL   10000   /*< Interval before reseed is performed by default */ | ||||
| #endif | ||||
| 
 | ||||
| #if !defined(MBEDTLS_HMAC_DRBG_MAX_INPUT) | ||||
| #define MBEDTLS_HMAC_DRBG_MAX_INPUT         256     /**< Maximum number of additional input bytes */ | ||||
| #define MBEDTLS_HMAC_DRBG_MAX_INPUT         256     /*< Maximum number of additional input bytes */ | ||||
| #endif | ||||
| 
 | ||||
| #if !defined(MBEDTLS_HMAC_DRBG_MAX_REQUEST) | ||||
| #define MBEDTLS_HMAC_DRBG_MAX_REQUEST       1024    /**< Maximum number of requested bytes per call */ | ||||
| #define MBEDTLS_HMAC_DRBG_MAX_REQUEST       1024    /*< Maximum number of requested bytes per call */ | ||||
| #endif | ||||
| 
 | ||||
| #if !defined(MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT) | ||||
| #define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT    384     /**< Maximum size of (re)seed buffer */ | ||||
| #define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT    384     /*< Maximum size of (re)seed buffer */ | ||||
| #endif | ||||
| 
 | ||||
| #define MBEDTLS_HMAC_DRBG_PR_OFF   0   /**< No prediction resistance       */ | ||||
| #define MBEDTLS_HMAC_DRBG_PR_ON    1   /**< Prediction resistance enabled  */ | ||||
| #define MBEDTLS_HMAC_DRBG_PR_OFF   0   /*< No prediction resistance       */ | ||||
| #define MBEDTLS_HMAC_DRBG_PR_ON    1   /*< Prediction resistance enabled  */ | ||||
| 
 | ||||
| typedef struct mbedtls_hmac_drbg_context | ||||
| { | ||||
|  |  | |||
							
								
								
									
										32
									
								
								third_party/mbedtls/md.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										32
									
								
								third_party/mbedtls/md.h
									
										
									
									
										vendored
									
									
								
							|  | @ -4,13 +4,13 @@ | |||
| COSMOPOLITAN_C_START_ | ||||
| /* clang-format off */ | ||||
| 
 | ||||
| #define MBEDTLS_ERR_MD_FEATURE_UNAVAILABLE                -0x5080  /**< The selected feature is not available. */ | ||||
| #define MBEDTLS_ERR_MD_BAD_INPUT_DATA                     -0x5100  /**< Bad input parameters to function. */ | ||||
| #define MBEDTLS_ERR_MD_ALLOC_FAILED                       -0x5180  /**< Failed to allocate memory. */ | ||||
| #define MBEDTLS_ERR_MD_FILE_IO_ERROR                      -0x5200  /**< Opening or reading of file failed. */ | ||||
| #define MBEDTLS_ERR_MD_FEATURE_UNAVAILABLE                -0x5080  /*< The selected feature is not available. */ | ||||
| #define MBEDTLS_ERR_MD_BAD_INPUT_DATA                     -0x5100  /*< Bad input parameters to function. */ | ||||
| #define MBEDTLS_ERR_MD_ALLOC_FAILED                       -0x5180  /*< Failed to allocate memory. */ | ||||
| #define MBEDTLS_ERR_MD_FILE_IO_ERROR                      -0x5200  /*< Opening or reading of file failed. */ | ||||
| 
 | ||||
| /* MBEDTLS_ERR_MD_HW_ACCEL_FAILED is deprecated and should not be used. */ | ||||
| #define MBEDTLS_ERR_MD_HW_ACCEL_FAILED                    -0x5280  /**< MD hardware accelerator failed. */ | ||||
| #define MBEDTLS_ERR_MD_HW_ACCEL_FAILED                    -0x5280  /*< MD hardware accelerator failed. */ | ||||
| 
 | ||||
| /**
 | ||||
|  * \brief     Supported message digests. | ||||
|  | @ -20,17 +20,17 @@ COSMOPOLITAN_C_START_ | |||
|  *            stronger message digests instead. | ||||
|  */ | ||||
| typedef enum { | ||||
|     MBEDTLS_MD_NONE=0,     /**< None. */ | ||||
|     MBEDTLS_MD_SHA1,       /**< The SHA-1 message digest. */ | ||||
|     MBEDTLS_MD_SHA224,     /**< The SHA-224 message digest. */ | ||||
|     MBEDTLS_MD_SHA256,     /**< The SHA-256 message digest. */ | ||||
|     MBEDTLS_MD_SHA384,     /**< The SHA-384 message digest. */ | ||||
|     MBEDTLS_MD_SHA512,     /**< The SHA-512 message digest. */ | ||||
|     MBEDTLS_MD_BLAKE2B256, /**< The BLAKE2B256 message digest. */ | ||||
|     MBEDTLS_MD_RIPEMD160,  /**< The RIPEMD-160 message digest. */ | ||||
|     MBEDTLS_MD_MD2,        /**< The MD2 message digest. */ | ||||
|     MBEDTLS_MD_MD4,        /**< The MD4 message digest. */ | ||||
|     MBEDTLS_MD_MD5,        /**< The MD5 message digest. */ | ||||
|     MBEDTLS_MD_NONE=0,     /*< None. */ | ||||
|     MBEDTLS_MD_SHA1,       /*< The SHA-1 message digest. */ | ||||
|     MBEDTLS_MD_SHA224,     /*< The SHA-224 message digest. */ | ||||
|     MBEDTLS_MD_SHA256,     /*< The SHA-256 message digest. */ | ||||
|     MBEDTLS_MD_SHA384,     /*< The SHA-384 message digest. */ | ||||
|     MBEDTLS_MD_SHA512,     /*< The SHA-512 message digest. */ | ||||
|     MBEDTLS_MD_BLAKE2B256, /*< The BLAKE2B256 message digest. */ | ||||
|     MBEDTLS_MD_RIPEMD160,  /*< The RIPEMD-160 message digest. */ | ||||
|     MBEDTLS_MD_MD2,        /*< The MD2 message digest. */ | ||||
|     MBEDTLS_MD_MD4,        /*< The MD4 message digest. */ | ||||
|     MBEDTLS_MD_MD5,        /*< The MD5 message digest. */ | ||||
| } mbedtls_md_type_t; | ||||
| 
 | ||||
| #if defined(MBEDTLS_SHA512_C) | ||||
|  |  | |||
							
								
								
									
										2
									
								
								third_party/mbedtls/md5.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								third_party/mbedtls/md5.h
									
										
									
									
										vendored
									
									
								
							|  | @ -5,7 +5,7 @@ | |||
| COSMOPOLITAN_C_START_ | ||||
| /* clang-format off */ | ||||
| 
 | ||||
| #define MBEDTLS_ERR_MD5_HW_ACCEL_FAILED -0x002F  /**< MD5 hardware accelerator failed */ | ||||
| #define MBEDTLS_ERR_MD5_HW_ACCEL_FAILED -0x002F  /*< MD5 hardware accelerator failed */ | ||||
| 
 | ||||
| /**
 | ||||
|  * \brief          MD5 context structure | ||||
|  |  | |||
							
								
								
									
										2
									
								
								third_party/mbedtls/memory_buffer_alloc.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								third_party/mbedtls/memory_buffer_alloc.h
									
										
									
									
										vendored
									
									
								
							|  | @ -12,7 +12,7 @@ | |||
|  */ | ||||
| 
 | ||||
| #if !defined(MBEDTLS_MEMORY_ALIGN_MULTIPLE) | ||||
| #define MBEDTLS_MEMORY_ALIGN_MULTIPLE       4 /**< Align on multiples of this value */ | ||||
| #define MBEDTLS_MEMORY_ALIGN_MULTIPLE       4 /*< Align on multiples of this value */ | ||||
| #endif | ||||
| 
 | ||||
| /* \} name SECTION: Module settings */ | ||||
|  |  | |||
							
								
								
									
										38
									
								
								third_party/mbedtls/net_sockets.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										38
									
								
								third_party/mbedtls/net_sockets.h
									
										
									
									
										vendored
									
									
								
							|  | @ -4,27 +4,27 @@ | |||
| COSMOPOLITAN_C_START_ | ||||
| /* clang-format off */ | ||||
| 
 | ||||
| #define MBEDTLS_ERR_NET_SOCKET_FAILED                     -0x0042  /**< Failed to open a socket. */ | ||||
| #define MBEDTLS_ERR_NET_CONNECT_FAILED                    -0x0044  /**< The connection to the given server / port failed. */ | ||||
| #define MBEDTLS_ERR_NET_BIND_FAILED                       -0x0046  /**< Binding of the socket failed. */ | ||||
| #define MBEDTLS_ERR_NET_LISTEN_FAILED                     -0x0048  /**< Could not listen on the socket. */ | ||||
| #define MBEDTLS_ERR_NET_ACCEPT_FAILED                     -0x004A  /**< Could not accept the incoming connection. */ | ||||
| #define MBEDTLS_ERR_NET_RECV_FAILED                       -0x004C  /**< Reading information from the socket failed. */ | ||||
| #define MBEDTLS_ERR_NET_SEND_FAILED                       -0x004E  /**< Sending information through the socket failed. */ | ||||
| #define MBEDTLS_ERR_NET_CONN_RESET                        -0x0050  /**< Connection was reset by peer. */ | ||||
| #define MBEDTLS_ERR_NET_UNKNOWN_HOST                      -0x0052  /**< Failed to get an IP address for the given hostname. */ | ||||
| #define MBEDTLS_ERR_NET_BUFFER_TOO_SMALL                  -0x0043  /**< Buffer is too small to hold the data. */ | ||||
| #define MBEDTLS_ERR_NET_INVALID_CONTEXT                   -0x0045  /**< The context is invalid, eg because it was free()ed. */ | ||||
| #define MBEDTLS_ERR_NET_POLL_FAILED                       -0x0047  /**< Polling the net context failed. */ | ||||
| #define MBEDTLS_ERR_NET_BAD_INPUT_DATA                    -0x0049  /**< Input invalid. */ | ||||
| #define MBEDTLS_ERR_NET_SOCKET_FAILED                     -0x0042  /*< Failed to open a socket. */ | ||||
| #define MBEDTLS_ERR_NET_CONNECT_FAILED                    -0x0044  /*< The connection to the given server / port failed. */ | ||||
| #define MBEDTLS_ERR_NET_BIND_FAILED                       -0x0046  /*< Binding of the socket failed. */ | ||||
| #define MBEDTLS_ERR_NET_LISTEN_FAILED                     -0x0048  /*< Could not listen on the socket. */ | ||||
| #define MBEDTLS_ERR_NET_ACCEPT_FAILED                     -0x004A  /*< Could not accept the incoming connection. */ | ||||
| #define MBEDTLS_ERR_NET_RECV_FAILED                       -0x004C  /*< Reading information from the socket failed. */ | ||||
| #define MBEDTLS_ERR_NET_SEND_FAILED                       -0x004E  /*< Sending information through the socket failed. */ | ||||
| #define MBEDTLS_ERR_NET_CONN_RESET                        -0x0050  /*< Connection was reset by peer. */ | ||||
| #define MBEDTLS_ERR_NET_UNKNOWN_HOST                      -0x0052  /*< Failed to get an IP address for the given hostname. */ | ||||
| #define MBEDTLS_ERR_NET_BUFFER_TOO_SMALL                  -0x0043  /*< Buffer is too small to hold the data. */ | ||||
| #define MBEDTLS_ERR_NET_INVALID_CONTEXT                   -0x0045  /*< The context is invalid, eg because it was free()ed. */ | ||||
| #define MBEDTLS_ERR_NET_POLL_FAILED                       -0x0047  /*< Polling the net context failed. */ | ||||
| #define MBEDTLS_ERR_NET_BAD_INPUT_DATA                    -0x0049  /*< Input invalid. */ | ||||
| 
 | ||||
| #define MBEDTLS_NET_LISTEN_BACKLOG         10                      /**< The backlog that listen() should use. */ | ||||
| #define MBEDTLS_NET_LISTEN_BACKLOG         10                      /*< The backlog that listen() should use. */ | ||||
| 
 | ||||
| #define MBEDTLS_NET_PROTO_TCP 0                                    /**< The TCP transport protocol */ | ||||
| #define MBEDTLS_NET_PROTO_UDP 1                                    /**< The UDP transport protocol */ | ||||
| #define MBEDTLS_NET_PROTO_TCP 0                                    /*< The TCP transport protocol */ | ||||
| #define MBEDTLS_NET_PROTO_UDP 1                                    /*< The UDP transport protocol */ | ||||
| 
 | ||||
| #define MBEDTLS_NET_POLL_READ  1                                   /**< Used in \c mbedtls_net_poll to check for pending data  */ | ||||
| #define MBEDTLS_NET_POLL_WRITE 2                                   /**< Used in \c mbedtls_net_poll to check if write possible */ | ||||
| #define MBEDTLS_NET_POLL_READ  1                                   /*< Used in \c mbedtls_net_poll to check for pending data  */ | ||||
| #define MBEDTLS_NET_POLL_WRITE 2                                   /*< Used in \c mbedtls_net_poll to check if write possible */ | ||||
| 
 | ||||
| /**
 | ||||
|  * Wrapper type for sockets. | ||||
|  | @ -35,7 +35,7 @@ COSMOPOLITAN_C_START_ | |||
|  */ | ||||
| typedef struct mbedtls_net_context | ||||
| { | ||||
|     int fd;             /**< The underlying file descriptor                 */ | ||||
|     int fd;             /*< The underlying file descriptor                 */ | ||||
| } | ||||
| mbedtls_net_context; | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										194
									
								
								third_party/mbedtls/oid.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										194
									
								
								third_party/mbedtls/oid.h
									
										
									
									
										vendored
									
									
								
							|  | @ -7,8 +7,8 @@ | |||
| #include "third_party/mbedtls/pk.h" | ||||
| /* clang-format off */ | ||||
| 
 | ||||
| #define MBEDTLS_ERR_OID_NOT_FOUND                         -0x002E  /**< OID is not found. */ | ||||
| #define MBEDTLS_ERR_OID_BUF_TOO_SMALL                     -0x000B  /**< output buffer is too small */ | ||||
| #define MBEDTLS_ERR_OID_NOT_FOUND                         -0x002E  /*< OID is not found. */ | ||||
| #define MBEDTLS_ERR_OID_BUF_TOO_SMALL                     -0x000B  /*< output buffer is too small */ | ||||
| 
 | ||||
| /* This is for the benefit of X.509, but defined here in order to avoid
 | ||||
|  * having a "backwards" include of x.509.h here */ | ||||
|  | @ -77,7 +77,7 @@ | |||
| #define MBEDTLS_OID_NETSCAPE                    MBEDTLS_OID_ISO_ITU_US_ORG MBEDTLS_OID_ORG_NETSCAPE /* Netscape OID {joint-iso-itu-t(2) country(16) us(840) organization(1) netscape(113730)} */ | ||||
| 
 | ||||
| /* ISO arc for standard certificate and CRL extensions */ | ||||
| #define MBEDTLS_OID_ID_CE                       MBEDTLS_OID_ISO_CCITT_DS "\x1D" /**< id-ce OBJECT IDENTIFIER  ::=  {joint-iso-ccitt(2) ds(5) 29} */ | ||||
| #define MBEDTLS_OID_ID_CE                       MBEDTLS_OID_ISO_CCITT_DS "\x1D" /*< id-ce OBJECT IDENTIFIER  ::=  {joint-iso-ccitt(2) ds(5) 29} */ | ||||
| 
 | ||||
| #define MBEDTLS_OID_NIST_ALG                    MBEDTLS_OID_GOV "\x03\x04" /** { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistAlgorithm(4) */ | ||||
| 
 | ||||
|  | @ -92,50 +92,50 @@ | |||
| /*
 | ||||
|  * Arc for standard naming attributes | ||||
|  */ | ||||
| #define MBEDTLS_OID_AT                          MBEDTLS_OID_ISO_CCITT_DS "\x04" /**< id-at OBJECT IDENTIFIER ::= {joint-iso-ccitt(2) ds(5) 4} */ | ||||
| #define MBEDTLS_OID_AT_CN                       MBEDTLS_OID_AT "\x03" /**< id-at-commonName AttributeType:= {id-at 3} */ | ||||
| #define MBEDTLS_OID_AT_SUR_NAME                 MBEDTLS_OID_AT "\x04" /**< id-at-surName AttributeType:= {id-at 4} */ | ||||
| #define MBEDTLS_OID_AT_SERIAL_NUMBER            MBEDTLS_OID_AT "\x05" /**< id-at-serialNumber AttributeType:= {id-at 5} */ | ||||
| #define MBEDTLS_OID_AT_COUNTRY                  MBEDTLS_OID_AT "\x06" /**< id-at-countryName AttributeType:= {id-at 6} */ | ||||
| #define MBEDTLS_OID_AT_LOCALITY                 MBEDTLS_OID_AT "\x07" /**< id-at-locality AttributeType:= {id-at 7} */ | ||||
| #define MBEDTLS_OID_AT_STATE                    MBEDTLS_OID_AT "\x08" /**< id-at-state AttributeType:= {id-at 8} */ | ||||
| #define MBEDTLS_OID_AT_ORGANIZATION             MBEDTLS_OID_AT "\x0A" /**< id-at-organizationName AttributeType:= {id-at 10} */ | ||||
| #define MBEDTLS_OID_AT_ORG_UNIT                 MBEDTLS_OID_AT "\x0B" /**< id-at-organizationalUnitName AttributeType:= {id-at 11} */ | ||||
| #define MBEDTLS_OID_AT_TITLE                    MBEDTLS_OID_AT "\x0C" /**< id-at-title AttributeType:= {id-at 12} */ | ||||
| #define MBEDTLS_OID_AT_POSTAL_ADDRESS           MBEDTLS_OID_AT "\x10" /**< id-at-postalAddress AttributeType:= {id-at 16} */ | ||||
| #define MBEDTLS_OID_AT_POSTAL_CODE              MBEDTLS_OID_AT "\x11" /**< id-at-postalCode AttributeType:= {id-at 17} */ | ||||
| #define MBEDTLS_OID_AT_GIVEN_NAME               MBEDTLS_OID_AT "\x2A" /**< id-at-givenName AttributeType:= {id-at 42} */ | ||||
| #define MBEDTLS_OID_AT_INITIALS                 MBEDTLS_OID_AT "\x2B" /**< id-at-initials AttributeType:= {id-at 43} */ | ||||
| #define MBEDTLS_OID_AT_GENERATION_QUALIFIER     MBEDTLS_OID_AT "\x2C" /**< id-at-generationQualifier AttributeType:= {id-at 44} */ | ||||
| #define MBEDTLS_OID_AT_UNIQUE_IDENTIFIER        MBEDTLS_OID_AT "\x2D" /**< id-at-uniqueIdentifier AttributType:= {id-at 45} */ | ||||
| #define MBEDTLS_OID_AT_DN_QUALIFIER             MBEDTLS_OID_AT "\x2E" /**< id-at-dnQualifier AttributeType:= {id-at 46} */ | ||||
| #define MBEDTLS_OID_AT_PSEUDONYM                MBEDTLS_OID_AT "\x41" /**< id-at-pseudonym AttributeType:= {id-at 65} */ | ||||
| #define MBEDTLS_OID_AT                          MBEDTLS_OID_ISO_CCITT_DS "\x04" /*< id-at OBJECT IDENTIFIER ::= {joint-iso-ccitt(2) ds(5) 4} */ | ||||
| #define MBEDTLS_OID_AT_CN                       MBEDTLS_OID_AT "\x03" /*< id-at-commonName AttributeType:= {id-at 3} */ | ||||
| #define MBEDTLS_OID_AT_SUR_NAME                 MBEDTLS_OID_AT "\x04" /*< id-at-surName AttributeType:= {id-at 4} */ | ||||
| #define MBEDTLS_OID_AT_SERIAL_NUMBER            MBEDTLS_OID_AT "\x05" /*< id-at-serialNumber AttributeType:= {id-at 5} */ | ||||
| #define MBEDTLS_OID_AT_COUNTRY                  MBEDTLS_OID_AT "\x06" /*< id-at-countryName AttributeType:= {id-at 6} */ | ||||
| #define MBEDTLS_OID_AT_LOCALITY                 MBEDTLS_OID_AT "\x07" /*< id-at-locality AttributeType:= {id-at 7} */ | ||||
| #define MBEDTLS_OID_AT_STATE                    MBEDTLS_OID_AT "\x08" /*< id-at-state AttributeType:= {id-at 8} */ | ||||
| #define MBEDTLS_OID_AT_ORGANIZATION             MBEDTLS_OID_AT "\x0A" /*< id-at-organizationName AttributeType:= {id-at 10} */ | ||||
| #define MBEDTLS_OID_AT_ORG_UNIT                 MBEDTLS_OID_AT "\x0B" /*< id-at-organizationalUnitName AttributeType:= {id-at 11} */ | ||||
| #define MBEDTLS_OID_AT_TITLE                    MBEDTLS_OID_AT "\x0C" /*< id-at-title AttributeType:= {id-at 12} */ | ||||
| #define MBEDTLS_OID_AT_POSTAL_ADDRESS           MBEDTLS_OID_AT "\x10" /*< id-at-postalAddress AttributeType:= {id-at 16} */ | ||||
| #define MBEDTLS_OID_AT_POSTAL_CODE              MBEDTLS_OID_AT "\x11" /*< id-at-postalCode AttributeType:= {id-at 17} */ | ||||
| #define MBEDTLS_OID_AT_GIVEN_NAME               MBEDTLS_OID_AT "\x2A" /*< id-at-givenName AttributeType:= {id-at 42} */ | ||||
| #define MBEDTLS_OID_AT_INITIALS                 MBEDTLS_OID_AT "\x2B" /*< id-at-initials AttributeType:= {id-at 43} */ | ||||
| #define MBEDTLS_OID_AT_GENERATION_QUALIFIER     MBEDTLS_OID_AT "\x2C" /*< id-at-generationQualifier AttributeType:= {id-at 44} */ | ||||
| #define MBEDTLS_OID_AT_UNIQUE_IDENTIFIER        MBEDTLS_OID_AT "\x2D" /*< id-at-uniqueIdentifier AttributType:= {id-at 45} */ | ||||
| #define MBEDTLS_OID_AT_DN_QUALIFIER             MBEDTLS_OID_AT "\x2E" /*< id-at-dnQualifier AttributeType:= {id-at 46} */ | ||||
| #define MBEDTLS_OID_AT_PSEUDONYM                MBEDTLS_OID_AT "\x41" /*< id-at-pseudonym AttributeType:= {id-at 65} */ | ||||
| 
 | ||||
| #define MBEDTLS_OID_DOMAIN_COMPONENT            "\x09\x92\x26\x89\x93\xF2\x2C\x64\x01\x19" /** id-domainComponent AttributeType:= {itu-t(0) data(9) pss(2342) ucl(19200300) pilot(100) pilotAttributeType(1) domainComponent(25)} */ | ||||
| 
 | ||||
| /*
 | ||||
|  * OIDs for standard certificate extensions | ||||
|  */ | ||||
| #define MBEDTLS_OID_AUTHORITY_KEY_IDENTIFIER    MBEDTLS_OID_ID_CE "\x23" /**< id-ce-authorityKeyIdentifier OBJECT IDENTIFIER ::=  { id-ce 35 } */ | ||||
| #define MBEDTLS_OID_SUBJECT_KEY_IDENTIFIER      MBEDTLS_OID_ID_CE "\x0E" /**< id-ce-subjectKeyIdentifier OBJECT IDENTIFIER ::=  { id-ce 14 } */ | ||||
| #define MBEDTLS_OID_KEY_USAGE                   MBEDTLS_OID_ID_CE "\x0F" /**< id-ce-keyUsage OBJECT IDENTIFIER ::=  { id-ce 15 } */ | ||||
| #define MBEDTLS_OID_CERTIFICATE_POLICIES        MBEDTLS_OID_ID_CE "\x20" /**< id-ce-certificatePolicies OBJECT IDENTIFIER ::=  { id-ce 32 } */ | ||||
| #define MBEDTLS_OID_POLICY_MAPPINGS             MBEDTLS_OID_ID_CE "\x21" /**< id-ce-policyMappings OBJECT IDENTIFIER ::=  { id-ce 33 } */ | ||||
| #define MBEDTLS_OID_SUBJECT_ALT_NAME            MBEDTLS_OID_ID_CE "\x11" /**< id-ce-subjectAltName OBJECT IDENTIFIER ::=  { id-ce 17 } */ | ||||
| #define MBEDTLS_OID_ISSUER_ALT_NAME             MBEDTLS_OID_ID_CE "\x12" /**< id-ce-issuerAltName OBJECT IDENTIFIER ::=  { id-ce 18 } */ | ||||
| #define MBEDTLS_OID_SUBJECT_DIRECTORY_ATTRS     MBEDTLS_OID_ID_CE "\x09" /**< id-ce-subjectDirectoryAttributes OBJECT IDENTIFIER ::=  { id-ce 9 } */ | ||||
| #define MBEDTLS_OID_BASIC_CONSTRAINTS           MBEDTLS_OID_ID_CE "\x13" /**< id-ce-basicConstraints OBJECT IDENTIFIER ::=  { id-ce 19 } */ | ||||
| #define MBEDTLS_OID_NAME_CONSTRAINTS            MBEDTLS_OID_ID_CE "\x1E" /**< id-ce-nameConstraints OBJECT IDENTIFIER ::=  { id-ce 30 } */ | ||||
| #define MBEDTLS_OID_POLICY_CONSTRAINTS          MBEDTLS_OID_ID_CE "\x24" /**< id-ce-policyConstraints OBJECT IDENTIFIER ::=  { id-ce 36 } */ | ||||
| #define MBEDTLS_OID_EXTENDED_KEY_USAGE          MBEDTLS_OID_ID_CE "\x25" /**< id-ce-extKeyUsage OBJECT IDENTIFIER ::= { id-ce 37 } */ | ||||
| #define MBEDTLS_OID_CRL_DISTRIBUTION_POINTS     MBEDTLS_OID_ID_CE "\x1F" /**< id-ce-cRLDistributionPoints OBJECT IDENTIFIER ::=  { id-ce 31 } */ | ||||
| #define MBEDTLS_OID_INIHIBIT_ANYPOLICY          MBEDTLS_OID_ID_CE "\x36" /**< id-ce-inhibitAnyPolicy OBJECT IDENTIFIER ::=  { id-ce 54 } */ | ||||
| #define MBEDTLS_OID_FRESHEST_CRL                MBEDTLS_OID_ID_CE "\x2E" /**< id-ce-freshestCRL OBJECT IDENTIFIER ::=  { id-ce 46 } */ | ||||
| #define MBEDTLS_OID_AUTHORITY_KEY_IDENTIFIER    MBEDTLS_OID_ID_CE "\x23" /*< id-ce-authorityKeyIdentifier OBJECT IDENTIFIER ::=  { id-ce 35 } */ | ||||
| #define MBEDTLS_OID_SUBJECT_KEY_IDENTIFIER      MBEDTLS_OID_ID_CE "\x0E" /*< id-ce-subjectKeyIdentifier OBJECT IDENTIFIER ::=  { id-ce 14 } */ | ||||
| #define MBEDTLS_OID_KEY_USAGE                   MBEDTLS_OID_ID_CE "\x0F" /*< id-ce-keyUsage OBJECT IDENTIFIER ::=  { id-ce 15 } */ | ||||
| #define MBEDTLS_OID_CERTIFICATE_POLICIES        MBEDTLS_OID_ID_CE "\x20" /*< id-ce-certificatePolicies OBJECT IDENTIFIER ::=  { id-ce 32 } */ | ||||
| #define MBEDTLS_OID_POLICY_MAPPINGS             MBEDTLS_OID_ID_CE "\x21" /*< id-ce-policyMappings OBJECT IDENTIFIER ::=  { id-ce 33 } */ | ||||
| #define MBEDTLS_OID_SUBJECT_ALT_NAME            MBEDTLS_OID_ID_CE "\x11" /*< id-ce-subjectAltName OBJECT IDENTIFIER ::=  { id-ce 17 } */ | ||||
| #define MBEDTLS_OID_ISSUER_ALT_NAME             MBEDTLS_OID_ID_CE "\x12" /*< id-ce-issuerAltName OBJECT IDENTIFIER ::=  { id-ce 18 } */ | ||||
| #define MBEDTLS_OID_SUBJECT_DIRECTORY_ATTRS     MBEDTLS_OID_ID_CE "\x09" /*< id-ce-subjectDirectoryAttributes OBJECT IDENTIFIER ::=  { id-ce 9 } */ | ||||
| #define MBEDTLS_OID_BASIC_CONSTRAINTS           MBEDTLS_OID_ID_CE "\x13" /*< id-ce-basicConstraints OBJECT IDENTIFIER ::=  { id-ce 19 } */ | ||||
| #define MBEDTLS_OID_NAME_CONSTRAINTS            MBEDTLS_OID_ID_CE "\x1E" /*< id-ce-nameConstraints OBJECT IDENTIFIER ::=  { id-ce 30 } */ | ||||
| #define MBEDTLS_OID_POLICY_CONSTRAINTS          MBEDTLS_OID_ID_CE "\x24" /*< id-ce-policyConstraints OBJECT IDENTIFIER ::=  { id-ce 36 } */ | ||||
| #define MBEDTLS_OID_EXTENDED_KEY_USAGE          MBEDTLS_OID_ID_CE "\x25" /*< id-ce-extKeyUsage OBJECT IDENTIFIER ::= { id-ce 37 } */ | ||||
| #define MBEDTLS_OID_CRL_DISTRIBUTION_POINTS     MBEDTLS_OID_ID_CE "\x1F" /*< id-ce-cRLDistributionPoints OBJECT IDENTIFIER ::=  { id-ce 31 } */ | ||||
| #define MBEDTLS_OID_INIHIBIT_ANYPOLICY          MBEDTLS_OID_ID_CE "\x36" /*< id-ce-inhibitAnyPolicy OBJECT IDENTIFIER ::=  { id-ce 54 } */ | ||||
| #define MBEDTLS_OID_FRESHEST_CRL                MBEDTLS_OID_ID_CE "\x2E" /*< id-ce-freshestCRL OBJECT IDENTIFIER ::=  { id-ce 46 } */ | ||||
| 
 | ||||
| /*
 | ||||
|  * Certificate policies | ||||
|  */ | ||||
| #define MBEDTLS_OID_ANY_POLICY              MBEDTLS_OID_CERTIFICATE_POLICIES "\x00" /**< anyPolicy OBJECT IDENTIFIER ::= { id-ce-certificatePolicies 0 } */ | ||||
| #define MBEDTLS_OID_ANY_POLICY              MBEDTLS_OID_CERTIFICATE_POLICIES "\x00" /*< anyPolicy OBJECT IDENTIFIER ::= { id-ce-certificatePolicies 0 } */ | ||||
| 
 | ||||
| /*
 | ||||
|  * Netscape certificate extensions | ||||
|  | @ -156,84 +156,84 @@ | |||
|  * OIDs for CRL extensions | ||||
|  */ | ||||
| #define MBEDTLS_OID_PRIVATE_KEY_USAGE_PERIOD    MBEDTLS_OID_ID_CE "\x10" | ||||
| #define MBEDTLS_OID_CRL_NUMBER                  MBEDTLS_OID_ID_CE "\x14" /**< id-ce-cRLNumber OBJECT IDENTIFIER ::= { id-ce 20 } */ | ||||
| #define MBEDTLS_OID_CRL_NUMBER                  MBEDTLS_OID_ID_CE "\x14" /*< id-ce-cRLNumber OBJECT IDENTIFIER ::= { id-ce 20 } */ | ||||
| 
 | ||||
| /*
 | ||||
|  * X.509 v3 Extended key usage OIDs | ||||
|  */ | ||||
| #define MBEDTLS_OID_ANY_EXTENDED_KEY_USAGE      MBEDTLS_OID_EXTENDED_KEY_USAGE "\x00" /**< anyExtendedKeyUsage OBJECT IDENTIFIER ::= { id-ce-extKeyUsage 0 } */ | ||||
| #define MBEDTLS_OID_ANY_EXTENDED_KEY_USAGE      MBEDTLS_OID_EXTENDED_KEY_USAGE "\x00" /*< anyExtendedKeyUsage OBJECT IDENTIFIER ::= { id-ce-extKeyUsage 0 } */ | ||||
| 
 | ||||
| #define MBEDTLS_OID_KP                          MBEDTLS_OID_PKIX "\x03" /**< id-kp OBJECT IDENTIFIER ::= { id-pkix 3 } */ | ||||
| #define MBEDTLS_OID_SERVER_AUTH                 MBEDTLS_OID_KP "\x01" /**< id-kp-serverAuth OBJECT IDENTIFIER ::= { id-kp 1 } */ | ||||
| #define MBEDTLS_OID_CLIENT_AUTH                 MBEDTLS_OID_KP "\x02" /**< id-kp-clientAuth OBJECT IDENTIFIER ::= { id-kp 2 } */ | ||||
| #define MBEDTLS_OID_CODE_SIGNING                MBEDTLS_OID_KP "\x03" /**< id-kp-codeSigning OBJECT IDENTIFIER ::= { id-kp 3 } */ | ||||
| #define MBEDTLS_OID_EMAIL_PROTECTION            MBEDTLS_OID_KP "\x04" /**< id-kp-emailProtection OBJECT IDENTIFIER ::= { id-kp 4 } */ | ||||
| #define MBEDTLS_OID_TIME_STAMPING               MBEDTLS_OID_KP "\x08" /**< id-kp-timeStamping OBJECT IDENTIFIER ::= { id-kp 8 } */ | ||||
| #define MBEDTLS_OID_OCSP_SIGNING                MBEDTLS_OID_KP "\x09" /**< id-kp-OCSPSigning OBJECT IDENTIFIER ::= { id-kp 9 } */ | ||||
| #define MBEDTLS_OID_KP                          MBEDTLS_OID_PKIX "\x03" /*< id-kp OBJECT IDENTIFIER ::= { id-pkix 3 } */ | ||||
| #define MBEDTLS_OID_SERVER_AUTH                 MBEDTLS_OID_KP "\x01" /*< id-kp-serverAuth OBJECT IDENTIFIER ::= { id-kp 1 } */ | ||||
| #define MBEDTLS_OID_CLIENT_AUTH                 MBEDTLS_OID_KP "\x02" /*< id-kp-clientAuth OBJECT IDENTIFIER ::= { id-kp 2 } */ | ||||
| #define MBEDTLS_OID_CODE_SIGNING                MBEDTLS_OID_KP "\x03" /*< id-kp-codeSigning OBJECT IDENTIFIER ::= { id-kp 3 } */ | ||||
| #define MBEDTLS_OID_EMAIL_PROTECTION            MBEDTLS_OID_KP "\x04" /*< id-kp-emailProtection OBJECT IDENTIFIER ::= { id-kp 4 } */ | ||||
| #define MBEDTLS_OID_TIME_STAMPING               MBEDTLS_OID_KP "\x08" /*< id-kp-timeStamping OBJECT IDENTIFIER ::= { id-kp 8 } */ | ||||
| #define MBEDTLS_OID_OCSP_SIGNING                MBEDTLS_OID_KP "\x09" /*< id-kp-OCSPSigning OBJECT IDENTIFIER ::= { id-kp 9 } */ | ||||
| 
 | ||||
| #define MBEDTLS_OID_ON                          MBEDTLS_OID_PKIX "\x08" /**< id-on OBJECT IDENTIFIER ::= { id-pkix 8 } */ | ||||
| #define MBEDTLS_OID_ON_HW_MODULE_NAME           MBEDTLS_OID_ON "\x04" /**< id-on-hardwareModuleName OBJECT IDENTIFIER ::= { id-on 4 } */ | ||||
| #define MBEDTLS_OID_ON                          MBEDTLS_OID_PKIX "\x08" /*< id-on OBJECT IDENTIFIER ::= { id-pkix 8 } */ | ||||
| #define MBEDTLS_OID_ON_HW_MODULE_NAME           MBEDTLS_OID_ON "\x04" /*< id-on-hardwareModuleName OBJECT IDENTIFIER ::= { id-on 4 } */ | ||||
| 
 | ||||
| /*
 | ||||
|  * PKCS definition OIDs | ||||
|  */ | ||||
| 
 | ||||
| #define MBEDTLS_OID_PKCS                MBEDTLS_OID_RSA_COMPANY "\x01" /**< pkcs OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) 1 } */ | ||||
| #define MBEDTLS_OID_PKCS1               MBEDTLS_OID_PKCS "\x01" /**< pkcs-1 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 1 } */ | ||||
| #define MBEDTLS_OID_PKCS5               MBEDTLS_OID_PKCS "\x05" /**< pkcs-5 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 5 } */ | ||||
| #define MBEDTLS_OID_PKCS9               MBEDTLS_OID_PKCS "\x09" /**< pkcs-9 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 9 } */ | ||||
| #define MBEDTLS_OID_PKCS12              MBEDTLS_OID_PKCS "\x0c" /**< pkcs-12 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 12 } */ | ||||
| #define MBEDTLS_OID_PKCS                MBEDTLS_OID_RSA_COMPANY "\x01" /*< pkcs OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) 1 } */ | ||||
| #define MBEDTLS_OID_PKCS1               MBEDTLS_OID_PKCS "\x01" /*< pkcs-1 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 1 } */ | ||||
| #define MBEDTLS_OID_PKCS5               MBEDTLS_OID_PKCS "\x05" /*< pkcs-5 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 5 } */ | ||||
| #define MBEDTLS_OID_PKCS9               MBEDTLS_OID_PKCS "\x09" /*< pkcs-9 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 9 } */ | ||||
| #define MBEDTLS_OID_PKCS12              MBEDTLS_OID_PKCS "\x0c" /*< pkcs-12 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 12 } */ | ||||
| 
 | ||||
| /*
 | ||||
|  * PKCS#1 OIDs | ||||
|  */ | ||||
| #define MBEDTLS_OID_PKCS1_RSA           MBEDTLS_OID_PKCS1 "\x01" /**< rsaEncryption OBJECT IDENTIFIER ::= { pkcs-1 1 } */ | ||||
| #define MBEDTLS_OID_PKCS1_MD2           MBEDTLS_OID_PKCS1 "\x02" /**< md2WithRSAEncryption ::= { pkcs-1 2 } */ | ||||
| #define MBEDTLS_OID_PKCS1_MD4           MBEDTLS_OID_PKCS1 "\x03" /**< md4WithRSAEncryption ::= { pkcs-1 3 } */ | ||||
| #define MBEDTLS_OID_PKCS1_MD5           MBEDTLS_OID_PKCS1 "\x04" /**< md5WithRSAEncryption ::= { pkcs-1 4 } */ | ||||
| #define MBEDTLS_OID_PKCS1_SHA1          MBEDTLS_OID_PKCS1 "\x05" /**< sha1WithRSAEncryption ::= { pkcs-1 5 } */ | ||||
| #define MBEDTLS_OID_PKCS1_SHA224        MBEDTLS_OID_PKCS1 "\x0e" /**< sha224WithRSAEncryption ::= { pkcs-1 14 } */ | ||||
| #define MBEDTLS_OID_PKCS1_SHA256        MBEDTLS_OID_PKCS1 "\x0b" /**< sha256WithRSAEncryption ::= { pkcs-1 11 } */ | ||||
| #define MBEDTLS_OID_PKCS1_SHA384        MBEDTLS_OID_PKCS1 "\x0c" /**< sha384WithRSAEncryption ::= { pkcs-1 12 } */ | ||||
| #define MBEDTLS_OID_PKCS1_SHA512        MBEDTLS_OID_PKCS1 "\x0d" /**< sha512WithRSAEncryption ::= { pkcs-1 13 } */ | ||||
| #define MBEDTLS_OID_PKCS1_RSA           MBEDTLS_OID_PKCS1 "\x01" /*< rsaEncryption OBJECT IDENTIFIER ::= { pkcs-1 1 } */ | ||||
| #define MBEDTLS_OID_PKCS1_MD2           MBEDTLS_OID_PKCS1 "\x02" /*< md2WithRSAEncryption ::= { pkcs-1 2 } */ | ||||
| #define MBEDTLS_OID_PKCS1_MD4           MBEDTLS_OID_PKCS1 "\x03" /*< md4WithRSAEncryption ::= { pkcs-1 3 } */ | ||||
| #define MBEDTLS_OID_PKCS1_MD5           MBEDTLS_OID_PKCS1 "\x04" /*< md5WithRSAEncryption ::= { pkcs-1 4 } */ | ||||
| #define MBEDTLS_OID_PKCS1_SHA1          MBEDTLS_OID_PKCS1 "\x05" /*< sha1WithRSAEncryption ::= { pkcs-1 5 } */ | ||||
| #define MBEDTLS_OID_PKCS1_SHA224        MBEDTLS_OID_PKCS1 "\x0e" /*< sha224WithRSAEncryption ::= { pkcs-1 14 } */ | ||||
| #define MBEDTLS_OID_PKCS1_SHA256        MBEDTLS_OID_PKCS1 "\x0b" /*< sha256WithRSAEncryption ::= { pkcs-1 11 } */ | ||||
| #define MBEDTLS_OID_PKCS1_SHA384        MBEDTLS_OID_PKCS1 "\x0c" /*< sha384WithRSAEncryption ::= { pkcs-1 12 } */ | ||||
| #define MBEDTLS_OID_PKCS1_SHA512        MBEDTLS_OID_PKCS1 "\x0d" /*< sha512WithRSAEncryption ::= { pkcs-1 13 } */ | ||||
| 
 | ||||
| #define MBEDTLS_OID_RSA_SHA_OBS         "\x2B\x0E\x03\x02\x1D" | ||||
| 
 | ||||
| #define MBEDTLS_OID_PKCS9_EMAIL         MBEDTLS_OID_PKCS9 "\x01" /**< emailAddress AttributeType ::= { pkcs-9 1 } */ | ||||
| #define MBEDTLS_OID_PKCS9_EMAIL         MBEDTLS_OID_PKCS9 "\x01" /*< emailAddress AttributeType ::= { pkcs-9 1 } */ | ||||
| 
 | ||||
| /* RFC 4055 */ | ||||
| #define MBEDTLS_OID_RSASSA_PSS          MBEDTLS_OID_PKCS1 "\x0a" /**< id-RSASSA-PSS ::= { pkcs-1 10 } */ | ||||
| #define MBEDTLS_OID_MGF1                MBEDTLS_OID_PKCS1 "\x08" /**< id-mgf1 ::= { pkcs-1 8 } */ | ||||
| #define MBEDTLS_OID_RSASSA_PSS          MBEDTLS_OID_PKCS1 "\x0a" /*< id-RSASSA-PSS ::= { pkcs-1 10 } */ | ||||
| #define MBEDTLS_OID_MGF1                MBEDTLS_OID_PKCS1 "\x08" /*< id-mgf1 ::= { pkcs-1 8 } */ | ||||
| 
 | ||||
| /*
 | ||||
|  * Digest algorithms | ||||
|  */ | ||||
| #define MBEDTLS_OID_DIGEST_ALG_MD2              MBEDTLS_OID_RSA_COMPANY "\x02\x02" /**< id-mbedtls_md2 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 2 } */ | ||||
| #define MBEDTLS_OID_DIGEST_ALG_MD4              MBEDTLS_OID_RSA_COMPANY "\x02\x04" /**< id-mbedtls_md4 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 4 } */ | ||||
| #define MBEDTLS_OID_DIGEST_ALG_MD5              MBEDTLS_OID_RSA_COMPANY "\x02\x05" /**< id-mbedtls_md5 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 5 } */ | ||||
| #define MBEDTLS_OID_DIGEST_ALG_SHA1             MBEDTLS_OID_ISO_IDENTIFIED_ORG MBEDTLS_OID_OIW_SECSIG_SHA1 /**< id-mbedtls_sha1 OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) oiw(14) secsig(3) algorithms(2) 26 } */ | ||||
| #define MBEDTLS_OID_DIGEST_ALG_SHA224           MBEDTLS_OID_NIST_ALG "\x02\x04" /**< id-sha224 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistalgorithm(4) hashalgs(2) 4 } */ | ||||
| #define MBEDTLS_OID_DIGEST_ALG_SHA256           MBEDTLS_OID_NIST_ALG "\x02\x01" /**< id-mbedtls_sha256 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistalgorithm(4) hashalgs(2) 1 } */ | ||||
| #define MBEDTLS_OID_DIGEST_ALG_MD2              MBEDTLS_OID_RSA_COMPANY "\x02\x02" /*< id-mbedtls_md2 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 2 } */ | ||||
| #define MBEDTLS_OID_DIGEST_ALG_MD4              MBEDTLS_OID_RSA_COMPANY "\x02\x04" /*< id-mbedtls_md4 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 4 } */ | ||||
| #define MBEDTLS_OID_DIGEST_ALG_MD5              MBEDTLS_OID_RSA_COMPANY "\x02\x05" /*< id-mbedtls_md5 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 5 } */ | ||||
| #define MBEDTLS_OID_DIGEST_ALG_SHA1             MBEDTLS_OID_ISO_IDENTIFIED_ORG MBEDTLS_OID_OIW_SECSIG_SHA1 /*< id-mbedtls_sha1 OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) oiw(14) secsig(3) algorithms(2) 26 } */ | ||||
| #define MBEDTLS_OID_DIGEST_ALG_SHA224           MBEDTLS_OID_NIST_ALG "\x02\x04" /*< id-sha224 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistalgorithm(4) hashalgs(2) 4 } */ | ||||
| #define MBEDTLS_OID_DIGEST_ALG_SHA256           MBEDTLS_OID_NIST_ALG "\x02\x01" /*< id-mbedtls_sha256 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistalgorithm(4) hashalgs(2) 1 } */ | ||||
| 
 | ||||
| #define MBEDTLS_OID_DIGEST_ALG_SHA384           MBEDTLS_OID_NIST_ALG "\x02\x02" /**< id-sha384 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistalgorithm(4) hashalgs(2) 2 } */ | ||||
| #define MBEDTLS_OID_DIGEST_ALG_SHA384           MBEDTLS_OID_NIST_ALG "\x02\x02" /*< id-sha384 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistalgorithm(4) hashalgs(2) 2 } */ | ||||
| 
 | ||||
| #define MBEDTLS_OID_DIGEST_ALG_SHA512           MBEDTLS_OID_NIST_ALG "\x02\x03" /**< id-mbedtls_sha512 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistalgorithm(4) hashalgs(2) 3 } */ | ||||
| #define MBEDTLS_OID_DIGEST_ALG_SHA512           MBEDTLS_OID_NIST_ALG "\x02\x03" /*< id-mbedtls_sha512 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistalgorithm(4) hashalgs(2) 3 } */ | ||||
| 
 | ||||
| #define MBEDTLS_OID_HMAC_SHA1                   MBEDTLS_OID_RSA_COMPANY "\x02\x07" /**< id-hmacWithSHA1 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 7 } */ | ||||
| #define MBEDTLS_OID_HMAC_SHA1                   MBEDTLS_OID_RSA_COMPANY "\x02\x07" /*< id-hmacWithSHA1 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 7 } */ | ||||
| 
 | ||||
| #define MBEDTLS_OID_HMAC_SHA224                 MBEDTLS_OID_RSA_COMPANY "\x02\x08" /**< id-hmacWithSHA224 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 8 } */ | ||||
| #define MBEDTLS_OID_HMAC_SHA224                 MBEDTLS_OID_RSA_COMPANY "\x02\x08" /*< id-hmacWithSHA224 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 8 } */ | ||||
| 
 | ||||
| #define MBEDTLS_OID_HMAC_SHA256                 MBEDTLS_OID_RSA_COMPANY "\x02\x09" /**< id-hmacWithSHA256 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 9 } */ | ||||
| #define MBEDTLS_OID_HMAC_SHA256                 MBEDTLS_OID_RSA_COMPANY "\x02\x09" /*< id-hmacWithSHA256 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 9 } */ | ||||
| 
 | ||||
| #define MBEDTLS_OID_HMAC_SHA384                 MBEDTLS_OID_RSA_COMPANY "\x02\x0A" /**< id-hmacWithSHA384 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 10 } */ | ||||
| #define MBEDTLS_OID_HMAC_SHA384                 MBEDTLS_OID_RSA_COMPANY "\x02\x0A" /*< id-hmacWithSHA384 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 10 } */ | ||||
| 
 | ||||
| #define MBEDTLS_OID_HMAC_SHA512                 MBEDTLS_OID_RSA_COMPANY "\x02\x0B" /**< id-hmacWithSHA512 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 11 } */ | ||||
| #define MBEDTLS_OID_HMAC_SHA512                 MBEDTLS_OID_RSA_COMPANY "\x02\x0B" /*< id-hmacWithSHA512 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 11 } */ | ||||
| 
 | ||||
| /*
 | ||||
|  * Encryption algorithms | ||||
|  */ | ||||
| #define MBEDTLS_OID_DES_CBC                     MBEDTLS_OID_ISO_IDENTIFIED_ORG MBEDTLS_OID_OIW_SECSIG_ALG "\x07" /**< desCBC OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) oiw(14) secsig(3) algorithms(2) 7 } */ | ||||
| #define MBEDTLS_OID_DES_EDE3_CBC                MBEDTLS_OID_RSA_COMPANY "\x03\x07" /**< des-ede3-cbc OBJECT IDENTIFIER ::= { iso(1) member-body(2) -- us(840) rsadsi(113549) encryptionAlgorithm(3) 7 } */ | ||||
| #define MBEDTLS_OID_DES_CBC                     MBEDTLS_OID_ISO_IDENTIFIED_ORG MBEDTLS_OID_OIW_SECSIG_ALG "\x07" /*< desCBC OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) oiw(14) secsig(3) algorithms(2) 7 } */ | ||||
| #define MBEDTLS_OID_DES_EDE3_CBC                MBEDTLS_OID_RSA_COMPANY "\x03\x07" /*< des-ede3-cbc OBJECT IDENTIFIER ::= { iso(1) member-body(2) -- us(840) rsadsi(113549) encryptionAlgorithm(3) 7 } */ | ||||
| #define MBEDTLS_OID_AES                         MBEDTLS_OID_NIST_ALG "\x01" /** aes OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistAlgorithm(4) 1 } */ | ||||
| 
 | ||||
| /*
 | ||||
|  | @ -251,36 +251,36 @@ | |||
| /*
 | ||||
|  * PKCS#5 OIDs | ||||
|  */ | ||||
| #define MBEDTLS_OID_PKCS5_PBKDF2                MBEDTLS_OID_PKCS5 "\x0c" /**< id-PBKDF2 OBJECT IDENTIFIER ::= {pkcs-5 12} */ | ||||
| #define MBEDTLS_OID_PKCS5_PBES2                 MBEDTLS_OID_PKCS5 "\x0d" /**< id-PBES2 OBJECT IDENTIFIER ::= {pkcs-5 13} */ | ||||
| #define MBEDTLS_OID_PKCS5_PBMAC1                MBEDTLS_OID_PKCS5 "\x0e" /**< id-PBMAC1 OBJECT IDENTIFIER ::= {pkcs-5 14} */ | ||||
| #define MBEDTLS_OID_PKCS5_PBKDF2                MBEDTLS_OID_PKCS5 "\x0c" /*< id-PBKDF2 OBJECT IDENTIFIER ::= {pkcs-5 12} */ | ||||
| #define MBEDTLS_OID_PKCS5_PBES2                 MBEDTLS_OID_PKCS5 "\x0d" /*< id-PBES2 OBJECT IDENTIFIER ::= {pkcs-5 13} */ | ||||
| #define MBEDTLS_OID_PKCS5_PBMAC1                MBEDTLS_OID_PKCS5 "\x0e" /*< id-PBMAC1 OBJECT IDENTIFIER ::= {pkcs-5 14} */ | ||||
| 
 | ||||
| /*
 | ||||
|  * PKCS#5 PBES1 algorithms | ||||
|  */ | ||||
| #define MBEDTLS_OID_PKCS5_PBE_MD2_DES_CBC       MBEDTLS_OID_PKCS5 "\x01" /**< pbeWithMD2AndDES-CBC OBJECT IDENTIFIER ::= {pkcs-5 1} */ | ||||
| #define MBEDTLS_OID_PKCS5_PBE_MD2_RC2_CBC       MBEDTLS_OID_PKCS5 "\x04" /**< pbeWithMD2AndRC2-CBC OBJECT IDENTIFIER ::= {pkcs-5 4} */ | ||||
| #define MBEDTLS_OID_PKCS5_PBE_MD5_DES_CBC       MBEDTLS_OID_PKCS5 "\x03" /**< pbeWithMD5AndDES-CBC OBJECT IDENTIFIER ::= {pkcs-5 3} */ | ||||
| #define MBEDTLS_OID_PKCS5_PBE_MD5_RC2_CBC       MBEDTLS_OID_PKCS5 "\x06" /**< pbeWithMD5AndRC2-CBC OBJECT IDENTIFIER ::= {pkcs-5 6} */ | ||||
| #define MBEDTLS_OID_PKCS5_PBE_SHA1_DES_CBC      MBEDTLS_OID_PKCS5 "\x0a" /**< pbeWithSHA1AndDES-CBC OBJECT IDENTIFIER ::= {pkcs-5 10} */ | ||||
| #define MBEDTLS_OID_PKCS5_PBE_SHA1_RC2_CBC      MBEDTLS_OID_PKCS5 "\x0b" /**< pbeWithSHA1AndRC2-CBC OBJECT IDENTIFIER ::= {pkcs-5 11} */ | ||||
| #define MBEDTLS_OID_PKCS5_PBE_MD2_DES_CBC       MBEDTLS_OID_PKCS5 "\x01" /*< pbeWithMD2AndDES-CBC OBJECT IDENTIFIER ::= {pkcs-5 1} */ | ||||
| #define MBEDTLS_OID_PKCS5_PBE_MD2_RC2_CBC       MBEDTLS_OID_PKCS5 "\x04" /*< pbeWithMD2AndRC2-CBC OBJECT IDENTIFIER ::= {pkcs-5 4} */ | ||||
| #define MBEDTLS_OID_PKCS5_PBE_MD5_DES_CBC       MBEDTLS_OID_PKCS5 "\x03" /*< pbeWithMD5AndDES-CBC OBJECT IDENTIFIER ::= {pkcs-5 3} */ | ||||
| #define MBEDTLS_OID_PKCS5_PBE_MD5_RC2_CBC       MBEDTLS_OID_PKCS5 "\x06" /*< pbeWithMD5AndRC2-CBC OBJECT IDENTIFIER ::= {pkcs-5 6} */ | ||||
| #define MBEDTLS_OID_PKCS5_PBE_SHA1_DES_CBC      MBEDTLS_OID_PKCS5 "\x0a" /*< pbeWithSHA1AndDES-CBC OBJECT IDENTIFIER ::= {pkcs-5 10} */ | ||||
| #define MBEDTLS_OID_PKCS5_PBE_SHA1_RC2_CBC      MBEDTLS_OID_PKCS5 "\x0b" /*< pbeWithSHA1AndRC2-CBC OBJECT IDENTIFIER ::= {pkcs-5 11} */ | ||||
| 
 | ||||
| /*
 | ||||
|  * PKCS#8 OIDs | ||||
|  */ | ||||
| #define MBEDTLS_OID_PKCS9_CSR_EXT_REQ           MBEDTLS_OID_PKCS9 "\x0e" /**< extensionRequest OBJECT IDENTIFIER ::= {pkcs-9 14} */ | ||||
| #define MBEDTLS_OID_PKCS9_CSR_EXT_REQ           MBEDTLS_OID_PKCS9 "\x0e" /*< extensionRequest OBJECT IDENTIFIER ::= {pkcs-9 14} */ | ||||
| 
 | ||||
| /*
 | ||||
|  * PKCS#12 PBE OIDs | ||||
|  */ | ||||
| #define MBEDTLS_OID_PKCS12_PBE                      MBEDTLS_OID_PKCS12 "\x01" /**< pkcs-12PbeIds OBJECT IDENTIFIER ::= {pkcs-12 1} */ | ||||
| #define MBEDTLS_OID_PKCS12_PBE                      MBEDTLS_OID_PKCS12 "\x01" /*< pkcs-12PbeIds OBJECT IDENTIFIER ::= {pkcs-12 1} */ | ||||
| 
 | ||||
| #define MBEDTLS_OID_PKCS12_PBE_SHA1_RC4_128         MBEDTLS_OID_PKCS12_PBE "\x01" /**< pbeWithSHAAnd128BitRC4 OBJECT IDENTIFIER ::= {pkcs-12PbeIds 1} */ | ||||
| #define MBEDTLS_OID_PKCS12_PBE_SHA1_RC4_40          MBEDTLS_OID_PKCS12_PBE "\x02" /**< pbeWithSHAAnd40BitRC4 OBJECT IDENTIFIER ::= {pkcs-12PbeIds 2} */ | ||||
| #define MBEDTLS_OID_PKCS12_PBE_SHA1_DES3_EDE_CBC    MBEDTLS_OID_PKCS12_PBE "\x03" /**< pbeWithSHAAnd3-KeyTripleDES-CBC OBJECT IDENTIFIER ::= {pkcs-12PbeIds 3} */ | ||||
| #define MBEDTLS_OID_PKCS12_PBE_SHA1_DES2_EDE_CBC    MBEDTLS_OID_PKCS12_PBE "\x04" /**< pbeWithSHAAnd2-KeyTripleDES-CBC OBJECT IDENTIFIER ::= {pkcs-12PbeIds 4} */ | ||||
| #define MBEDTLS_OID_PKCS12_PBE_SHA1_RC2_128_CBC     MBEDTLS_OID_PKCS12_PBE "\x05" /**< pbeWithSHAAnd128BitRC2-CBC OBJECT IDENTIFIER ::= {pkcs-12PbeIds 5} */ | ||||
| #define MBEDTLS_OID_PKCS12_PBE_SHA1_RC2_40_CBC      MBEDTLS_OID_PKCS12_PBE "\x06" /**< pbeWithSHAAnd40BitRC2-CBC OBJECT IDENTIFIER ::= {pkcs-12PbeIds 6} */ | ||||
| #define MBEDTLS_OID_PKCS12_PBE_SHA1_RC4_128         MBEDTLS_OID_PKCS12_PBE "\x01" /*< pbeWithSHAAnd128BitRC4 OBJECT IDENTIFIER ::= {pkcs-12PbeIds 1} */ | ||||
| #define MBEDTLS_OID_PKCS12_PBE_SHA1_RC4_40          MBEDTLS_OID_PKCS12_PBE "\x02" /*< pbeWithSHAAnd40BitRC4 OBJECT IDENTIFIER ::= {pkcs-12PbeIds 2} */ | ||||
| #define MBEDTLS_OID_PKCS12_PBE_SHA1_DES3_EDE_CBC    MBEDTLS_OID_PKCS12_PBE "\x03" /*< pbeWithSHAAnd3-KeyTripleDES-CBC OBJECT IDENTIFIER ::= {pkcs-12PbeIds 3} */ | ||||
| #define MBEDTLS_OID_PKCS12_PBE_SHA1_DES2_EDE_CBC    MBEDTLS_OID_PKCS12_PBE "\x04" /*< pbeWithSHAAnd2-KeyTripleDES-CBC OBJECT IDENTIFIER ::= {pkcs-12PbeIds 4} */ | ||||
| #define MBEDTLS_OID_PKCS12_PBE_SHA1_RC2_128_CBC     MBEDTLS_OID_PKCS12_PBE "\x05" /*< pbeWithSHAAnd128BitRC2-CBC OBJECT IDENTIFIER ::= {pkcs-12PbeIds 5} */ | ||||
| #define MBEDTLS_OID_PKCS12_PBE_SHA1_RC2_40_CBC      MBEDTLS_OID_PKCS12_PBE "\x06" /*< pbeWithSHAAnd40BitRC2-CBC OBJECT IDENTIFIER ::= {pkcs-12PbeIds 6} */ | ||||
| 
 | ||||
| /*
 | ||||
|  * EC key algorithms from RFC 5480 | ||||
|  |  | |||
							
								
								
									
										2
									
								
								third_party/mbedtls/param.c
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								third_party/mbedtls/param.c
									
										
									
									
										vendored
									
									
								
							|  | @ -26,7 +26,7 @@ void mbedtls_param_failed(const char *msg, const char *file, int line) { | |||
|   char *p, *q; | ||||
|   if ((p = q = malloc(128 + strlen(msg) + strlen(file)))) { | ||||
|     p = stpcpy(p, file), *p++ = ':'; | ||||
|     p += int64toarray_radix10(line, p); | ||||
|     p = FormatInt32(p, line); | ||||
|     p = stpcpy(p, ": error: "); | ||||
|     p = stpcpy(p, msg); | ||||
|     p = stpcpy(p, "\r\n"); | ||||
|  |  | |||
							
								
								
									
										18
									
								
								third_party/mbedtls/pem.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								third_party/mbedtls/pem.h
									
										
									
									
										vendored
									
									
								
							|  | @ -9,15 +9,15 @@ | |||
|  * PEM data. | ||||
|  * \{ | ||||
|  */ | ||||
| #define MBEDTLS_ERR_PEM_NO_HEADER_FOOTER_PRESENT          -0x1080  /**< No PEM header or footer found. */ | ||||
| #define MBEDTLS_ERR_PEM_INVALID_DATA                      -0x1100  /**< PEM string is not as expected. */ | ||||
| #define MBEDTLS_ERR_PEM_ALLOC_FAILED                      -0x1180  /**< Failed to allocate memory. */ | ||||
| #define MBEDTLS_ERR_PEM_INVALID_ENC_IV                    -0x1200  /**< RSA IV is not in hex-format. */ | ||||
| #define MBEDTLS_ERR_PEM_UNKNOWN_ENC_ALG                   -0x1280  /**< Unsupported key encryption algorithm. */ | ||||
| #define MBEDTLS_ERR_PEM_PASSWORD_REQUIRED                 -0x1300  /**< Private key password can't be empty. */ | ||||
| #define MBEDTLS_ERR_PEM_PASSWORD_MISMATCH                 -0x1380  /**< Given private key password does not allow for correct decryption. */ | ||||
| #define MBEDTLS_ERR_PEM_FEATURE_UNAVAILABLE               -0x1400  /**< Unavailable feature, e.g. hashing/encryption combination. */ | ||||
| #define MBEDTLS_ERR_PEM_BAD_INPUT_DATA                    -0x1480  /**< Bad input parameters to function. */ | ||||
| #define MBEDTLS_ERR_PEM_NO_HEADER_FOOTER_PRESENT          -0x1080  /*< No PEM header or footer found. */ | ||||
| #define MBEDTLS_ERR_PEM_INVALID_DATA                      -0x1100  /*< PEM string is not as expected. */ | ||||
| #define MBEDTLS_ERR_PEM_ALLOC_FAILED                      -0x1180  /*< Failed to allocate memory. */ | ||||
| #define MBEDTLS_ERR_PEM_INVALID_ENC_IV                    -0x1200  /*< RSA IV is not in hex-format. */ | ||||
| #define MBEDTLS_ERR_PEM_UNKNOWN_ENC_ALG                   -0x1280  /*< Unsupported key encryption algorithm. */ | ||||
| #define MBEDTLS_ERR_PEM_PASSWORD_REQUIRED                 -0x1300  /*< Private key password can't be empty. */ | ||||
| #define MBEDTLS_ERR_PEM_PASSWORD_MISMATCH                 -0x1380  /*< Given private key password does not allow for correct decryption. */ | ||||
| #define MBEDTLS_ERR_PEM_FEATURE_UNAVAILABLE               -0x1400  /*< Unavailable feature, e.g. hashing/encryption combination. */ | ||||
| #define MBEDTLS_ERR_PEM_BAD_INPUT_DATA                    -0x1480  /*< Bad input parameters to function. */ | ||||
| /* \} name */ | ||||
| 
 | ||||
| #ifdef __cplusplus | ||||
|  |  | |||
							
								
								
									
										38
									
								
								third_party/mbedtls/pk.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										38
									
								
								third_party/mbedtls/pk.h
									
										
									
									
										vendored
									
									
								
							|  | @ -8,23 +8,23 @@ | |||
| COSMOPOLITAN_C_START_ | ||||
| /* clang-format off */ | ||||
| 
 | ||||
| #define MBEDTLS_ERR_PK_ALLOC_FAILED        -0x3F80  /**< Memory allocation failed. */ | ||||
| #define MBEDTLS_ERR_PK_TYPE_MISMATCH       -0x3F00  /**< Type mismatch, eg attempt to encrypt with an ECDSA key */ | ||||
| #define MBEDTLS_ERR_PK_BAD_INPUT_DATA      -0x3E80  /**< Bad input parameters to function. */ | ||||
| #define MBEDTLS_ERR_PK_FILE_IO_ERROR       -0x3E00  /**< Read/write of file failed. */ | ||||
| #define MBEDTLS_ERR_PK_KEY_INVALID_VERSION -0x3D80  /**< Unsupported key version */ | ||||
| #define MBEDTLS_ERR_PK_KEY_INVALID_FORMAT  -0x3D00  /**< Invalid key tag or value. */ | ||||
| #define MBEDTLS_ERR_PK_UNKNOWN_PK_ALG      -0x3C80  /**< Key algorithm is unsupported (only RSA and EC are supported). */ | ||||
| #define MBEDTLS_ERR_PK_PASSWORD_REQUIRED   -0x3C00  /**< Private key password can't be empty. */ | ||||
| #define MBEDTLS_ERR_PK_PASSWORD_MISMATCH   -0x3B80  /**< Given private key password does not allow for correct decryption. */ | ||||
| #define MBEDTLS_ERR_PK_INVALID_PUBKEY      -0x3B00  /**< The pubkey tag or value is invalid (only RSA and EC are supported). */ | ||||
| #define MBEDTLS_ERR_PK_INVALID_ALG         -0x3A80  /**< The algorithm tag or value is invalid. */ | ||||
| #define MBEDTLS_ERR_PK_UNKNOWN_NAMED_CURVE -0x3A00  /**< Elliptic curve is unsupported (only NIST curves are supported). */ | ||||
| #define MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE -0x3980  /**< Unavailable feature, e.g. RSA disabled for RSA key. */ | ||||
| #define MBEDTLS_ERR_PK_SIG_LEN_MISMATCH    -0x3900  /**< The buffer contains a valid signature followed by more data. */ | ||||
| #define MBEDTLS_ERR_PK_ALLOC_FAILED        -0x3F80  /*< Memory allocation failed. */ | ||||
| #define MBEDTLS_ERR_PK_TYPE_MISMATCH       -0x3F00  /*< Type mismatch, eg attempt to encrypt with an ECDSA key */ | ||||
| #define MBEDTLS_ERR_PK_BAD_INPUT_DATA      -0x3E80  /*< Bad input parameters to function. */ | ||||
| #define MBEDTLS_ERR_PK_FILE_IO_ERROR       -0x3E00  /*< Read/write of file failed. */ | ||||
| #define MBEDTLS_ERR_PK_KEY_INVALID_VERSION -0x3D80  /*< Unsupported key version */ | ||||
| #define MBEDTLS_ERR_PK_KEY_INVALID_FORMAT  -0x3D00  /*< Invalid key tag or value. */ | ||||
| #define MBEDTLS_ERR_PK_UNKNOWN_PK_ALG      -0x3C80  /*< Key algorithm is unsupported (only RSA and EC are supported). */ | ||||
| #define MBEDTLS_ERR_PK_PASSWORD_REQUIRED   -0x3C00  /*< Private key password can't be empty. */ | ||||
| #define MBEDTLS_ERR_PK_PASSWORD_MISMATCH   -0x3B80  /*< Given private key password does not allow for correct decryption. */ | ||||
| #define MBEDTLS_ERR_PK_INVALID_PUBKEY      -0x3B00  /*< The pubkey tag or value is invalid (only RSA and EC are supported). */ | ||||
| #define MBEDTLS_ERR_PK_INVALID_ALG         -0x3A80  /*< The algorithm tag or value is invalid. */ | ||||
| #define MBEDTLS_ERR_PK_UNKNOWN_NAMED_CURVE -0x3A00  /*< Elliptic curve is unsupported (only NIST curves are supported). */ | ||||
| #define MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE -0x3980  /*< Unavailable feature, e.g. RSA disabled for RSA key. */ | ||||
| #define MBEDTLS_ERR_PK_SIG_LEN_MISMATCH    -0x3900  /*< The buffer contains a valid signature followed by more data. */ | ||||
| 
 | ||||
| /* MBEDTLS_ERR_PK_HW_ACCEL_FAILED is deprecated and should not be used. */ | ||||
| #define MBEDTLS_ERR_PK_HW_ACCEL_FAILED     -0x3880  /**< PK hardware accelerator failed. */ | ||||
| #define MBEDTLS_ERR_PK_HW_ACCEL_FAILED     -0x3880  /*< PK hardware accelerator failed. */ | ||||
| 
 | ||||
| /**
 | ||||
|  * \brief          Public key types | ||||
|  | @ -136,8 +136,8 @@ typedef struct mbedtls_pk_info_t mbedtls_pk_info_t; | |||
|  */ | ||||
| typedef struct mbedtls_pk_context | ||||
| { | ||||
|     const mbedtls_pk_info_t *   pk_info; /**< Public key information         */ | ||||
|     void *                      pk_ctx;  /**< Underlying public key context  */ | ||||
|     const mbedtls_pk_info_t *   pk_info; /*< Public key information         */ | ||||
|     void *                      pk_ctx;  /*< Underlying public key context  */ | ||||
| } mbedtls_pk_context; | ||||
| 
 | ||||
| #if defined(MBEDTLS_ECDSA_C) && defined(MBEDTLS_ECP_RESTARTABLE) | ||||
|  | @ -146,8 +146,8 @@ typedef struct mbedtls_pk_context | |||
|  */ | ||||
| typedef struct | ||||
| { | ||||
|     const mbedtls_pk_info_t *   pk_info; /**< Public key information         */ | ||||
|     void *                      rs_ctx;  /**< Underlying restart context     */ | ||||
|     const mbedtls_pk_info_t *   pk_info; /*< Public key information         */ | ||||
|     void *                      rs_ctx;  /*< Underlying restart context     */ | ||||
| } mbedtls_pk_restart_ctx; | ||||
| #else /* MBEDTLS_ECDSA_C && MBEDTLS_ECP_RESTARTABLE */ | ||||
| /* Now we can declare functions that take a pointer to that */ | ||||
|  |  | |||
							
								
								
									
										8
									
								
								third_party/mbedtls/pkcs5.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								third_party/mbedtls/pkcs5.h
									
										
									
									
										vendored
									
									
								
							|  | @ -6,10 +6,10 @@ | |||
| COSMOPOLITAN_C_START_ | ||||
| /* clang-format off */ | ||||
| 
 | ||||
| #define MBEDTLS_ERR_PKCS5_BAD_INPUT_DATA                  -0x2f80  /**< Bad input parameters to function. */ | ||||
| #define MBEDTLS_ERR_PKCS5_INVALID_FORMAT                  -0x2f00  /**< Unexpected ASN.1 data. */ | ||||
| #define MBEDTLS_ERR_PKCS5_FEATURE_UNAVAILABLE             -0x2e80  /**< Requested encryption or digest alg not available. */ | ||||
| #define MBEDTLS_ERR_PKCS5_PASSWORD_MISMATCH               -0x2e00  /**< Given private key password does not allow for correct decryption. */ | ||||
| #define MBEDTLS_ERR_PKCS5_BAD_INPUT_DATA                  -0x2f80  /*< Bad input parameters to function. */ | ||||
| #define MBEDTLS_ERR_PKCS5_INVALID_FORMAT                  -0x2f00  /*< Unexpected ASN.1 data. */ | ||||
| #define MBEDTLS_ERR_PKCS5_FEATURE_UNAVAILABLE             -0x2e80  /*< Requested encryption or digest alg not available. */ | ||||
| #define MBEDTLS_ERR_PKCS5_PASSWORD_MISMATCH               -0x2e00  /*< Given private key password does not allow for correct decryption. */ | ||||
| 
 | ||||
| #define MBEDTLS_PKCS5_DECRYPT      0 | ||||
| #define MBEDTLS_PKCS5_ENCRYPT      1 | ||||
|  |  | |||
							
								
								
									
										6
									
								
								third_party/mbedtls/poly1305.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								third_party/mbedtls/poly1305.h
									
										
									
									
										vendored
									
									
								
							|  | @ -3,15 +3,15 @@ | |||
| #include "third_party/mbedtls/config.h" | ||||
| /* clang-format off */ | ||||
| 
 | ||||
| #define MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA         -0x0057 /**< Invalid input parameter(s). */ | ||||
| #define MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA         -0x0057 /*< Invalid input parameter(s). */ | ||||
| 
 | ||||
| /* MBEDTLS_ERR_POLY1305_FEATURE_UNAVAILABLE is deprecated and should not be
 | ||||
|  * used. */ | ||||
| #define MBEDTLS_ERR_POLY1305_FEATURE_UNAVAILABLE    -0x0059 /**< Feature not available. For example, s part of the API is not implemented. */ | ||||
| #define MBEDTLS_ERR_POLY1305_FEATURE_UNAVAILABLE    -0x0059 /*< Feature not available. For example, s part of the API is not implemented. */ | ||||
| 
 | ||||
| /* MBEDTLS_ERR_POLY1305_HW_ACCEL_FAILED is deprecated and should not be used.
 | ||||
|  */ | ||||
| #define MBEDTLS_ERR_POLY1305_HW_ACCEL_FAILED        -0x005B  /**< Poly1305 hardware accelerator failed. */ | ||||
| #define MBEDTLS_ERR_POLY1305_HW_ACCEL_FAILED        -0x005B  /*< Poly1305 hardware accelerator failed. */ | ||||
| 
 | ||||
| #ifdef __cplusplus | ||||
| extern "C" { | ||||
|  |  | |||
							
								
								
									
										34
									
								
								third_party/mbedtls/rsa.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										34
									
								
								third_party/mbedtls/rsa.h
									
										
									
									
										vendored
									
									
								
							|  | @ -10,34 +10,34 @@ COSMOPOLITAN_C_START_ | |||
| /*
 | ||||
|  * RSA Error codes | ||||
|  */ | ||||
| #define MBEDTLS_ERR_RSA_BAD_INPUT_DATA                    -0x4080  /**< Bad input parameters to function. */ | ||||
| #define MBEDTLS_ERR_RSA_INVALID_PADDING                   -0x4100  /**< Input data contains invalid padding and is rejected. */ | ||||
| #define MBEDTLS_ERR_RSA_KEY_GEN_FAILED                    -0x4180  /**< Something failed during generation of a key. */ | ||||
| #define MBEDTLS_ERR_RSA_KEY_CHECK_FAILED                  -0x4200  /**< Key failed to pass the validity check of the library. */ | ||||
| #define MBEDTLS_ERR_RSA_PUBLIC_FAILED                     -0x4280  /**< The public key operation failed. */ | ||||
| #define MBEDTLS_ERR_RSA_PRIVATE_FAILED                    -0x4300  /**< The private key operation failed. */ | ||||
| #define MBEDTLS_ERR_RSA_VERIFY_FAILED                     -0x4380  /**< The PKCS#1 verification failed. */ | ||||
| #define MBEDTLS_ERR_RSA_OUTPUT_TOO_LARGE                  -0x4400  /**< The output buffer for decryption is not large enough. */ | ||||
| #define MBEDTLS_ERR_RSA_RNG_FAILED                        -0x4480  /**< The random generator failed to generate non-zeros. */ | ||||
| #define MBEDTLS_ERR_RSA_BAD_INPUT_DATA                    -0x4080  /*< Bad input parameters to function. */ | ||||
| #define MBEDTLS_ERR_RSA_INVALID_PADDING                   -0x4100  /*< Input data contains invalid padding and is rejected. */ | ||||
| #define MBEDTLS_ERR_RSA_KEY_GEN_FAILED                    -0x4180  /*< Something failed during generation of a key. */ | ||||
| #define MBEDTLS_ERR_RSA_KEY_CHECK_FAILED                  -0x4200  /*< Key failed to pass the validity check of the library. */ | ||||
| #define MBEDTLS_ERR_RSA_PUBLIC_FAILED                     -0x4280  /*< The public key operation failed. */ | ||||
| #define MBEDTLS_ERR_RSA_PRIVATE_FAILED                    -0x4300  /*< The private key operation failed. */ | ||||
| #define MBEDTLS_ERR_RSA_VERIFY_FAILED                     -0x4380  /*< The PKCS#1 verification failed. */ | ||||
| #define MBEDTLS_ERR_RSA_OUTPUT_TOO_LARGE                  -0x4400  /*< The output buffer for decryption is not large enough. */ | ||||
| #define MBEDTLS_ERR_RSA_RNG_FAILED                        -0x4480  /*< The random generator failed to generate non-zeros. */ | ||||
| 
 | ||||
| /* MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION is deprecated and should not be used.
 | ||||
|  */ | ||||
| #define MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION             -0x4500  /**< The implementation does not offer the requested operation, for example, because of security violations or lack of functionality. */ | ||||
| #define MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION             -0x4500  /*< The implementation does not offer the requested operation, for example, because of security violations or lack of functionality. */ | ||||
| 
 | ||||
| /* MBEDTLS_ERR_RSA_HW_ACCEL_FAILED is deprecated and should not be used. */ | ||||
| #define MBEDTLS_ERR_RSA_HW_ACCEL_FAILED                   -0x4580  /**< RSA hardware accelerator failed. */ | ||||
| #define MBEDTLS_ERR_RSA_HW_ACCEL_FAILED                   -0x4580  /*< RSA hardware accelerator failed. */ | ||||
| 
 | ||||
| /*
 | ||||
|  * RSA constants | ||||
|  */ | ||||
| #define MBEDTLS_RSA_PUBLIC      0 /**< Request private key operation. */ | ||||
| #define MBEDTLS_RSA_PRIVATE     1 /**< Request public key operation. */ | ||||
| #define MBEDTLS_RSA_PUBLIC      0 /*< Request private key operation. */ | ||||
| #define MBEDTLS_RSA_PRIVATE     1 /*< Request public key operation. */ | ||||
| 
 | ||||
| #define MBEDTLS_RSA_PKCS_V15    0 /**< Use PKCS#1 v1.5 encoding. */ | ||||
| #define MBEDTLS_RSA_PKCS_V21    1 /**< Use PKCS#1 v2.1 encoding. */ | ||||
| #define MBEDTLS_RSA_PKCS_V15    0 /*< Use PKCS#1 v1.5 encoding. */ | ||||
| #define MBEDTLS_RSA_PKCS_V21    1 /*< Use PKCS#1 v2.1 encoding. */ | ||||
| 
 | ||||
| #define MBEDTLS_RSA_SIGN        1 /**< Identifier for RSA signature operations. */ | ||||
| #define MBEDTLS_RSA_CRYPT       2 /**< Identifier for RSA encryption and decryption operations. */ | ||||
| #define MBEDTLS_RSA_SIGN        1 /*< Identifier for RSA signature operations. */ | ||||
| #define MBEDTLS_RSA_CRYPT       2 /*< Identifier for RSA encryption and decryption operations. */ | ||||
| 
 | ||||
| #define MBEDTLS_RSA_SALT_LEN_ANY    -1 | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										4
									
								
								third_party/mbedtls/sha1.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								third_party/mbedtls/sha1.h
									
										
									
									
										vendored
									
									
								
							|  | @ -6,8 +6,8 @@ COSMOPOLITAN_C_START_ | |||
| /* clang-format off */ | ||||
| 
 | ||||
| /* MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED is deprecated and should not be used. */ | ||||
| #define MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED  -0x0035  /**< SHA-1 hardware accelerator failed */ | ||||
| #define MBEDTLS_ERR_SHA1_BAD_INPUT_DATA   -0x0073  /**< SHA-1 input data was malformed. */ | ||||
| #define MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED  -0x0035  /*< SHA-1 hardware accelerator failed */ | ||||
| #define MBEDTLS_ERR_SHA1_BAD_INPUT_DATA   -0x0073  /*< SHA-1 input data was malformed. */ | ||||
| 
 | ||||
| /**
 | ||||
|  * \brief          The SHA-1 context structure. | ||||
|  |  | |||
							
								
								
									
										4
									
								
								third_party/mbedtls/sha256.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								third_party/mbedtls/sha256.h
									
										
									
									
										vendored
									
									
								
							|  | @ -5,8 +5,8 @@ | |||
| COSMOPOLITAN_C_START_ | ||||
| /* clang-format off */ | ||||
| 
 | ||||
| #define MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED                -0x0037  /**< SHA-256 hardware accelerator failed */ | ||||
| #define MBEDTLS_ERR_SHA256_BAD_INPUT_DATA                 -0x0074  /**< SHA-256 input data was malformed. */ | ||||
| #define MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED                -0x0037  /*< SHA-256 hardware accelerator failed */ | ||||
| #define MBEDTLS_ERR_SHA256_BAD_INPUT_DATA                 -0x0074  /*< SHA-256 input data was malformed. */ | ||||
| 
 | ||||
| /**
 | ||||
|  * \brief          The SHA-256 context structure. | ||||
|  |  | |||
							
								
								
									
										4
									
								
								third_party/mbedtls/sha512.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								third_party/mbedtls/sha512.h
									
										
									
									
										vendored
									
									
								
							|  | @ -5,8 +5,8 @@ | |||
| COSMOPOLITAN_C_START_ | ||||
| /* clang-format off */ | ||||
| 
 | ||||
| #define MBEDTLS_ERR_SHA512_HW_ACCEL_FAILED -0x0039  /**< SHA-512 hardware accelerator failed */ | ||||
| #define MBEDTLS_ERR_SHA512_BAD_INPUT_DATA  -0x0075  /**< SHA-512 input data was malformed. */ | ||||
| #define MBEDTLS_ERR_SHA512_HW_ACCEL_FAILED -0x0039  /*< SHA-512 hardware accelerator failed */ | ||||
| #define MBEDTLS_ERR_SHA512_BAD_INPUT_DATA  -0x0075  /*< SHA-512 input data was malformed. */ | ||||
| 
 | ||||
| /**
 | ||||
|  * \brief          The SHA-512 context structure. | ||||
|  |  | |||
							
								
								
									
										150
									
								
								third_party/mbedtls/ssl.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										150
									
								
								third_party/mbedtls/ssl.h
									
										
									
									
										vendored
									
									
								
							|  | @ -12,81 +12,81 @@ | |||
| COSMOPOLITAN_C_START_ | ||||
| /* clang-format off */ | ||||
| 
 | ||||
| #define MBEDTLS_ERR_NET_SOCKET_FAILED                     -0x0042  /**< Failed to open a socket. */ | ||||
| #define MBEDTLS_ERR_NET_CONNECT_FAILED                    -0x0044  /**< The connection to the given server / port failed. */ | ||||
| #define MBEDTLS_ERR_NET_BIND_FAILED                       -0x0046  /**< Binding of the socket failed. */ | ||||
| #define MBEDTLS_ERR_NET_LISTEN_FAILED                     -0x0048  /**< Could not listen on the socket. */ | ||||
| #define MBEDTLS_ERR_NET_ACCEPT_FAILED                     -0x004A  /**< Could not accept the incoming connection. */ | ||||
| #define MBEDTLS_ERR_NET_RECV_FAILED                       -0x004C  /**< Reading information from the socket failed. */ | ||||
| #define MBEDTLS_ERR_NET_SEND_FAILED                       -0x004E  /**< Sending information through the socket failed. */ | ||||
| #define MBEDTLS_ERR_NET_CONN_RESET                        -0x0050  /**< Connection was reset by peer. */ | ||||
| #define MBEDTLS_ERR_NET_UNKNOWN_HOST                      -0x0052  /**< Failed to get an IP address for the given hostname. */ | ||||
| #define MBEDTLS_ERR_NET_BUFFER_TOO_SMALL                  -0x0043  /**< Buffer is too small to hold the data. */ | ||||
| #define MBEDTLS_ERR_NET_INVALID_CONTEXT                   -0x0045  /**< The context is invalid, eg because it was free()ed. */ | ||||
| #define MBEDTLS_ERR_NET_POLL_FAILED                       -0x0047  /**< Polling the net context failed. */ | ||||
| #define MBEDTLS_ERR_NET_BAD_INPUT_DATA                    -0x0049  /**< Input invalid. */ | ||||
| #define MBEDTLS_ERR_NET_SOCKET_FAILED                     -0x0042  /*< Failed to open a socket. */ | ||||
| #define MBEDTLS_ERR_NET_CONNECT_FAILED                    -0x0044  /*< The connection to the given server / port failed. */ | ||||
| #define MBEDTLS_ERR_NET_BIND_FAILED                       -0x0046  /*< Binding of the socket failed. */ | ||||
| #define MBEDTLS_ERR_NET_LISTEN_FAILED                     -0x0048  /*< Could not listen on the socket. */ | ||||
| #define MBEDTLS_ERR_NET_ACCEPT_FAILED                     -0x004A  /*< Could not accept the incoming connection. */ | ||||
| #define MBEDTLS_ERR_NET_RECV_FAILED                       -0x004C  /*< Reading information from the socket failed. */ | ||||
| #define MBEDTLS_ERR_NET_SEND_FAILED                       -0x004E  /*< Sending information through the socket failed. */ | ||||
| #define MBEDTLS_ERR_NET_CONN_RESET                        -0x0050  /*< Connection was reset by peer. */ | ||||
| #define MBEDTLS_ERR_NET_UNKNOWN_HOST                      -0x0052  /*< Failed to get an IP address for the given hostname. */ | ||||
| #define MBEDTLS_ERR_NET_BUFFER_TOO_SMALL                  -0x0043  /*< Buffer is too small to hold the data. */ | ||||
| #define MBEDTLS_ERR_NET_INVALID_CONTEXT                   -0x0045  /*< The context is invalid, eg because it was free()ed. */ | ||||
| #define MBEDTLS_ERR_NET_POLL_FAILED                       -0x0047  /*< Polling the net context failed. */ | ||||
| #define MBEDTLS_ERR_NET_BAD_INPUT_DATA                    -0x0049  /*< Input invalid. */ | ||||
| 
 | ||||
| /*
 | ||||
|  * SSL Error codes | ||||
|  */ | ||||
| #define MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE               -0x7080  /**< The requested feature is not available. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_INPUT_DATA                    -0x7100  /**< Bad input parameters to function. */ | ||||
| #define MBEDTLS_ERR_SSL_INVALID_MAC                       -0x7180  /**< Verification of the message MAC failed. */ | ||||
| #define MBEDTLS_ERR_SSL_INVALID_RECORD                    -0x7200  /**< An invalid SSL record was received. */ | ||||
| #define MBEDTLS_ERR_SSL_CONN_EOF                          -0x7280  /**< The connection indicated an EOF. */ | ||||
| #define MBEDTLS_ERR_SSL_UNKNOWN_CIPHER                    -0x7300  /**< An unknown cipher was received. */ | ||||
| #define MBEDTLS_ERR_SSL_NO_CIPHER_CHOSEN                  -0x7380  /**< The server has no ciphersuites in common with the client. */ | ||||
| #define MBEDTLS_ERR_SSL_NO_RNG                            -0x7400  /**< No RNG was provided to the SSL module. */ | ||||
| #define MBEDTLS_ERR_SSL_NO_CLIENT_CERTIFICATE             -0x7480  /**< No client certification received from the client, but required by the authentication mode. */ | ||||
| #define MBEDTLS_ERR_SSL_CERTIFICATE_TOO_LARGE             -0x7500  /**< Our own certificate(s) is/are too large to send in an SSL message. */ | ||||
| #define MBEDTLS_ERR_SSL_CERTIFICATE_REQUIRED              -0x7580  /**< The own certificate is not set, but needed by the server. */ | ||||
| #define MBEDTLS_ERR_SSL_PRIVATE_KEY_REQUIRED              -0x7600  /**< The own private key or pre-shared key is not set, but needed. */ | ||||
| #define MBEDTLS_ERR_SSL_CA_CHAIN_REQUIRED                 -0x7680  /**< No CA Chain is set, but required to operate. */ | ||||
| #define MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE                -0x7700  /**< An unexpected message was received from our peer. */ | ||||
| #define MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE               -0x7780  /**< A fatal alert message was received from our peer. */ | ||||
| #define MBEDTLS_ERR_SSL_PEER_VERIFY_FAILED                -0x7800  /**< Verification of our peer failed. */ | ||||
| #define MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY                 -0x7880  /**< The peer notified us that the connection is going to be closed. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_HELLO               -0x7900  /**< Processing of the ClientHello handshake message failed. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO               -0x7980  /**< Processing of the ServerHello handshake message failed. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE                -0x7A00  /**< Processing of the Certificate handshake message failed. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_REQUEST        -0x7A80  /**< Processing of the CertificateRequest handshake message failed. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_SERVER_KEY_EXCHANGE        -0x7B00  /**< Processing of the ServerKeyExchange handshake message failed. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO_DONE          -0x7B80  /**< Processing of the ServerHelloDone handshake message failed. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE        -0x7C00  /**< Processing of the ClientKeyExchange handshake message failed. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_RP     -0x7C80  /**< Processing of the ClientKeyExchange handshake message failed in DHM / ECDH Read Public. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_CS     -0x7D00  /**< Processing of the ClientKeyExchange handshake message failed in DHM / ECDH Calculate Secret. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_VERIFY         -0x7D80  /**< Processing of the CertificateVerify handshake message failed. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_CHANGE_CIPHER_SPEC         -0x7E00  /**< Processing of the ChangeCipherSpec handshake message failed. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_FINISHED                   -0x7E80  /**< Processing of the Finished handshake message failed. */ | ||||
| #define MBEDTLS_ERR_SSL_ALLOC_FAILED                      -0x7F00  /**< Memory allocation failed */ | ||||
| #define MBEDTLS_ERR_SSL_HW_ACCEL_FAILED                   -0x7F80  /**< Hardware acceleration function returned with error */ | ||||
| #define MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH              -0x6F80  /**< Hardware acceleration function skipped / left alone data */ | ||||
| #define MBEDTLS_ERR_SSL_COMPRESSION_FAILED                -0x6F00  /**< Processing of the compression / decompression failed */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_PROTOCOL_VERSION           -0x6E80  /**< Handshake protocol not within min/max boundaries */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_NEW_SESSION_TICKET         -0x6E00  /**< Processing of the NewSessionTicket handshake message failed. */ | ||||
| #define MBEDTLS_ERR_SSL_SESSION_TICKET_EXPIRED            -0x6D80  /**< Session ticket has expired. */ | ||||
| #define MBEDTLS_ERR_SSL_PK_TYPE_MISMATCH                  -0x6D00  /**< Public key type mismatch (eg, asked for RSA key exchange and presented EC key) */ | ||||
| #define MBEDTLS_ERR_SSL_UNKNOWN_IDENTITY                  -0x6C80  /**< Unknown identity received (eg, PSK identity) */ | ||||
| #define MBEDTLS_ERR_SSL_INTERNAL_ERROR                    -0x6C00  /**< Internal error (eg, unexpected failure in lower-level module) */ | ||||
| #define MBEDTLS_ERR_SSL_COUNTER_WRAPPING                  -0x6B80  /**< A counter would wrap (eg, too many messages exchanged). */ | ||||
| #define MBEDTLS_ERR_SSL_WAITING_SERVER_HELLO_RENEGO       -0x6B00  /**< Unexpected message at ServerHello in renegotiation. */ | ||||
| #define MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED             -0x6A80  /**< DTLS client must retry for hello verification */ | ||||
| #define MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL                  -0x6A00  /**< A buffer is too small to receive or write a message */ | ||||
| #define MBEDTLS_ERR_SSL_NO_USABLE_CIPHERSUITE             -0x6980  /**< None of the common ciphersuites is usable (eg, no suitable certificate, see debug messages). */ | ||||
| #define MBEDTLS_ERR_SSL_WANT_READ                         -0x6900  /**< No data of requested type currently available on underlying transport. */ | ||||
| #define MBEDTLS_ERR_SSL_WANT_WRITE                        -0x6880  /**< Connection requires a write call. */ | ||||
| #define MBEDTLS_ERR_SSL_TIMEOUT                           -0x6800  /**< The operation timed out. */ | ||||
| #define MBEDTLS_ERR_SSL_CLIENT_RECONNECT                  -0x6780  /**< The client initiated a reconnect from the same port. */ | ||||
| #define MBEDTLS_ERR_SSL_UNEXPECTED_RECORD                 -0x6700  /**< Record header looks valid but is not expected. */ | ||||
| #define MBEDTLS_ERR_SSL_NON_FATAL                         -0x6680  /**< The alert message received indicates a non-fatal error. */ | ||||
| #define MBEDTLS_ERR_SSL_INVALID_VERIFY_HASH               -0x6600  /**< Couldn't set the hash for verifying CertificateVerify */ | ||||
| #define MBEDTLS_ERR_SSL_CONTINUE_PROCESSING               -0x6580  /**< Internal-only message signaling that further message-processing should be done */ | ||||
| #define MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS                 -0x6500  /**< The asynchronous operation is not completed yet. */ | ||||
| #define MBEDTLS_ERR_SSL_EARLY_MESSAGE                     -0x6480  /**< Internal-only message signaling that a message arrived early. */ | ||||
| #define MBEDTLS_ERR_SSL_UNEXPECTED_CID                    -0x6000  /**< An encrypted DTLS-frame with an unexpected CID was received. */ | ||||
| #define MBEDTLS_ERR_SSL_VERSION_MISMATCH                  -0x5F00  /**< An operation failed due to an unexpected version or configuration. */ | ||||
| #define MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS                -0x7000  /**< A cryptographic operation is in progress. Try again later. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_CONFIG                        -0x5E80  /**< Invalid value in SSL config */ | ||||
| #define MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE               -0x7080  /*< The requested feature is not available. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_INPUT_DATA                    -0x7100  /*< Bad input parameters to function. */ | ||||
| #define MBEDTLS_ERR_SSL_INVALID_MAC                       -0x7180  /*< Verification of the message MAC failed. */ | ||||
| #define MBEDTLS_ERR_SSL_INVALID_RECORD                    -0x7200  /*< An invalid SSL record was received. */ | ||||
| #define MBEDTLS_ERR_SSL_CONN_EOF                          -0x7280  /*< The connection indicated an EOF. */ | ||||
| #define MBEDTLS_ERR_SSL_UNKNOWN_CIPHER                    -0x7300  /*< An unknown cipher was received. */ | ||||
| #define MBEDTLS_ERR_SSL_NO_CIPHER_CHOSEN                  -0x7380  /*< The server has no ciphersuites in common with the client. */ | ||||
| #define MBEDTLS_ERR_SSL_NO_RNG                            -0x7400  /*< No RNG was provided to the SSL module. */ | ||||
| #define MBEDTLS_ERR_SSL_NO_CLIENT_CERTIFICATE             -0x7480  /*< No client certification received from the client, but required by the authentication mode. */ | ||||
| #define MBEDTLS_ERR_SSL_CERTIFICATE_TOO_LARGE             -0x7500  /*< Our own certificate(s) is/are too large to send in an SSL message. */ | ||||
| #define MBEDTLS_ERR_SSL_CERTIFICATE_REQUIRED              -0x7580  /*< The own certificate is not set, but needed by the server. */ | ||||
| #define MBEDTLS_ERR_SSL_PRIVATE_KEY_REQUIRED              -0x7600  /*< The own private key or pre-shared key is not set, but needed. */ | ||||
| #define MBEDTLS_ERR_SSL_CA_CHAIN_REQUIRED                 -0x7680  /*< No CA Chain is set, but required to operate. */ | ||||
| #define MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE                -0x7700  /*< An unexpected message was received from our peer. */ | ||||
| #define MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE               -0x7780  /*< A fatal alert message was received from our peer. */ | ||||
| #define MBEDTLS_ERR_SSL_PEER_VERIFY_FAILED                -0x7800  /*< Verification of our peer failed. */ | ||||
| #define MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY                 -0x7880  /*< The peer notified us that the connection is going to be closed. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_HELLO               -0x7900  /*< Processing of the ClientHello handshake message failed. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO               -0x7980  /*< Processing of the ServerHello handshake message failed. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE                -0x7A00  /*< Processing of the Certificate handshake message failed. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_REQUEST        -0x7A80  /*< Processing of the CertificateRequest handshake message failed. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_SERVER_KEY_EXCHANGE        -0x7B00  /*< Processing of the ServerKeyExchange handshake message failed. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO_DONE          -0x7B80  /*< Processing of the ServerHelloDone handshake message failed. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE        -0x7C00  /*< Processing of the ClientKeyExchange handshake message failed. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_RP     -0x7C80  /*< Processing of the ClientKeyExchange handshake message failed in DHM / ECDH Read Public. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_CS     -0x7D00  /*< Processing of the ClientKeyExchange handshake message failed in DHM / ECDH Calculate Secret. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_VERIFY         -0x7D80  /*< Processing of the CertificateVerify handshake message failed. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_CHANGE_CIPHER_SPEC         -0x7E00  /*< Processing of the ChangeCipherSpec handshake message failed. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_FINISHED                   -0x7E80  /*< Processing of the Finished handshake message failed. */ | ||||
| #define MBEDTLS_ERR_SSL_ALLOC_FAILED                      -0x7F00  /*< Memory allocation failed */ | ||||
| #define MBEDTLS_ERR_SSL_HW_ACCEL_FAILED                   -0x7F80  /*< Hardware acceleration function returned with error */ | ||||
| #define MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH              -0x6F80  /*< Hardware acceleration function skipped / left alone data */ | ||||
| #define MBEDTLS_ERR_SSL_COMPRESSION_FAILED                -0x6F00  /*< Processing of the compression / decompression failed */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_PROTOCOL_VERSION           -0x6E80  /*< Handshake protocol not within min/max boundaries */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_HS_NEW_SESSION_TICKET         -0x6E00  /*< Processing of the NewSessionTicket handshake message failed. */ | ||||
| #define MBEDTLS_ERR_SSL_SESSION_TICKET_EXPIRED            -0x6D80  /*< Session ticket has expired. */ | ||||
| #define MBEDTLS_ERR_SSL_PK_TYPE_MISMATCH                  -0x6D00  /*< Public key type mismatch (eg, asked for RSA key exchange and presented EC key) */ | ||||
| #define MBEDTLS_ERR_SSL_UNKNOWN_IDENTITY                  -0x6C80  /*< Unknown identity received (eg, PSK identity) */ | ||||
| #define MBEDTLS_ERR_SSL_INTERNAL_ERROR                    -0x6C00  /*< Internal error (eg, unexpected failure in lower-level module) */ | ||||
| #define MBEDTLS_ERR_SSL_COUNTER_WRAPPING                  -0x6B80  /*< A counter would wrap (eg, too many messages exchanged). */ | ||||
| #define MBEDTLS_ERR_SSL_WAITING_SERVER_HELLO_RENEGO       -0x6B00  /*< Unexpected message at ServerHello in renegotiation. */ | ||||
| #define MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED             -0x6A80  /*< DTLS client must retry for hello verification */ | ||||
| #define MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL                  -0x6A00  /*< A buffer is too small to receive or write a message */ | ||||
| #define MBEDTLS_ERR_SSL_NO_USABLE_CIPHERSUITE             -0x6980  /*< None of the common ciphersuites is usable (eg, no suitable certificate, see debug messages). */ | ||||
| #define MBEDTLS_ERR_SSL_WANT_READ                         -0x6900  /*< No data of requested type currently available on underlying transport. */ | ||||
| #define MBEDTLS_ERR_SSL_WANT_WRITE                        -0x6880  /*< Connection requires a write call. */ | ||||
| #define MBEDTLS_ERR_SSL_TIMEOUT                           -0x6800  /*< The operation timed out. */ | ||||
| #define MBEDTLS_ERR_SSL_CLIENT_RECONNECT                  -0x6780  /*< The client initiated a reconnect from the same port. */ | ||||
| #define MBEDTLS_ERR_SSL_UNEXPECTED_RECORD                 -0x6700  /*< Record header looks valid but is not expected. */ | ||||
| #define MBEDTLS_ERR_SSL_NON_FATAL                         -0x6680  /*< The alert message received indicates a non-fatal error. */ | ||||
| #define MBEDTLS_ERR_SSL_INVALID_VERIFY_HASH               -0x6600  /*< Couldn't set the hash for verifying CertificateVerify */ | ||||
| #define MBEDTLS_ERR_SSL_CONTINUE_PROCESSING               -0x6580  /*< Internal-only message signaling that further message-processing should be done */ | ||||
| #define MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS                 -0x6500  /*< The asynchronous operation is not completed yet. */ | ||||
| #define MBEDTLS_ERR_SSL_EARLY_MESSAGE                     -0x6480  /*< Internal-only message signaling that a message arrived early. */ | ||||
| #define MBEDTLS_ERR_SSL_UNEXPECTED_CID                    -0x6000  /*< An encrypted DTLS-frame with an unexpected CID was received. */ | ||||
| #define MBEDTLS_ERR_SSL_VERSION_MISMATCH                  -0x5F00  /*< An operation failed due to an unexpected version or configuration. */ | ||||
| #define MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS                -0x7000  /*< A cryptographic operation is in progress. Try again later. */ | ||||
| #define MBEDTLS_ERR_SSL_BAD_CONFIG                        -0x5E80  /*< Invalid value in SSL config */ | ||||
| 
 | ||||
| /*
 | ||||
|  * Various constants | ||||
|  | @ -196,7 +196,7 @@ COSMOPOLITAN_C_START_ | |||
|  */ | ||||
| 
 | ||||
| #if !defined(MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME) | ||||
| #define MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME     86400 /**< Lifetime of session tickets (if enabled) */ | ||||
| #define MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME     86400 /*< Lifetime of session tickets (if enabled) */ | ||||
| #endif | ||||
| 
 | ||||
| /*
 | ||||
|  | @ -211,7 +211,7 @@ COSMOPOLITAN_C_START_ | |||
|  * peers are using it too! | ||||
|  */ | ||||
| #if !defined(MBEDTLS_SSL_MAX_CONTENT_LEN) | ||||
| #define MBEDTLS_SSL_MAX_CONTENT_LEN         16384   /**< Size of the input / output buffer */ | ||||
| #define MBEDTLS_SSL_MAX_CONTENT_LEN         16384   /*< Size of the input / output buffer */ | ||||
| #endif | ||||
| 
 | ||||
| #if !defined(MBEDTLS_SSL_IN_CONTENT_LEN) | ||||
|  | @ -261,8 +261,8 @@ COSMOPOLITAN_C_START_ | |||
| /*
 | ||||
|  * Signaling ciphersuite values (SCSV) | ||||
|  */ | ||||
| #define MBEDTLS_SSL_EMPTY_RENEGOTIATION_INFO    0xFF   /**< renegotiation info ext */ | ||||
| #define MBEDTLS_SSL_FALLBACK_SCSV_VALUE         0x5600 /**< RFC 7507 section 2 */ | ||||
| #define MBEDTLS_SSL_EMPTY_RENEGOTIATION_INFO    0xFF   /*< renegotiation info ext */ | ||||
| #define MBEDTLS_SSL_FALLBACK_SCSV_VALUE         0x5600 /*< RFC 7507 section 2 */ | ||||
| 
 | ||||
| /*
 | ||||
|  * Supported Signature and Hash algorithms (For TLS 1.2) | ||||
|  |  | |||
							
								
								
									
										356
									
								
								third_party/mbedtls/ssl_ciphersuites.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										356
									
								
								third_party/mbedtls/ssl_ciphersuites.h
									
										
									
									
										vendored
									
									
								
							|  | @ -10,36 +10,36 @@ COSMOPOLITAN_C_START_ | |||
| /*
 | ||||
|  * Supported ciphersuites (Official IANA names) | ||||
|  */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_NULL_MD5                    0x0001   /**< Weak! */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_NULL_SHA                    0x0002   /**< Weak! */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_NULL_MD5                    0x0001   /*< Weak! */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_NULL_SHA                    0x0002   /*< Weak! */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_RSA_WITH_RC4_128_MD5                 0x0004 | ||||
| #define MBEDTLS_TLS_RSA_WITH_RC4_128_SHA                 0x0005 | ||||
| #define MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA                 0x0009   /**< Weak! Not in TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA                 0x0009   /*< Weak! Not in TLS 1.2 */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA            0x000A | ||||
| 
 | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA             0x0015   /**< Weak! Not in TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA             0x0015   /*< Weak! Not in TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA        0x0016 | ||||
| 
 | ||||
| #define MBEDTLS_TLS_PSK_WITH_NULL_SHA                    0x002C   /**< Weak! */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA                0x002D   /**< Weak! */ | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA                0x002E   /**< Weak! */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_NULL_SHA                    0x002C   /*< Weak! */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA                0x002D   /*< Weak! */ | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA                0x002E   /*< Weak! */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA             0x002F | ||||
| 
 | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA         0x0033 | ||||
| #define MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA             0x0035 | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA         0x0039 | ||||
| 
 | ||||
| #define MBEDTLS_TLS_RSA_WITH_NULL_SHA256                 0x003B   /**< Weak! */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256          0x003C   /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256          0x003D   /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_NULL_SHA256                 0x003B   /*< Weak! */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256          0x003C   /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256          0x003D   /*< TLS 1.2 */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA        0x0041 | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA    0x0045 | ||||
| 
 | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256      0x0067   /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256      0x006B   /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256      0x0067   /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256      0x006B   /*< TLS 1.2 */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA        0x0084 | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA    0x0088 | ||||
|  | @ -59,158 +59,158 @@ COSMOPOLITAN_C_START_ | |||
| #define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA         0x0094 | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA         0x0095 | ||||
| 
 | ||||
| #define MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256          0x009C   /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384          0x009D   /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256      0x009E   /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384      0x009F   /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256          0x009C   /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384          0x009D   /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256      0x009E   /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384      0x009F   /*< TLS 1.2 */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256          0x00A8   /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384          0x00A9   /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256      0x00AA   /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384      0x00AB   /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256      0x00AC   /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384      0x00AD   /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256          0x00A8   /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384          0x00A9   /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256      0x00AA   /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384      0x00AB   /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256      0x00AC   /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384      0x00AD   /*< TLS 1.2 */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256          0x00AE | ||||
| #define MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384          0x00AF | ||||
| #define MBEDTLS_TLS_PSK_WITH_NULL_SHA256                 0x00B0   /**< Weak! */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_NULL_SHA384                 0x00B1   /**< Weak! */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_NULL_SHA256                 0x00B0   /*< Weak! */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_NULL_SHA384                 0x00B1   /*< Weak! */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256      0x00B2 | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384      0x00B3 | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256             0x00B4   /**< Weak! */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384             0x00B5   /**< Weak! */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256             0x00B4   /*< Weak! */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384             0x00B5   /*< Weak! */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256      0x00B6 | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384      0x00B7 | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256             0x00B8   /**< Weak! */ | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384             0x00B9   /**< Weak! */ | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256             0x00B8   /*< Weak! */ | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384             0x00B9   /*< Weak! */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256     0x00BA   /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 0x00BE   /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256     0x00BA   /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 0x00BE   /*< TLS 1.2 */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256     0x00C0   /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 0x00C4   /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256     0x00C0   /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 0x00C4   /*< TLS 1.2 */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA             0xC001 /**< Weak! */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA          0xC002 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA     0xC003 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA      0xC004 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA      0xC005 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA             0xC001 /*< Weak! */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA          0xC002 /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA     0xC003 /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA      0xC004 /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA      0xC005 /*< Not in SSL3! */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA            0xC006 /**< Weak! */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA         0xC007 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA    0xC008 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA     0xC009 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA     0xC00A /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA            0xC006 /*< Weak! */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA         0xC007 /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA    0xC008 /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA     0xC009 /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA     0xC00A /*< Not in SSL3! */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA               0xC00B /**< Weak! */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA            0xC00C /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA       0xC00D /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA        0xC00E /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA        0xC00F /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA               0xC00B /*< Weak! */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA            0xC00C /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA       0xC00D /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA        0xC00E /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA        0xC00F /*< Not in SSL3! */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA              0xC010 /**< Weak! */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA           0xC011 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA      0xC012 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA       0xC013 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA       0xC014 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA              0xC010 /*< Weak! */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA           0xC011 /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA      0xC012 /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA       0xC013 /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA       0xC014 /*< Not in SSL3! */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256  0xC023 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384  0xC024 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256   0xC025 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384   0xC026 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256    0xC027 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384    0xC028 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256     0xC029 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384     0xC02A /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256  0xC023 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384  0xC024 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256   0xC025 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384   0xC026 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256    0xC027 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384    0xC028 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256     0xC029 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384     0xC02A /*< TLS 1.2 */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256  0xC02B /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384  0xC02C /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256   0xC02D /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384   0xC02E /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256    0xC02F /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384    0xC030 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256     0xC031 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384     0xC032 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256  0xC02B /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384  0xC02C /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256   0xC02D /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384   0xC02E /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256    0xC02F /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384    0xC030 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256     0xC031 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384     0xC032 /*< TLS 1.2 */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA           0xC033 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA      0xC034 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA       0xC035 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA       0xC036 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256    0xC037 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384    0xC038 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA              0xC039 /**< Weak! No SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256           0xC03A /**< Weak! No SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384           0xC03B /**< Weak! No SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA           0xC033 /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA      0xC034 /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA       0xC035 /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA       0xC036 /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256    0xC037 /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384    0xC038 /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA              0xC039 /*< Weak! No SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256           0xC03A /*< Weak! No SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384           0xC03B /*< Weak! No SSL3! */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_RSA_WITH_ARIA_128_CBC_SHA256         0xC03C /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_ARIA_256_CBC_SHA384         0xC03D /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256     0xC044 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384     0xC045 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256 0xC048 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384 0xC049 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256  0xC04A /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384  0xC04B /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256   0xC04C /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384   0xC04D /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256    0xC04E /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384    0xC04F /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_ARIA_128_GCM_SHA256         0xC050 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_ARIA_256_GCM_SHA384         0xC051 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256     0xC052 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384     0xC053 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 0xC05C /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 0xC05D /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256  0xC05E /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384  0xC05F /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256   0xC060 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384   0xC061 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256    0xC062 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384    0xC063 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_ARIA_128_CBC_SHA256         0xC064 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_ARIA_256_CBC_SHA384         0xC065 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256     0xC066 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384     0xC067 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256     0xC068 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384     0xC069 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_ARIA_128_GCM_SHA256         0xC06A /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_ARIA_256_GCM_SHA384         0xC06B /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256     0xC06C /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384     0xC06D /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256     0xC06E /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384     0xC06F /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256   0xC070 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384   0xC071 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_ARIA_128_CBC_SHA256         0xC03C /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_ARIA_256_CBC_SHA384         0xC03D /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256     0xC044 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384     0xC045 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256 0xC048 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384 0xC049 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256  0xC04A /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384  0xC04B /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256   0xC04C /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384   0xC04D /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256    0xC04E /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384    0xC04F /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_ARIA_128_GCM_SHA256         0xC050 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_ARIA_256_GCM_SHA384         0xC051 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256     0xC052 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384     0xC053 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 0xC05C /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 0xC05D /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256  0xC05E /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384  0xC05F /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256   0xC060 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384   0xC061 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256    0xC062 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384    0xC063 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_ARIA_128_CBC_SHA256         0xC064 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_ARIA_256_CBC_SHA384         0xC065 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256     0xC066 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384     0xC067 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256     0xC068 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384     0xC069 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_ARIA_128_GCM_SHA256         0xC06A /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_ARIA_256_GCM_SHA384         0xC06B /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256     0xC06C /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384     0xC06D /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256     0xC06E /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384     0xC06F /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256   0xC070 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384   0xC071 /*< TLS 1.2 */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 0xC072 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 0xC073 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256  0xC074 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384  0xC075 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256   0xC076 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384   0xC077 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256    0xC078 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384    0xC079 /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 0xC072 /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 0xC073 /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256  0xC074 /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384  0xC075 /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256   0xC076 /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384   0xC077 /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256    0xC078 /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384    0xC079 /*< Not in SSL3! */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256         0xC07A /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384         0xC07B /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256     0xC07C /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384     0xC07D /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 0xC086 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 0xC087 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256  0xC088 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384  0xC089 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256   0xC08A /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384   0xC08B /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256    0xC08C /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384    0xC08D /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256         0xC07A /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384         0xC07B /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256     0xC07C /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384     0xC07D /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 0xC086 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 0xC087 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256  0xC088 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384  0xC089 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256   0xC08A /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384   0xC08B /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256    0xC08C /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384    0xC08D /*< TLS 1.2 */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256       0xC08E /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384       0xC08F /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256   0xC090 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384   0xC091 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256   0xC092 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384   0xC093 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256       0xC08E /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384       0xC08F /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256   0xC090 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384   0xC091 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256   0xC092 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384   0xC093 /*< TLS 1.2 */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256       0xC094 | ||||
| #define MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384       0xC095 | ||||
|  | @ -218,48 +218,48 @@ COSMOPOLITAN_C_START_ | |||
| #define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384   0xC097 | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256   0xC098 | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384   0xC099 | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC09A /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC09B /**< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC09A /*< Not in SSL3! */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC09B /*< Not in SSL3! */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_RSA_WITH_AES_128_CCM                0xC09C  /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_AES_256_CCM                0xC09D  /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM            0xC09E  /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM            0xC09F  /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_AES_128_CCM_8              0xC0A0  /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_AES_256_CCM_8              0xC0A1  /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM_8          0xC0A2  /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM_8          0xC0A3  /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_AES_128_CCM                0xC0A4  /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_AES_256_CCM                0xC0A5  /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM            0xC0A6  /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM            0xC0A7  /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8              0xC0A8  /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8              0xC0A9  /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM_8          0xC0AA  /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM_8          0xC0AB  /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_AES_128_CCM                0xC09C  /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_AES_256_CCM                0xC09D  /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM            0xC09E  /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM            0xC09F  /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_AES_128_CCM_8              0xC0A0  /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_WITH_AES_256_CCM_8              0xC0A1  /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM_8          0xC0A2  /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM_8          0xC0A3  /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_AES_128_CCM                0xC0A4  /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_AES_256_CCM                0xC0A5  /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM            0xC0A6  /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM            0xC0A7  /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8              0xC0A8  /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8              0xC0A9  /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM_8          0xC0AA  /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM_8          0xC0AB  /*< TLS 1.2 */ | ||||
| /* The last two are named with PSK_DHE in the RFC, which looks like a typo */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM        0xC0AC  /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM        0xC0AD  /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8      0xC0AE  /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8      0xC0AF  /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM        0xC0AC  /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM        0xC0AD  /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8      0xC0AE  /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8      0xC0AF  /*< TLS 1.2 */ | ||||
| 
 | ||||
| #define MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8          0xC0FF  /**< experimental */ | ||||
| #define MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8          0xC0FF  /*< experimental */ | ||||
| 
 | ||||
| /* RFC 7905 */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256   0xCCA8 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 0xCCA9 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256     0xCCAA /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_CHACHA20_POLY1305_SHA256         0xCCAB /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256   0xCCAC /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256     0xCCAD /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256     0xCCAE /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256   0xCCA8 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 0xCCA9 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256     0xCCAA /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_PSK_WITH_CHACHA20_POLY1305_SHA256         0xCCAB /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256   0xCCAC /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256     0xCCAD /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256     0xCCAE /*< TLS 1.2 */ | ||||
| 
 | ||||
| /* RFC 8442 */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_GCM_SHA256         0xD001 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_GCM_SHA384         0xD002 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CCM_8_SHA256       0xD003 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CCM_SHA256         0xD005 /**< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_GCM_SHA256         0xD001 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_GCM_SHA384         0xD002 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CCM_8_SHA256       0xD003 /*< TLS 1.2 */ | ||||
| #define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CCM_SHA256         0xD005 /*< TLS 1.2 */ | ||||
| 
 | ||||
| /* Reminder: update mbedtls_ssl_premaster_secret when adding a new key exchange.
 | ||||
|  * Reminder: update MBEDTLS_KEY_EXCHANGE__xxx below | ||||
|  | @ -281,10 +281,10 @@ typedef enum { | |||
| 
 | ||||
| typedef struct mbedtls_ssl_ciphersuite_t mbedtls_ssl_ciphersuite_t; | ||||
| 
 | ||||
| #define MBEDTLS_CIPHERSUITE_WEAK       0x01    /**< Weak ciphersuite flag  */ | ||||
| #define MBEDTLS_CIPHERSUITE_SHORT_TAG  0x02    /**< Short authentication tag, | ||||
| #define MBEDTLS_CIPHERSUITE_WEAK       0x01    /*< Weak ciphersuite flag  */ | ||||
| #define MBEDTLS_CIPHERSUITE_SHORT_TAG  0x02    /*< Short authentication tag, | ||||
|                                                      eg for CCM_8 */ | ||||
| #define MBEDTLS_CIPHERSUITE_NODTLS     0x04    /**< Can't be used with DTLS */ | ||||
| #define MBEDTLS_CIPHERSUITE_NODTLS     0x04    /*< Can't be used with DTLS */ | ||||
| 
 | ||||
| /**
 | ||||
|  * \brief   This structure is used for storing ciphersuite information | ||||
|  |  | |||
							
								
								
									
										2
									
								
								third_party/mbedtls/ssl_cookie.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								third_party/mbedtls/ssl_cookie.h
									
										
									
									
										vendored
									
									
								
							|  | @ -12,7 +12,7 @@ | |||
|  * \{ | ||||
|  */ | ||||
| #ifndef MBEDTLS_SSL_COOKIE_TIMEOUT | ||||
| #define MBEDTLS_SSL_COOKIE_TIMEOUT     60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */ | ||||
| #define MBEDTLS_SSL_COOKIE_TIMEOUT     60 /*< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */ | ||||
| #endif | ||||
| 
 | ||||
| /* \} name SECTION: Module settings */ | ||||
|  |  | |||
							
								
								
									
										4
									
								
								third_party/mbedtls/ssl_ticket.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								third_party/mbedtls/ssl_ticket.h
									
										
									
									
										vendored
									
									
								
							|  | @ -61,14 +61,14 @@ int mbedtls_ssl_ticket_setup( mbedtls_ssl_ticket_context *ctx, | |||
|  * | ||||
|  * \note            See \c mbedtls_ssl_ticket_write_t for description | ||||
|  */ | ||||
| mbedtls_ssl_ticket_write_t mbedtls_ssl_ticket_write; | ||||
| extern mbedtls_ssl_ticket_write_t mbedtls_ssl_ticket_write; | ||||
| 
 | ||||
| /**
 | ||||
|  * \brief           Implementation of the ticket parse callback | ||||
|  * | ||||
|  * \note            See \c mbedtls_ssl_ticket_parse_t for description | ||||
|  */ | ||||
| mbedtls_ssl_ticket_parse_t mbedtls_ssl_ticket_parse; | ||||
| extern mbedtls_ssl_ticket_parse_t mbedtls_ssl_ticket_parse; | ||||
| 
 | ||||
| /**
 | ||||
|  * \brief           Free a context's content and zeroize it. | ||||
|  |  | |||
							
								
								
									
										86
									
								
								third_party/mbedtls/x509.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										86
									
								
								third_party/mbedtls/x509.h
									
										
									
									
										vendored
									
									
								
							|  | @ -7,48 +7,48 @@ | |||
| COSMOPOLITAN_C_START_ | ||||
| /* clang-format off */ | ||||
|   | ||||
| #define MBEDTLS_ERR_X509_FEATURE_UNAVAILABLE              -0x2080  /**< Unavailable feature, e.g. RSA hashing/encryption combination. */ | ||||
| #define MBEDTLS_ERR_X509_UNKNOWN_OID                      -0x2100  /**< Requested OID is unknown. */ | ||||
| #define MBEDTLS_ERR_X509_INVALID_FORMAT                   -0x2180  /**< The CRT/CRL/CSR format is invalid, e.g. different type expected. */ | ||||
| #define MBEDTLS_ERR_X509_INVALID_VERSION                  -0x2200  /**< The CRT/CRL/CSR version element is invalid. */ | ||||
| #define MBEDTLS_ERR_X509_INVALID_SERIAL                   -0x2280  /**< The serial tag or value is invalid. */ | ||||
| #define MBEDTLS_ERR_X509_INVALID_ALG                      -0x2300  /**< The algorithm tag or value is invalid. */ | ||||
| #define MBEDTLS_ERR_X509_INVALID_NAME                     -0x2380  /**< The name tag or value is invalid. */ | ||||
| #define MBEDTLS_ERR_X509_INVALID_DATE                     -0x2400  /**< The date tag or value is invalid. */ | ||||
| #define MBEDTLS_ERR_X509_INVALID_SIGNATURE                -0x2480  /**< The signature tag or value invalid. */ | ||||
| #define MBEDTLS_ERR_X509_INVALID_EXTENSIONS               -0x2500  /**< The extension tag or value is invalid. */ | ||||
| #define MBEDTLS_ERR_X509_UNKNOWN_VERSION                  -0x2580  /**< CRT/CRL/CSR has an unsupported version number. */ | ||||
| #define MBEDTLS_ERR_X509_UNKNOWN_SIG_ALG                  -0x2600  /**< Signature algorithm (oid) is unsupported. */ | ||||
| #define MBEDTLS_ERR_X509_SIG_MISMATCH                     -0x2680  /**< Signature algorithms do not match. (see \c ::mbedtls_x509_crt sig_oid) */ | ||||
| #define MBEDTLS_ERR_X509_CERT_VERIFY_FAILED               -0x2700  /**< Certificate verification failed, e.g. CRL, CA or signature check failed. */ | ||||
| #define MBEDTLS_ERR_X509_CERT_UNKNOWN_FORMAT              -0x2780  /**< Format not recognized as DER or PEM. */ | ||||
| #define MBEDTLS_ERR_X509_BAD_INPUT_DATA                   -0x2800  /**< Input invalid. */ | ||||
| #define MBEDTLS_ERR_X509_ALLOC_FAILED                     -0x2880  /**< Allocation of memory failed. */ | ||||
| #define MBEDTLS_ERR_X509_FILE_IO_ERROR                    -0x2900  /**< Read/write of file failed. */ | ||||
| #define MBEDTLS_ERR_X509_BUFFER_TOO_SMALL                 -0x2980  /**< Destination buffer is too small. */ | ||||
| #define MBEDTLS_ERR_X509_FATAL_ERROR                      -0x3000  /**< A fatal error occurred, eg the chain is too long or the vrfy callback failed. */ | ||||
| #define MBEDTLS_ERR_X509_FEATURE_UNAVAILABLE              -0x2080  /*< Unavailable feature, e.g. RSA hashing/encryption combination. */ | ||||
| #define MBEDTLS_ERR_X509_UNKNOWN_OID                      -0x2100  /*< Requested OID is unknown. */ | ||||
| #define MBEDTLS_ERR_X509_INVALID_FORMAT                   -0x2180  /*< The CRT/CRL/CSR format is invalid, e.g. different type expected. */ | ||||
| #define MBEDTLS_ERR_X509_INVALID_VERSION                  -0x2200  /*< The CRT/CRL/CSR version element is invalid. */ | ||||
| #define MBEDTLS_ERR_X509_INVALID_SERIAL                   -0x2280  /*< The serial tag or value is invalid. */ | ||||
| #define MBEDTLS_ERR_X509_INVALID_ALG                      -0x2300  /*< The algorithm tag or value is invalid. */ | ||||
| #define MBEDTLS_ERR_X509_INVALID_NAME                     -0x2380  /*< The name tag or value is invalid. */ | ||||
| #define MBEDTLS_ERR_X509_INVALID_DATE                     -0x2400  /*< The date tag or value is invalid. */ | ||||
| #define MBEDTLS_ERR_X509_INVALID_SIGNATURE                -0x2480  /*< The signature tag or value invalid. */ | ||||
| #define MBEDTLS_ERR_X509_INVALID_EXTENSIONS               -0x2500  /*< The extension tag or value is invalid. */ | ||||
| #define MBEDTLS_ERR_X509_UNKNOWN_VERSION                  -0x2580  /*< CRT/CRL/CSR has an unsupported version number. */ | ||||
| #define MBEDTLS_ERR_X509_UNKNOWN_SIG_ALG                  -0x2600  /*< Signature algorithm (oid) is unsupported. */ | ||||
| #define MBEDTLS_ERR_X509_SIG_MISMATCH                     -0x2680  /*< Signature algorithms do not match. (see \c ::mbedtls_x509_crt sig_oid) */ | ||||
| #define MBEDTLS_ERR_X509_CERT_VERIFY_FAILED               -0x2700  /*< Certificate verification failed, e.g. CRL, CA or signature check failed. */ | ||||
| #define MBEDTLS_ERR_X509_CERT_UNKNOWN_FORMAT              -0x2780  /*< Format not recognized as DER or PEM. */ | ||||
| #define MBEDTLS_ERR_X509_BAD_INPUT_DATA                   -0x2800  /*< Input invalid. */ | ||||
| #define MBEDTLS_ERR_X509_ALLOC_FAILED                     -0x2880  /*< Allocation of memory failed. */ | ||||
| #define MBEDTLS_ERR_X509_FILE_IO_ERROR                    -0x2900  /*< Read/write of file failed. */ | ||||
| #define MBEDTLS_ERR_X509_BUFFER_TOO_SMALL                 -0x2980  /*< Destination buffer is too small. */ | ||||
| #define MBEDTLS_ERR_X509_FATAL_ERROR                      -0x3000  /*< A fatal error occurred, eg the chain is too long or the vrfy callback failed. */ | ||||
| 
 | ||||
| /* Reminder: update x509_crt_verify_strings[] in library/x509_crt.c */ | ||||
| #define MBEDTLS_X509_BADCERT_EXPIRED             0x01  /**< The certificate validity has expired. */ | ||||
| #define MBEDTLS_X509_BADCERT_REVOKED             0x02  /**< The certificate has been revoked (is on a CRL). */ | ||||
| #define MBEDTLS_X509_BADCERT_CN_MISMATCH         0x04  /**< The certificate Common Name (CN) does not match with the expected CN. */ | ||||
| #define MBEDTLS_X509_BADCERT_NOT_TRUSTED         0x08  /**< The certificate is not correctly signed by the trusted CA. */ | ||||
| #define MBEDTLS_X509_BADCRL_NOT_TRUSTED          0x10  /**< The CRL is not correctly signed by the trusted CA. */ | ||||
| #define MBEDTLS_X509_BADCRL_EXPIRED              0x20  /**< The CRL is expired. */ | ||||
| #define MBEDTLS_X509_BADCERT_MISSING             0x40  /**< Certificate was missing. */ | ||||
| #define MBEDTLS_X509_BADCERT_SKIP_VERIFY         0x80  /**< Certificate verification was skipped. */ | ||||
| #define MBEDTLS_X509_BADCERT_OTHER             0x0100  /**< Other reason (can be used by verify callback) */ | ||||
| #define MBEDTLS_X509_BADCERT_FUTURE            0x0200  /**< The certificate validity starts in the future. */ | ||||
| #define MBEDTLS_X509_BADCRL_FUTURE             0x0400  /**< The CRL is from the future */ | ||||
| #define MBEDTLS_X509_BADCERT_KEY_USAGE         0x0800  /**< Usage does not match the keyUsage extension. */ | ||||
| #define MBEDTLS_X509_BADCERT_EXT_KEY_USAGE     0x1000  /**< Usage does not match the extendedKeyUsage extension. */ | ||||
| #define MBEDTLS_X509_BADCERT_NS_CERT_TYPE      0x2000  /**< Usage does not match the nsCertType extension. */ | ||||
| #define MBEDTLS_X509_BADCERT_BAD_MD            0x4000  /**< The certificate is signed with an unacceptable hash. */ | ||||
| #define MBEDTLS_X509_BADCERT_BAD_PK            0x8000  /**< The certificate is signed with an unacceptable PK alg (eg RSA vs ECDSA). */ | ||||
| #define MBEDTLS_X509_BADCERT_BAD_KEY         0x010000  /**< The certificate is signed with an unacceptable key (eg bad curve, RSA too short). */ | ||||
| #define MBEDTLS_X509_BADCRL_BAD_MD           0x020000  /**< The CRL is signed with an unacceptable hash. */ | ||||
| #define MBEDTLS_X509_BADCRL_BAD_PK           0x040000  /**< The CRL is signed with an unacceptable PK alg (eg RSA vs ECDSA). */ | ||||
| #define MBEDTLS_X509_BADCRL_BAD_KEY          0x080000  /**< The CRL is signed with an unacceptable key (eg bad curve, RSA too short). */ | ||||
| #define MBEDTLS_X509_BADCERT_EXPIRED             0x01  /*< The certificate validity has expired. */ | ||||
| #define MBEDTLS_X509_BADCERT_REVOKED             0x02  /*< The certificate has been revoked (is on a CRL). */ | ||||
| #define MBEDTLS_X509_BADCERT_CN_MISMATCH         0x04  /*< The certificate Common Name (CN) does not match with the expected CN. */ | ||||
| #define MBEDTLS_X509_BADCERT_NOT_TRUSTED         0x08  /*< The certificate is not correctly signed by the trusted CA. */ | ||||
| #define MBEDTLS_X509_BADCRL_NOT_TRUSTED          0x10  /*< The CRL is not correctly signed by the trusted CA. */ | ||||
| #define MBEDTLS_X509_BADCRL_EXPIRED              0x20  /*< The CRL is expired. */ | ||||
| #define MBEDTLS_X509_BADCERT_MISSING             0x40  /*< Certificate was missing. */ | ||||
| #define MBEDTLS_X509_BADCERT_SKIP_VERIFY         0x80  /*< Certificate verification was skipped. */ | ||||
| #define MBEDTLS_X509_BADCERT_OTHER             0x0100  /*< Other reason (can be used by verify callback) */ | ||||
| #define MBEDTLS_X509_BADCERT_FUTURE            0x0200  /*< The certificate validity starts in the future. */ | ||||
| #define MBEDTLS_X509_BADCRL_FUTURE             0x0400  /*< The CRL is from the future */ | ||||
| #define MBEDTLS_X509_BADCERT_KEY_USAGE         0x0800  /*< Usage does not match the keyUsage extension. */ | ||||
| #define MBEDTLS_X509_BADCERT_EXT_KEY_USAGE     0x1000  /*< Usage does not match the extendedKeyUsage extension. */ | ||||
| #define MBEDTLS_X509_BADCERT_NS_CERT_TYPE      0x2000  /*< Usage does not match the nsCertType extension. */ | ||||
| #define MBEDTLS_X509_BADCERT_BAD_MD            0x4000  /*< The certificate is signed with an unacceptable hash. */ | ||||
| #define MBEDTLS_X509_BADCERT_BAD_PK            0x8000  /*< The certificate is signed with an unacceptable PK alg (eg RSA vs ECDSA). */ | ||||
| #define MBEDTLS_X509_BADCERT_BAD_KEY         0x010000  /*< The certificate is signed with an unacceptable key (eg bad curve, RSA too short). */ | ||||
| #define MBEDTLS_X509_BADCRL_BAD_MD           0x020000  /*< The CRL is signed with an unacceptable hash. */ | ||||
| #define MBEDTLS_X509_BADCRL_BAD_PK           0x040000  /*< The CRL is signed with an unacceptable PK alg (eg RSA vs ECDSA). */ | ||||
| #define MBEDTLS_X509_BADCRL_BAD_KEY          0x080000  /*< The CRL is signed with an unacceptable key (eg bad curve, RSA too short). */ | ||||
| 
 | ||||
| /*
 | ||||
|  * X.509 v3 Subject Alternative Name types. | ||||
|  | @ -133,7 +133,7 @@ COSMOPOLITAN_C_START_ | |||
| #define MBEDTLS_X509_FORMAT_DER                 1 | ||||
| #define MBEDTLS_X509_FORMAT_PEM                 2 | ||||
| 
 | ||||
| #define MBEDTLS_X509_MAX_DN_NAME_SIZE         256 /**< Maximum value size of a DN entry */ | ||||
| #define MBEDTLS_X509_MAX_DN_NAME_SIZE         256 /*< Maximum value size of a DN entry */ | ||||
| 
 | ||||
| /**
 | ||||
|  * Type-length-value structure that allows for ASN1 using DER. | ||||
|  | @ -159,8 +159,8 @@ typedef mbedtls_asn1_sequence mbedtls_x509_sequence; | |||
| /** Container for date and time (precision in seconds). */ | ||||
| typedef struct mbedtls_x509_time | ||||
| { | ||||
|     int year, mon, day;         /**< Date. */ | ||||
|     int hour, min, sec;         /**< Time. */ | ||||
|     int year, mon, day;         /*< Date. */ | ||||
|     int hour, min, sec;         /*< Time. */ | ||||
| } | ||||
| mbedtls_x509_time; | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										20
									
								
								third_party/mbedtls/x509_crl.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										20
									
								
								third_party/mbedtls/x509_crl.h
									
										
									
									
										vendored
									
									
								
							|  | @ -41,28 +41,28 @@ mbedtls_x509_crl_entry; | |||
|  */ | ||||
| typedef struct mbedtls_x509_crl | ||||
| { | ||||
|     mbedtls_x509_buf raw;           /**< The raw certificate data (DER). */ | ||||
|     mbedtls_x509_buf tbs;           /**< The raw certificate body (DER). The part that is To Be Signed. */ | ||||
|     mbedtls_x509_buf raw;           /*< The raw certificate data (DER). */ | ||||
|     mbedtls_x509_buf tbs;           /*< The raw certificate body (DER). The part that is To Be Signed. */ | ||||
| 
 | ||||
|     int version;            /**< CRL version (1=v1, 2=v2) */ | ||||
|     mbedtls_x509_buf sig_oid;       /**< CRL signature type identifier */ | ||||
|     int version;            /*< CRL version (1=v1, 2=v2) */ | ||||
|     mbedtls_x509_buf sig_oid;       /*< CRL signature type identifier */ | ||||
| 
 | ||||
|     mbedtls_x509_buf issuer_raw;    /**< The raw issuer data (DER). */ | ||||
|     mbedtls_x509_buf issuer_raw;    /*< The raw issuer data (DER). */ | ||||
| 
 | ||||
|     mbedtls_x509_name issuer;       /**< The parsed issuer data (named information object). */ | ||||
|     mbedtls_x509_name issuer;       /*< The parsed issuer data (named information object). */ | ||||
| 
 | ||||
|     mbedtls_x509_time this_update; | ||||
|     mbedtls_x509_time next_update; | ||||
| 
 | ||||
|     mbedtls_x509_crl_entry entry;   /**< The CRL entries containing the certificate revocation times for this CA. */ | ||||
|     mbedtls_x509_crl_entry entry;   /*< The CRL entries containing the certificate revocation times for this CA. */ | ||||
| 
 | ||||
|     mbedtls_x509_buf crl_ext; | ||||
| 
 | ||||
|     mbedtls_x509_buf sig_oid2; | ||||
|     mbedtls_x509_buf sig; | ||||
|     mbedtls_md_type_t sig_md;           /**< Internal representation of the MD algorithm of the signature algorithm, e.g. MBEDTLS_MD_SHA256 */ | ||||
|     mbedtls_pk_type_t sig_pk;           /**< Internal representation of the Public Key algorithm of the signature algorithm, e.g. MBEDTLS_PK_RSA */ | ||||
|     void *sig_opts;             /**< Signature options to be passed to mbedtls_pk_verify_ext(), e.g. for RSASSA-PSS */ | ||||
|     mbedtls_md_type_t sig_md;           /*< Internal representation of the MD algorithm of the signature algorithm, e.g. MBEDTLS_MD_SHA256 */ | ||||
|     mbedtls_pk_type_t sig_pk;           /*< Internal representation of the Public Key algorithm of the signature algorithm, e.g. MBEDTLS_PK_RSA */ | ||||
|     void *sig_opts;             /*< Signature options to be passed to mbedtls_pk_verify_ext(), e.g. for RSASSA-PSS */ | ||||
| 
 | ||||
|     struct mbedtls_x509_crl *next; | ||||
| } | ||||
|  |  | |||
							
								
								
									
										80
									
								
								third_party/mbedtls/x509_crt.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										80
									
								
								third_party/mbedtls/x509_crt.h
									
										
									
									
										vendored
									
									
								
							|  | @ -12,50 +12,50 @@ COSMOPOLITAN_C_START_ | |||
|  */ | ||||
| typedef struct mbedtls_x509_crt | ||||
| { | ||||
|     int own_buffer;                     /**< Indicates if \c raw is owned
 | ||||
|     int own_buffer;                     /*< Indicates if \c raw is owned
 | ||||
|                                          *   by the structure or not.        */ | ||||
|     mbedtls_x509_buf raw;               /**< The raw certificate data (DER). */ | ||||
|     mbedtls_x509_buf tbs;               /**< The raw certificate body (DER). The part that is To Be Signed. */ | ||||
|     mbedtls_x509_buf raw;               /*< The raw certificate data (DER). */ | ||||
|     mbedtls_x509_buf tbs;               /*< The raw certificate body (DER). The part that is To Be Signed. */ | ||||
| 
 | ||||
|     int version;                        /**< The X.509 version. (1=v1, 2=v2, 3=v3) */ | ||||
|     mbedtls_x509_buf serial;            /**< Unique id for certificate issued by a specific CA. */ | ||||
|     mbedtls_x509_buf sig_oid;           /**< Signature algorithm, e.g. sha1RSA */ | ||||
|     int version;                        /*< The X.509 version. (1=v1, 2=v2, 3=v3) */ | ||||
|     mbedtls_x509_buf serial;            /*< Unique id for certificate issued by a specific CA. */ | ||||
|     mbedtls_x509_buf sig_oid;           /*< Signature algorithm, e.g. sha1RSA */ | ||||
| 
 | ||||
|     mbedtls_x509_buf issuer_raw;        /**< The raw issuer data (DER). Used for quick comparison. */ | ||||
|     mbedtls_x509_buf subject_raw;       /**< The raw subject data (DER). Used for quick comparison. */ | ||||
|     mbedtls_x509_buf issuer_raw;        /*< The raw issuer data (DER). Used for quick comparison. */ | ||||
|     mbedtls_x509_buf subject_raw;       /*< The raw subject data (DER). Used for quick comparison. */ | ||||
| 
 | ||||
|     mbedtls_x509_name issuer;           /**< The parsed issuer data (named information object). */ | ||||
|     mbedtls_x509_name subject;          /**< The parsed subject data (named information object). */ | ||||
|     mbedtls_x509_name issuer;           /*< The parsed issuer data (named information object). */ | ||||
|     mbedtls_x509_name subject;          /*< The parsed subject data (named information object). */ | ||||
| 
 | ||||
|     mbedtls_x509_time valid_from;       /**< Start time of certificate validity. */ | ||||
|     mbedtls_x509_time valid_to;         /**< End time of certificate validity. */ | ||||
|     mbedtls_x509_time valid_from;       /*< Start time of certificate validity. */ | ||||
|     mbedtls_x509_time valid_to;         /*< End time of certificate validity. */ | ||||
| 
 | ||||
|     mbedtls_x509_buf pk_raw; | ||||
|     mbedtls_pk_context pk;              /**< Container for the public key context. */ | ||||
|     mbedtls_pk_context pk;              /*< Container for the public key context. */ | ||||
| 
 | ||||
|     mbedtls_x509_buf issuer_id;         /**< Optional X.509 v2/v3 issuer unique identifier. */ | ||||
|     mbedtls_x509_buf subject_id;        /**< Optional X.509 v2/v3 subject unique identifier. */ | ||||
|     mbedtls_x509_buf v3_ext;            /**< Optional X.509 v3 extensions.  */ | ||||
|     mbedtls_x509_sequence subject_alt_names;    /**< Optional list of raw entries of Subject Alternative Names extension (currently only dNSName and OtherName are listed). */ | ||||
|     mbedtls_x509_buf issuer_id;         /*< Optional X.509 v2/v3 issuer unique identifier. */ | ||||
|     mbedtls_x509_buf subject_id;        /*< Optional X.509 v2/v3 subject unique identifier. */ | ||||
|     mbedtls_x509_buf v3_ext;            /*< Optional X.509 v3 extensions.  */ | ||||
|     mbedtls_x509_sequence subject_alt_names;    /*< Optional list of raw entries of Subject Alternative Names extension (currently only dNSName and OtherName are listed). */ | ||||
| 
 | ||||
|     mbedtls_x509_sequence certificate_policies; /**< Optional list of certificate policies (Only anyPolicy is printed and enforced, however the rest of the policies are still listed). */ | ||||
|     mbedtls_x509_sequence certificate_policies; /*< Optional list of certificate policies (Only anyPolicy is printed and enforced, however the rest of the policies are still listed). */ | ||||
| 
 | ||||
|     int ext_types;              /**< Bit string containing detected and parsed extensions */ | ||||
|     int ca_istrue;              /**< Optional Basic Constraint extension value: 1 if this certificate belongs to a CA, 0 otherwise. */ | ||||
|     int max_pathlen;            /**< Optional Basic Constraint extension value: The maximum path length to the root certificate. Path length is 1 higher than RFC 5280 'meaning', so 1+ */ | ||||
|     int ext_types;              /*< Bit string containing detected and parsed extensions */ | ||||
|     int ca_istrue;              /*< Optional Basic Constraint extension value: 1 if this certificate belongs to a CA, 0 otherwise. */ | ||||
|     int max_pathlen;            /*< Optional Basic Constraint extension value: The maximum path length to the root certificate. Path length is 1 higher than RFC 5280 'meaning', so 1+ */ | ||||
| 
 | ||||
|     unsigned int key_usage;     /**< Optional key usage extension value: See the values in x509.h */ | ||||
|     unsigned int key_usage;     /*< Optional key usage extension value: See the values in x509.h */ | ||||
| 
 | ||||
|     mbedtls_x509_sequence ext_key_usage; /**< Optional list of extended key usage OIDs. */ | ||||
|     mbedtls_x509_sequence ext_key_usage; /*< Optional list of extended key usage OIDs. */ | ||||
| 
 | ||||
|     unsigned char ns_cert_type; /**< Optional Netscape certificate type extension value: See the values in x509.h */ | ||||
|     unsigned char ns_cert_type; /*< Optional Netscape certificate type extension value: See the values in x509.h */ | ||||
| 
 | ||||
|     mbedtls_x509_buf sig;               /**< Signature: hash of the tbs part signed with the private key. */ | ||||
|     mbedtls_md_type_t sig_md;           /**< Internal representation of the MD algorithm of the signature algorithm, e.g. MBEDTLS_MD_SHA256 */ | ||||
|     mbedtls_pk_type_t sig_pk;           /**< Internal representation of the Public Key algorithm of the signature algorithm, e.g. MBEDTLS_PK_RSA */ | ||||
|     void *sig_opts;             /**< Signature options to be passed to mbedtls_pk_verify_ext(), e.g. for RSASSA-PSS */ | ||||
|     mbedtls_x509_buf sig;               /*< Signature: hash of the tbs part signed with the private key. */ | ||||
|     mbedtls_md_type_t sig_md;           /*< Internal representation of the MD algorithm of the signature algorithm, e.g. MBEDTLS_MD_SHA256 */ | ||||
|     mbedtls_pk_type_t sig_pk;           /*< Internal representation of the Public Key algorithm of the signature algorithm, e.g. MBEDTLS_PK_RSA */ | ||||
|     void *sig_opts;             /*< Signature options to be passed to mbedtls_pk_verify_ext(), e.g. for RSASSA-PSS */ | ||||
| 
 | ||||
|     struct mbedtls_x509_crt *next;     /**< Next certificate in the CA-chain. */ | ||||
|     struct mbedtls_x509_crt *next;     /*< Next certificate in the CA-chain. */ | ||||
| } | ||||
| mbedtls_x509_crt; | ||||
| 
 | ||||
|  | @ -72,7 +72,7 @@ typedef struct mbedtls_x509_san_other_name | |||
|      * To check the value of the type id, you should use | ||||
|      * \p MBEDTLS_OID_CMP with a known OID mbedtls_x509_buf. | ||||
|      */ | ||||
|     mbedtls_x509_buf type_id;                   /**< The type id. */ | ||||
|     mbedtls_x509_buf type_id;                   /*< The type id. */ | ||||
|     union | ||||
|     { | ||||
|         /**
 | ||||
|  | @ -83,8 +83,8 @@ typedef struct mbedtls_x509_san_other_name | |||
|          */ | ||||
|         struct | ||||
|         { | ||||
|             mbedtls_x509_buf oid;               /**< The object identifier. */ | ||||
|             mbedtls_x509_buf val;               /**< The named value. */ | ||||
|             mbedtls_x509_buf oid;               /*< The object identifier. */ | ||||
|             mbedtls_x509_buf val;               /*< The named value. */ | ||||
|         } | ||||
|         hardware_module_name; | ||||
|     } | ||||
|  | @ -97,13 +97,13 @@ mbedtls_x509_san_other_name; | |||
|  */ | ||||
| typedef struct mbedtls_x509_subject_alternative_name | ||||
| { | ||||
|     int type;                              /**< The SAN type, value of MBEDTLS_X509_SAN_XXX. */ | ||||
|     int type;                              /*< The SAN type, value of MBEDTLS_X509_SAN_XXX. */ | ||||
|     union { | ||||
|         mbedtls_x509_san_other_name other_name; /**< The otherName supported type. */ | ||||
|         mbedtls_x509_buf   unstructured_name; /**< The buffer for the un constructed types. Only dnsName currently supported */ | ||||
|         mbedtls_x509_san_other_name other_name; /*< The otherName supported type. */ | ||||
|         mbedtls_x509_buf   unstructured_name; /*< The buffer for the un constructed types. Only dnsName currently supported */ | ||||
|         uint32_t ip; | ||||
|     } | ||||
|     san; /**< A union of the supported SAN types */ | ||||
|     san; /*< A union of the supported SAN types */ | ||||
| } | ||||
| mbedtls_x509_subject_alternative_name; | ||||
| 
 | ||||
|  | @ -120,10 +120,10 @@ mbedtls_x509_subject_alternative_name; | |||
|  */ | ||||
| typedef struct mbedtls_x509_crt_profile | ||||
| { | ||||
|     uint32_t allowed_mds;       /**< MDs for signatures         */ | ||||
|     uint32_t allowed_pks;       /**< PK algs for signatures     */ | ||||
|     uint32_t allowed_curves;    /**< Elliptic curves for ECDSA  */ | ||||
|     uint32_t rsa_min_bitlen;    /**< Minimum size for RSA keys  */ | ||||
|     uint32_t allowed_mds;       /*< MDs for signatures         */ | ||||
|     uint32_t allowed_pks;       /*< PK algs for signatures     */ | ||||
|     uint32_t allowed_curves;    /*< Elliptic curves for ECDSA  */ | ||||
|     uint32_t rsa_min_bitlen;    /*< Minimum size for RSA keys  */ | ||||
| } | ||||
| mbedtls_x509_crt_profile; | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										18
									
								
								third_party/mbedtls/x509_csr.h
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								third_party/mbedtls/x509_csr.h
									
										
									
									
										vendored
									
									
								
							|  | @ -9,17 +9,17 @@ COSMOPOLITAN_C_START_ | |||
|  * Certificate Signing Request (CSR) structure. | ||||
|  */ | ||||
| typedef struct mbedtls_x509_csr { | ||||
|     mbedtls_x509_buf raw;           /**< The raw CSR data (DER). */ | ||||
|     mbedtls_x509_buf cri;           /**< The raw CertificateRequestInfo body (DER). */ | ||||
|     int version;                    /**< CSR version (1=v1). */ | ||||
|     mbedtls_x509_buf  subject_raw;  /**< The raw subject data (DER). */ | ||||
|     mbedtls_x509_name subject;      /**< The parsed subject data (named information object). */ | ||||
|     mbedtls_pk_context pk;          /**< Container for the public key context. */ | ||||
|     mbedtls_x509_buf raw;           /*< The raw CSR data (DER). */ | ||||
|     mbedtls_x509_buf cri;           /*< The raw CertificateRequestInfo body (DER). */ | ||||
|     int version;                    /*< CSR version (1=v1). */ | ||||
|     mbedtls_x509_buf  subject_raw;  /*< The raw subject data (DER). */ | ||||
|     mbedtls_x509_name subject;      /*< The parsed subject data (named information object). */ | ||||
|     mbedtls_pk_context pk;          /*< Container for the public key context. */ | ||||
|     mbedtls_x509_buf sig_oid; | ||||
|     mbedtls_x509_buf sig; | ||||
|     mbedtls_md_type_t sig_md;       /**< Internal representation of the MD algorithm of the signature algorithm, e.g. MBEDTLS_MD_SHA256 */ | ||||
|     mbedtls_pk_type_t sig_pk;       /**< Internal representation of the Public Key algorithm of the signature algorithm, e.g. MBEDTLS_PK_RSA */ | ||||
|     void *sig_opts;                 /**< Signature options to be passed to mbedtls_pk_verify_ext(), e.g. for RSASSA-PSS */ | ||||
|     mbedtls_md_type_t sig_md;       /*< Internal representation of the MD algorithm of the signature algorithm, e.g. MBEDTLS_MD_SHA256 */ | ||||
|     mbedtls_pk_type_t sig_pk;       /*< Internal representation of the Public Key algorithm of the signature algorithm, e.g. MBEDTLS_PK_RSA */ | ||||
|     void *sig_opts;                 /*< Signature options to be passed to mbedtls_pk_verify_ext(), e.g. for RSASSA-PSS */ | ||||
| } mbedtls_x509_csr; | ||||
| 
 | ||||
| /**
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue