Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int32_t verify_cert_chain(int **certificate_chain,int type)
- {
- int32_t iVar1;
- int iVar2;
- char *type_str;
- int **ppiVar3;
- type_str = "XS";
- if (type == 0x2) {
- type_str = "CP";
- }
- ppiVar3 = certificate_chain + 0x5;
- while( true ) {
- if ((type != 0x0) && (iVar1 = memcmp(*certificate_chain + 0x13,type_str,0x2), iVar1 != 0x0)) {
- return -0x1;
- }
- /* check if this is the root cert */
- iVar2 = strcmp((char *)(*certificate_chain + 0x3),"Root");
- if (iVar2 == 0x0) {
- /* Pass NULL as second arg to check Root signature */
- iVar1 = verify_cert_signature(*certificate_chain,NULL);
- return iVar1;
- }
- /* Pass next cert in to verify previous cert */
- iVar1 = verify_cert_signature(*certificate_chain,certificate_chain[0x1]);
- if (iVar1 != 0x0) break;
- certificate_chain = certificate_chain + 0x1;
- if ((int)ppiVar3 <= (int)certificate_chain) {
- return 0x0;
- }
- }
- return -0x1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement