	.file	"extr_tlsv1_client_write.c_tls_write_client_certificate.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"TLSv1: Send Certificate"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"TLSv1: Not enough buffer space for Certificate (cert_len=%lu left=%lu)"
	.align 8
.LC2:
	.string	"TLSv1: Full client certificate chain not configured - validation may fail"
	.align 8
.LC3:
	.string	"TLSv1: Failed to generate a record"
	.text
	.p2align 4
	.type	tls_write_client_certificate, @function
tls_write_client_certificate:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	edi, DWORD PTR MSG_DEBUG[rip]
	mov	r14, QWORD PTR [rsi]
	mov	QWORD PTR 16[rsp], rsi
	lea	rsi, .LC0[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	call	wpa_printf@PLT
	movsx	rax, DWORD PTR TLS_RECORD_HEADER_LEN[rip]
	sal	rax, 2
	lea	r13, [r14+rax]
	mov	QWORD PTR 8[rsp], rax
	mov	eax, DWORD PTR TLS_HANDSHAKE_TYPE_CERTIFICATE[rip]
	lea	rbx, 28[r13]
	mov	DWORD PTR 0[r13], eax
	mov	rax, QWORD PTR 8[r12]
	test	rax, rax
	je	.L2
	mov	r15, QWORD PTR [rax]
	test	r15, r15
	jne	.L7
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L4:
	mov	rdi, rbx
	add	rbx, 12
	call	WPA_PUT_BE24@PLT
	mov	esi, DWORD PTR 8[r15]
	mov	edx, DWORD PTR [r15]
	mov	rdi, rbx
	call	os_memcpy@PLT
	movsx	rax, DWORD PTR [r15]
	mov	rdi, r15
	lea	rbx, [rbx+rax*4]
	call	x509_certificate_self_signed@PLT
	test	rax, rax
	jne	.L6
	mov	rax, QWORD PTR 8[r12]
	lea	rsi, 4[r15]
	mov	edi, DWORD PTR 8[rax]
	call	x509_certificate_get_subject@PLT
	mov	r15, rax
	test	rax, rax
	je	.L2
.L7:
	movsx	rdx, DWORD PTR [r15]
	lea	rax, 12[rbx+rdx*4]
	mov	rsi, rdx
	cmp	rbp, rax
	jnb	.L4
	mov	rcx, rbp
	mov	edi, DWORD PTR MSG_DEBUG[rip]
	lea	rsi, .LC1[rip]
	xor	eax, eax
	sub	rcx, rbx
	sar	rcx, 2
	call	wpa_printf@PLT
.L23:
	mov	edx, DWORD PTR TLS_ALERT_INTERNAL_ERROR[rip]
	mov	esi, DWORD PTR TLS_ALERT_LEVEL_FATAL[rip]
	mov	rdi, r12
	call	tls_alert@PLT
	mov	eax, -1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rax, QWORD PTR 8[r12]
	test	rax, rax
	je	.L2
	cmp	r15, QWORD PTR [rax]
	je	.L2
.L8:
	lea	rdi, 16[r13]
	mov	rsi, rbx
	lea	r8, 4[r13]
	sub	rsi, rdi
	mov	QWORD PTR 24[rsp], r8
	sar	rsi, 2
	sub	esi, 3
	call	WPA_PUT_BE24@PLT
	mov	r8, QWORD PTR 24[rsp]
	mov	rsi, rbx
	sub	rbx, r13
	sub	rsi, r8
	mov	rdi, r8
	sar	rsi, 2
	sub	esi, 3
	call	WPA_PUT_BE24@PLT
	sub	rsp, 8
	.cfi_def_cfa_offset 120
	mov	rcx, rbp
	mov	r9, rbx
	lea	rax, 40[rsp]
	sub	rcx, r14
	mov	rdx, r14
	sar	r9, 2
	push	rax
	.cfi_def_cfa_offset 128
	mov	esi, DWORD PTR TLS_CONTENT_TYPE_HANDSHAKE[rip]
	sar	rcx, 2
	lea	rdi, 4[r12]
	mov	r8, r13
	call	tlsv1_record_send@PLT
	pop	rdx
	.cfi_def_cfa_offset 120
	pop	rcx
	.cfi_def_cfa_offset 112
	test	rax, rax
	js	.L25
	mov	rax, QWORD PTR 32[rsp]
	mov	rsi, r13
	mov	rdi, r12
	lea	rdx, 0[0+rax*4]
	add	r14, rdx
	sub	rdx, QWORD PTR 8[rsp]
	sar	rdx, 2
	call	tls_verify_hash_add@PLT
	mov	rax, QWORD PTR 16[rsp]
	mov	QWORD PTR [rax], r14
	xor	eax, eax
.L1:
	mov	rcx, QWORD PTR 40[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L26
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	edi, DWORD PTR MSG_DEBUG[rip]
	lea	rsi, .LC2[rip]
	xor	eax, eax
	call	wpa_printf@PLT
	jmp	.L8
.L25:
	mov	edi, DWORD PTR MSG_DEBUG[rip]
	lea	rsi, .LC3[rip]
	xor	eax, eax
	call	wpa_printf@PLT
	jmp	.L23
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	tls_write_client_certificate, .-tls_write_client_certificate
	.comm	TLS_RECORD_HEADER_LEN,4,4
	.comm	TLS_HANDSHAKE_TYPE_CERTIFICATE,4,4
	.comm	TLS_CONTENT_TYPE_HANDSHAKE,4,4
	.comm	TLS_ALERT_LEVEL_FATAL,4,4
	.comm	TLS_ALERT_INTERNAL_ERROR,4,4
	.comm	MSG_DEBUG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_tlsv1_client_write.c_tls_write_client_certificate.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"TLSv1: Send Certificate\000"
	.align	2
.LC1:
	.ascii	"TLSv1: Not enough buffer space for Certificate (cer"
	.ascii	"t_len=%lu left=%lu)\000"
	.align	2
.LC2:
	.ascii	"TLSv1: Full client certificate chain not configured"
	.ascii	" - validation may fail\000"
	.align	2
.LC3:
	.ascii	"TLSv1: Failed to generate a record\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	tls_write_client_certificate, %function
tls_write_client_certificate:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r10, r1
	mov	r5, r0
	ldr	fp, .L27
	ldr	r3, .L27+4
	sub	sp, sp, #36
	ldr	r1, .L27+8
	ldr	r0, [fp]
	ldr	r8, [r10]
	mov	r6, r2
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	bl	wpa_printf
	ldr	r3, .L27+12
	ldr	r2, .L27+16
	ldr	r7, [r3]
	ldr	r2, [r2]
	ldr	r3, [r5, #8]
	add	r9, r8, r7, lsl #2
	str	r2, [r8, r7, lsl #2]
	cmp	r3, #0
	lsl	r2, r7, #2
	str	r2, [sp, #16]
	add	r4, r9, #28
	beq	.L2
	ldr	r7, [r3]
	cmp	r7, #0
	beq	.L2
	ldr	r1, [r7]
	add	r2, r1, #3
	add	r2, r4, r2, lsl #2
	cmp	r6, r2
	bcs	.L4
	b	.L3
.L24:
	add	r1, r7, #4
	ldr	r0, [r2, #4]
	bl	x509_certificate_get_subject
	subs	r7, r0, #0
	beq	.L2
	ldr	r1, [r7]
	add	r0, r1, #3
	add	r0, r4, r0, lsl #2
	cmp	r6, r0
	bcc	.L3
.L4:
	mov	r0, r4
	add	r4, r4, #12
	bl	WPA_PUT_BE24
	mov	r0, r4
	ldr	r2, [r7]
	ldr	r1, [r7, #8]
	bl	os_memcpy
	ldr	r2, [r7]
	mov	r0, r7
	add	r4, r4, r2, lsl #2
	bl	x509_certificate_self_signed
	cmp	r0, #0
	ldr	r2, [r5, #8]
	beq	.L24
	cmp	r2, #0
	beq	.L2
	ldr	r2, [r2]
	cmp	r7, r2
	beq	.L2
.L8:
	add	r0, r9, #16
	sub	r1, r4, r0
	asr	r1, r1, #2
	add	r3, r9, #4
	sub	r1, r1, #3
	str	r3, [sp, #20]
	bl	WPA_PUT_BE24
	ldr	r3, [sp, #20]
	sub	r1, r4, r3
	asr	r1, r1, #2
	mov	r0, r3
	sub	r1, r1, #3
	sub	r4, r4, r9
	bl	WPA_PUT_BE24
	ldr	r0, .L27+20
	asr	r1, r4, #2
	add	r2, sp, #24
	str	r1, [sp, #4]
	str	r9, [sp]
	sub	r3, r6, r8
	ldr	r1, [r0]
	asr	r3, r3, #2
	str	r2, [sp, #8]
	add	r0, r5, #4
	mov	r2, r8
	bl	tlsv1_record_send
	cmp	r0, #0
	blt	.L25
	ldr	r3, [sp, #24]
	ldr	r2, [sp, #16]
	mov	r1, r9
	rsb	r2, r2, r3, lsl #2
	mov	r0, r5
	asr	r2, r2, #2
	add	r8, r8, r3, lsl #2
	bl	tls_verify_hash_add
	mov	r0, #0
	str	r8, [r10]
.L1:
	ldr	r3, .L27+4
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L26
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	ldr	r1, .L27+24
	ldr	r0, [fp]
	bl	wpa_printf
	b	.L8
.L3:
	sub	r3, r6, r4
	mov	r2, r1
	ldr	r0, [fp]
	ldr	r1, .L27+28
	asr	r3, r3, #2
	bl	wpa_printf
.L22:
	ldr	r3, .L27+32
	ldr	r2, .L27+36
	mov	r0, r5
	ldr	r2, [r2]
	ldr	r1, [r3]
	bl	tls_alert
	mvn	r0, #0
	b	.L1
.L25:
	ldr	r0, [fp]
	ldr	r1, .L27+40
	bl	wpa_printf
	b	.L22
.L26:
	bl	__stack_chk_fail
.L28:
	.align	2
.L27:
	.word	MSG_DEBUG
	.word	.LC4
	.word	.LC0
	.word	TLS_RECORD_HEADER_LEN
	.word	TLS_HANDSHAKE_TYPE_CERTIFICATE
	.word	TLS_CONTENT_TYPE_HANDSHAKE
	.word	.LC2
	.word	.LC1
	.word	TLS_ALERT_LEVEL_FATAL
	.word	TLS_ALERT_INTERNAL_ERROR
	.word	.LC3
	.size	tls_write_client_certificate, .-tls_write_client_certificate
	.comm	TLS_RECORD_HEADER_LEN,4,4
	.comm	TLS_HANDSHAKE_TYPE_CERTIFICATE,4,4
	.comm	TLS_CONTENT_TYPE_HANDSHAKE,4,4
	.comm	TLS_ALERT_LEVEL_FATAL,4,4
	.comm	TLS_ALERT_INTERNAL_ERROR,4,4
	.comm	MSG_DEBUG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
