	.file	"extr_statem_lib.c_tls_construct_cert_verify.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	tls_construct_cert_verify
	.type	tls_construct_cert_verify, @function
tls_construct_cert_verify:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	mov	r13, rdi
	push	r12
	.cfi_offset 12, -48
	mov	r12, rsi
	push	rbx
	sub	rsp, 72
	.cfi_offset 3, -56
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR EVP_MAX_MD_SIZE[rip]
	add	eax, DWORD PTR TLS13_TBS_PREAMBLE_SIZE[rip]
	mov	rbx, rsp
	cdqe
	mov	QWORD PTR -96[rbp], 0
	add	rax, 15
	mov	QWORD PTR -88[rbp], 0
	mov	rdx, rax
	and	rax, -4096
	mov	QWORD PTR -80[rbp], 0
	sub	rbx, rax
	mov	QWORD PTR -72[rbp], 0
	and	rdx, -16
	mov	rax, rbx
	cmp	rsp, rax
	je	.L3
.L51:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L51
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L52
.L4:
	mov	rax, QWORD PTR 16[r13]
	mov	r15, QWORD PTR 8[rax]
	test	r15, r15
	je	.L9
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	je	.L9
	mov	rbx, QWORD PTR [rax]
	test	rbx, rbx
	je	.L9
	lea	rsi, -96[rbp]
	mov	rdi, r15
	call	tls1_lookup_md@PLT
	test	eax, eax
	je	.L9
	xor	eax, eax
	call	EVP_MD_CTX_new@PLT
	mov	r14, rax
	test	rax, rax
	je	.L53
	lea	rcx, -80[rbp]
	lea	rdx, -64[rbp]
	mov	rsi, rsp
	mov	rdi, r13
	call	get_cert_verify_tbs_data@PLT
	xor	r9d, r9d
	test	eax, eax
	jne	.L54
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rdi, r9
	call	OPENSSL_free@PLT
	mov	rdi, r14
	call	EVP_MD_CTX_free@PLT
	xor	eax, eax
.L1:
	mov	rcx, QWORD PTR -56[rbp]
	xor	rcx, QWORD PTR fs:40
	jne	.L55
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	mov	ecx, DWORD PTR ERR_R_INTERNAL_ERROR[rip]
	mov	edx, DWORD PTR SSL_F_TLS_CONSTRUCT_CERT_VERIFY[rip]
	mov	rdi, r13
	xor	r14d, r14d
	mov	esi, DWORD PTR SSL_AD_INTERNAL_ERROR[rip]
	call	SSLfatal@PLT
	xor	r9d, r9d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L52:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L54:
	mov	rdi, r13
	mov	QWORD PTR -104[rbp], r9
	call	SSL_USE_SIGALGS@PLT
	test	rax, rax
	je	.L11
	mov	esi, DWORD PTR 4[r15]
	mov	rdi, r12
	call	WPACKET_put_bytes_u16@PLT
	test	eax, eax
	je	.L47
.L11:
	mov	rdi, rbx
	call	EVP_PKEY_size@PLT
	mov	rdi, rax
	mov	QWORD PTR -72[rbp], rax
	call	OPENSSL_malloc@PLT
	mov	ecx, DWORD PTR ERR_R_MALLOC_FAILURE[rip]
	mov	QWORD PTR -104[rbp], rax
	test	rax, rax
	je	.L48
	mov	rdx, QWORD PTR -96[rbp]
	xor	ecx, ecx
	lea	rsi, -88[rbp]
	mov	r8, rbx
	mov	rdi, r14
	call	EVP_DigestSignInit@PLT
	mov	r9, QWORD PTR -104[rbp]
	test	rax, rax
	jle	.L49
	mov	eax, DWORD PTR EVP_PKEY_RSA_PSS[rip]
	cmp	DWORD PTR [r15], eax
	je	.L56
.L14:
	mov	r8, QWORD PTR -80[rbp]
	mov	rcx, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR SSL3_VERSION[rip]
	cmp	QWORD PTR 0[r13], rax
	je	.L57
	mov	rsi, r9
	lea	rdx, -72[rbp]
	mov	rdi, r14
	mov	QWORD PTR -104[rbp], r9
	call	EVP_DigestSign@PLT
	mov	r9, QWORD PTR -104[rbp]
	test	rax, rax
	jle	.L49
.L20:
	mov	eax, DWORD PTR [r15]
	cmp	DWORD PTR NID_id_GostR3410_2001[rip], eax
	je	.L21
	cmp	DWORD PTR NID_id_GostR3410_2012_256[rip], eax
	je	.L21
	cmp	DWORD PTR NID_id_GostR3410_2012_512[rip], eax
	je	.L21
