diff --git a/python/samba/gp/gp_cert_auto_enroll_ext.py b/python/samba/gp/gp_cert_auto_enroll_ext.py index 9b743cb7f9b..8d6d1e86d17 100644 --- a/python/samba/gp/gp_cert_auto_enroll_ext.py +++ b/python/samba/gp/gp_cert_auto_enroll_ext.py @@ -54,11 +54,11 @@ global_trust_dirs = ['/etc/pki/trust/anchors', # SUSE def octet_string_to_objectGUID(data): """Convert an octet string to an objectGUID.""" - return '%s-%s-%s-%s-%s' % ('%02x' % struct.unpack('H', data[8:10])[0], - '%02x%02x' % struct.unpack('>HL', data[10:])) + return '%s-%s-%s-%s-%s' % (('%02x' % struct.unpack('H', data[8:10])[0]).zfill(4), + ('%02x%02x' % struct.unpack('>HL', data[10:])).zfill(12)) def group_and_sort_end_point_information(end_point_information):