Lines Matching full:if
136 if isinstance(kind, int):
137 if not TLV_VENDOR_RES_MIN <= kind <= TLV_VENDOR_RES_MAX:
149 if len(self.buf) == 0:
201 if key is None:
202 # If key is none, we allow whatever user has selected for sha
205 # If key is not None, then we have to filter hash to only allowed
212 if user_sha == 'auto':
215 if user_sha in allowed:
230 """Check if provided key matches to TLV record in the image"""
253 if load_addr and rom_fixed:
270 self.load_addr = 0 if load_addr is None else load_addr
272 self.erased_val = 0xff if erased_val is None else int(erased_val, 0)
278 self.max_align = max(DEFAULT_MAX_ALIGN, align) if max_align is None else int(max_align)
281 if self.max_align == DEFAULT_MAX_ALIGN:
290 align = bytes([msb, lsb]) if self.endian == "big" else bytes([lsb, msb])
296 if security_counter == 'auto':
313 self.base_addr if self.base_addr is not None else "N/A",
327 if ext == INTEL_HEX_EXT:
340 # Add the image header if needed.
341 if self.pad_header and self.header_size > 0:
342 if self.base_addr:
355 # Add the image header if needed.
356 if self.pad_header and self.header_size > 0:
357 if self.base_addr:
368 if ext == INTEL_HEX_EXT:
370 if self.base_addr is None and hex_addr is None:
374 if hex_addr is not None:
377 if self.pad:
384 if self.confirm and not self.overwrite_only:
396 if self.pad:
402 if self.header_size > 0 and not self.pad_header:
403 if any(v != 0 for v in self.payload[0:self.header_size]):
408 if self.slot_size > 0:
413 if padding < 0:
420 if isinstance(enckey, ecdsa.ECDSA256P1Public):
437 if isinstance(enckey, ecdsa.ECDSA256P1Public):
454 check_key = key if key is not None else pub_key
458 if key is not None:
464 if hasattr(pub_key, 'sign'):
475 if self.security_counter is not None:
480 if sw_type is not None:
481 if len(sw_type) > MAX_SW_TYPE_LENGTH:
506 if dependencies is not None:
512 if compression_tlvs is not None:
515 if custom_tlvs is not None:
519 if protected_tlv_size != 0:
525 # This adds the padding if image is not aligned to the 16 Bytes
527 if self.enckey is not None:
529 if pad_len > 0:
531 if isinstance(self.payload, bytes):
537 if compression_tlvs is not None:
538 if compression_type in ["lzma2", "lzma2armthumb"]:
540 if compression_type == "lzma2armthumb":
543 if encrypt_keylen == 256:
553 if protected_tlv_size != 0:
557 if self.security_counter is not None:
561 if sw_type is not None:
564 if dependencies is not None:
576 if compression_tlvs is not None:
579 if custom_tlvs is not None:
599 if vector_to_sign == 'payload':
609 if key is not None or fixed_sig is not None:
610 if public_key_format == 'hash':
615 if key is not None and fixed_sig is None:
620 if hasattr(key, 'sign'):
636 if protected_tlv_off is not None:
639 if enckey is not None:
640 if encrypt_keylen == 256:
645 if isinstance(enckey, rsa.RSAPublic):
658 if isinstance(enckey, ecdsa.ECDSA256P1Public):
663 if not clear:
690 if enckey is not None:
691 if aes_length == 128:
695 if self.load_addr != 0:
699 if self.rom_fixed:
701 if self.non_bootable:
738 if overwrite_only:
741 if write_size not in set([1, 2, 4, 8, 16, 32]):
744 m = DEFAULT_MAX_SECTORS if max_sectors is None else max_sectors
746 if enckey is not None:
747 if save_enctlv:
766 if self.confirm and not self.overwrite_only:
777 if ext == INTEL_HEX_EXT:
788 if magic != IMAGE_MAGIC:
794 if magic == TLV_PROT_INFO_MAGIC:
799 if magic != TLV_INFO_MAGIC:
810 if is_sha_tlv(tlv_type):
811 if not tlv_matches_key_type(tlv_type, key):
815 if digest == b[off:off + tlv_len]:
816 if key is None:
825 if hasattr(key, 'verify'):