.L22:
	mov	rdx, QWORD PTR -72[rbp]
	mov	rsi, r9
	mov	rdi, r12
	mov	QWORD PTR -104[rbp], r9
	call	WPACKET_sub_memcpy_u16@PLT
	mov	r9, QWORD PTR -104[rbp]
	test	eax, eax
	je	.L47
	xor	esi, esi
	mov	rdi, r13
	mov	QWORD PTR -104[rbp], r9
	call	ssl3_digest_cached_records@PLT
	mov	r9, QWORD PTR -104[rbp]
	test	eax, eax
	je	.L7
	mov	rdi, r9
	call	OPENSSL_free@PLT
	mov	rdi, r14
	call	EVP_MD_CTX_free@PLT
	mov	eax, 1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L57:
	mov	rdx, r8
	mov	rsi, rcx
	mov	rdi, r14
	mov	QWORD PTR -104[rbp], r9
	call	EVP_DigestSignUpdate@PLT
	mov	r9, QWORD PTR -104[rbp]
	test	rax, rax
	jle	.L19
	mov	rax, QWORD PTR 8[r13]
	mov	esi, DWORD PTR EVP_CTRL_SSL3_MASTER_SECRET[rip]
	mov	rdi, r14
	mov	QWORD PTR -104[rbp], r9
	mov	rdx, QWORD PTR 8[rax]
	mov	ecx, DWORD PTR [rax]
	call	EVP_MD_CTX_ctrl@PLT
	mov	r9, QWORD PTR -104[rbp]
	test	eax, eax
	je	.L19
	mov	rsi, r9
	lea	rdx, -72[rbp]
	mov	rdi, r14
	call	EVP_DigestSignFinal@PLT
	mov	r9, QWORD PTR -104[rbp]
	test	rax, rax
	jg	.L20
	.p2align 4,,10
	.p2align 3
.L19:
	mov	QWORD PTR -104[rbp], r9
	mov	ecx, DWORD PTR ERR_R_EVP_LIB[rip]
.L48:
	mov	edx, DWORD PTR SSL_F_TLS_CONSTRUCT_CERT_VERIFY[rip]
	mov	esi, DWORD PTR SSL_AD_INTERNAL_ERROR[rip]
	mov	rdi, r13
	call	SSLfatal@PLT
	mov	r9, QWORD PTR -104[rbp]
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L53:
	mov	ecx, DWORD PTR ERR_R_MALLOC_FAILURE[rip]
	mov	edx, DWORD PTR SSL_F_TLS_CONSTRUCT_CERT_VERIFY[rip]
	mov	rdi, r13
	mov	esi, DWORD PTR SSL_AD_INTERNAL_ERROR[rip]
	call	SSLfatal@PLT
	xor	r9d, r9d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L47:
	mov	ecx, DWORD PTR ERR_R_INTERNAL_ERROR[rip]
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L21:
	mov	rdx, QWORD PTR -72[rbp]
	mov	rdi, r9
	xor	esi, esi
	mov	QWORD PTR -104[rbp], r9
	call	BUF_reverse@PLT
	mov	r9, QWORD PTR -104[rbp]
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L49:
	mov	ecx, DWORD PTR ERR_R_EVP_LIB[rip]
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L56:
	mov	esi, DWORD PTR RSA_PKCS1_PSS_PADDING[rip]
	mov	rdi, QWORD PTR -88[rbp]
	mov	QWORD PTR -104[rbp], r9
	call	EVP_PKEY_CTX_set_rsa_padding@PLT
	mov	r9, QWORD PTR -104[rbp]
	test	rax, rax
	jle	.L19
	mov	esi, DWORD PTR RSA_PSS_SALTLEN_DIGEST[rip]
	mov	rdi, QWORD PTR -88[rbp]
	mov	QWORD PTR -104[rbp], r9
	call	EVP_PKEY_CTX_set_rsa_pss_saltlen@PLT
	mov	r9, QWORD PTR -104[rbp]
	test	rax, rax
	jg	.L14
	jmp	.L19
