replace calls to standard memcmp with constant memcmp where necessary
This commit is contained in:
		
							parent
							
								
									d54425adb4
								
							
						
					
					
						commit
						e57c92fd23
					
				@ -136,7 +136,7 @@ int pkcs_1_oaep_decode(const unsigned char *msg,    unsigned long msglen,
 | 
				
			|||||||
   }
 | 
					   }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   /* compare the lhash'es */
 | 
					   /* compare the lhash'es */
 | 
				
			||||||
   if (XMEMCMP(seed, DB, hLen) != 0) {
 | 
					   if (mem_neq(seed, DB, hLen) != 0) {
 | 
				
			||||||
      err = CRYPT_OK;
 | 
					      err = CRYPT_OK;
 | 
				
			||||||
      goto LBL_ERR;
 | 
					      goto LBL_ERR;
 | 
				
			||||||
   }
 | 
					   }
 | 
				
			||||||
 | 
				
			|||||||
@ -151,7 +151,7 @@ int pkcs_1_pss_decode(const unsigned char *msghash, unsigned long msghashlen,
 | 
				
			|||||||
   }
 | 
					   }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   /* mask == hash means valid signature */
 | 
					   /* mask == hash means valid signature */
 | 
				
			||||||
   if (XMEMCMP(mask, hash, hLen) == 0) {
 | 
					   if (mem_neq(mask, hash, hLen) == 0) {
 | 
				
			||||||
      *res = 1;
 | 
					      *res = 1;
 | 
				
			||||||
   }
 | 
					   }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -153,9 +153,9 @@ int rsa_verify_hash_ex(const unsigned char *sig,      unsigned long siglen,
 | 
				
			|||||||
    /* test OID */
 | 
					    /* test OID */
 | 
				
			||||||
    if ((reallen == outlen) &&
 | 
					    if ((reallen == outlen) &&
 | 
				
			||||||
        (digestinfo[0].size == hash_descriptor[hash_idx].OIDlen) &&
 | 
					        (digestinfo[0].size == hash_descriptor[hash_idx].OIDlen) &&
 | 
				
			||||||
        (XMEMCMP(digestinfo[0].data, hash_descriptor[hash_idx].OID, sizeof(unsigned long) * hash_descriptor[hash_idx].OIDlen) == 0) &&
 | 
					        (mem_neq(digestinfo[0].data, hash_descriptor[hash_idx].OID, sizeof(unsigned long) * hash_descriptor[hash_idx].OIDlen) == 0) &&
 | 
				
			||||||
        (siginfo[1].size == hashlen) &&
 | 
					        (siginfo[1].size == hashlen) &&
 | 
				
			||||||
        (XMEMCMP(siginfo[1].data, hash, hashlen) == 0)) {
 | 
					        (mem_neq(siginfo[1].data, hash, hashlen) == 0)) {
 | 
				
			||||||
       *stat = 1;
 | 
					       *stat = 1;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user