.L55:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	tls_construct_cert_verify, .-tls_construct_cert_verify
	.comm	TLS13_TBS_PREAMBLE_SIZE,4,4
	.comm	SSL_F_TLS_CONSTRUCT_CERT_VERIFY,4,4
	.comm	SSL_AD_INTERNAL_ERROR,4,4
	.comm	SSL3_VERSION,8,8
	.comm	RSA_PSS_SALTLEN_DIGEST,4,4
	.comm	RSA_PKCS1_PSS_PADDING,4,4
	.comm	NID_id_GostR3410_2012_512,4,4
	.comm	NID_id_GostR3410_2012_256,4,4
	.comm	NID_id_GostR3410_2001,4,4
	.comm	EVP_PKEY_RSA_PSS,4,4
	.comm	EVP_MAX_MD_SIZE,4,4
	.comm	EVP_CTRL_SSL3_MASTER_SECRET,4,4
	.comm	ERR_R_MALLOC_FAILURE,4,4
	.comm	ERR_R_INTERNAL_ERROR,4,4
	.comm	ERR_R_EVP_LIB,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_statem_lib.c_tls_construct_cert_verify.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	tls_construct_cert_verify
	.syntax unified
	.arm
	.fpu softvfp
	.type	tls_construct_cert_verify, %function
tls_construct_cert_verify:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, fp, lr}
	add	fp, sp, #28
	sub	sp, sp, #32
	mov	r4, r0
	mov	r2, #0
	ldr	r0, .L49
	ldr	r3, .L49+4
	ldr	ip, [r0]
	ldr	r3, [r3]
	ldr	r0, [r4, #8]
	add	r3, r3, ip
	add	r3, r3, #7
	bic	r3, r3, #7
	ldr	r7, [r0, #4]
	sub	sp, sp, r3
	ldr	r3, .L49+8
	cmp	r7, r2
	ldr	r3, [r3]
	str	r3, [fp, #-32]
	mov	r3,#0
	str	r2, [fp, #-52]
	str	r2, [fp, #-48]
	str	r2, [fp, #-44]
	str	r2, [fp, #-40]
	beq	.L6
	ldr	r3, [r0]
	cmp	r3, r2
	beq	.L6
	ldr	r9, [r3]
	cmp	r9, #0
	beq	.L6
	mov	r8, r1
	mov	r0, r7
	sub	r1, fp, #52
	bl	tls1_lookup_md
	cmp	r0, #0
	bne	.L44
.L6:
	mov	r5, #0
	ldr	r3, .L49+12
	ldr	r2, .L49+16
	ldr	r1, .L49+20
	mov	r0, r4
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, [r1]
	bl	SSLfatal
	mov	r6, r5
.L4:
	mov	r0, r5
	bl	OPENSSL_free
	mov	r0, r6
	bl	EVP_MD_CTX_free
	mov	r0, #0
.L1:
	ldr	r3, .L49+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-32]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L45
	sub	sp, fp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, fp, pc}
.L44:
	bl	EVP_MD_CTX_new
	subs	r6, r0, #0
	beq	.L46
	add	r5, sp, #8
	mov	r1, r5
	mov	r0, r4
	sub	r3, fp, #44
	sub	r2, fp, #36
	bl	get_cert_verify_tbs_data
	subs	r5, r0, #0
	beq	.L4
	mov	r0, r4
	bl	SSL_USE_SIGALGS
	cmp	r0, #0
	beq	.L8
	mov	r0, r8
	ldr	r1, [r7, #4]
	bl	WPACKET_put_bytes_u16
	subs	r5, r0, #0
	beq	.L40
.L8:
	mov	r0, r9
	bl	EVP_PKEY_size
	str	r0, [fp, #-40]
	bl	OPENSSL_malloc
	subs	r5, r0, #0
	ldreq	r3, .L49+24
	beq	.L41
	mov	r3, #0
	mov	r0, r6
	ldr	r2, [fp, #-52]
	str	r9, [sp]
	sub	r1, fp, #48
	bl	EVP_DigestSignInit
	cmp	r0, #0
	ble	.L42
	ldr	r3, .L49+28
	ldr	r2, [r7]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L47
.L11:
	ldr	r3, .L49+32
	ldr	r0, [r4]
	ldr	r2, [r3]
	ldr	r3, [fp, #-36]
	cmp	r0, r2
	ldr	r2, [fp, #-44]
	beq	.L48
	str	r2, [sp]
	mov	r1, r5
	mov	r0, r6
	sub	r2, fp, #40
	bl	EVP_DigestSign
	cmp	r0, #0
	ble	.L42
.L17:
	ldr	r2, .L49+36
	ldr	r3, [r7]
	ldr	r2, [r2]
	cmp	r2, r3
	beq	.L18
	ldr	r2, .L49+40
	ldr	r2, [r2]
	cmp	r2, r3
	beq	.L18
	ldr	r2, .L49+44
	ldr	r2, [r2]
	cmp	r2, r3
	beq	.L18
.L19:
	mov	r0, r8
	mov	r1, r5
	ldr	r2, [fp, #-40]
	bl	WPACKET_sub_memcpy_u16
	cmp	r0, #0
	beq	.L40
	mov	r0, r4
	mov	r1, #0
	bl	ssl3_digest_cached_records
	cmp	r0, #0
	beq	.L4
	mov	r0, r5
	bl	OPENSSL_free
	mov	r0, r6
	bl	EVP_MD_CTX_free
	mov	r0, #1
	b	.L1
.L48:
	mov	r1, r3
	mov	r0, r6
	bl	EVP_DigestSignUpdate
	cmp	r0, #0
	ble	.L42
	ldr	r2, [r4, #4]
	ldr	r1, .L49+48
	ldr	r3, [r2]
	mov	r0, r6
	ldr	r2, [r2, #4]
	ldr	r1, [r1]
	bl	EVP_MD_CTX_ctrl
	cmp	r0, #0
	beq	.L42
	mov	r1, r5
	mov	r0, r6
	sub	r2, fp, #40
	bl	EVP_DigestSignFinal
	cmp	r0, #0
	bgt	.L17
.L42:
	ldr	r3, .L49+52
.L41:
	ldr	r2, .L49+16
	ldr	r1, .L49+20
	mov	r0, r4
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, [r1]
	bl	SSLfatal
	b	.L4
.L46:
	ldr	r3, .L49+24
	ldr	r2, .L49+16
	ldr	r1, .L49+20
	mov	r0, r4
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, [r1]
	bl	SSLfatal
	mov	r5, r6
	b	.L4
.L40:
	ldr	r3, .L49+12
	b	.L41
.L18:
	mov	r1, #0
	mov	r0, r5
	ldr	r2, [fp, #-40]
	bl	BUF_reverse
	b	.L19
.L47:
	ldr	r3, .L49+56
	ldr	r0, [fp, #-48]
	ldr	r1, [r3]
	bl	EVP_PKEY_CTX_set_rsa_padding
	cmp	r0, #0
	ble	.L42
	ldr	r3, .L49+60
	ldr	r0, [fp, #-48]
	ldr	r1, [r3]
	bl	EVP_PKEY_CTX_set_rsa_pss_saltlen
	cmp	r0, #0
	bgt	.L11
	b	.L42
.L45:
	bl	__stack_chk_fail
.L50:
	.align	2
.L49:
	.word	EVP_MAX_MD_SIZE
	.word	TLS13_TBS_PREAMBLE_SIZE
	.word	.LC0
	.word	ERR_R_INTERNAL_ERROR
	.word	SSL_F_TLS_CONSTRUCT_CERT_VERIFY
	.word	SSL_AD_INTERNAL_ERROR
	.word	ERR_R_MALLOC_FAILURE
	.word	EVP_PKEY_RSA_PSS
	.word	SSL3_VERSION
	.word	NID_id_GostR3410_2001
	.word	NID_id_GostR3410_2012_256
	.word	NID_id_GostR3410_2012_512
	.word	EVP_CTRL_SSL3_MASTER_SECRET
	.word	ERR_R_EVP_LIB
	.word	RSA_PKCS1_PSS_PADDING
	.word	RSA_PSS_SALTLEN_DIGEST
	.size	tls_construct_cert_verify, .-tls_construct_cert_verify
	.comm	TLS13_TBS_PREAMBLE_SIZE,4,4
	.comm	SSL_F_TLS_CONSTRUCT_CERT_VERIFY,4,4
	.comm	SSL_AD_INTERNAL_ERROR,4,4
	.comm	SSL3_VERSION,4,4
	.comm	RSA_PSS_SALTLEN_DIGEST,4,4
	.comm	RSA_PKCS1_PSS_PADDING,4,4
	.comm	NID_id_GostR3410_2012_512,4,4
	.comm	NID_id_GostR3410_2012_256,4,4
	.comm	NID_id_GostR3410_2001,4,4
	.comm	EVP_PKEY_RSA_PSS,4,4
	.comm	EVP_MAX_MD_SIZE,4,4
	.comm	EVP_CTRL_SSL3_MASTER_SECRET,4,4
	.comm	ERR_R_MALLOC_FAILURE,4,4
	.comm	ERR_R_INTERNAL_ERROR,4,4
	.comm	ERR_R_EVP_LIB,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
