duanhongyi / gmssl

a python crypto for sm2/sm3/sm4
MIT License
473 stars 139 forks source link

fix sm2.CryptSM2构造方法中使用public_key.lstrip(04)方法,会将公钥开头所有0 or 4开头的字符全部剔除 #73

Closed micheryu closed 1 year ago

micheryu commented 1 year ago

触发Odd-length string 异常

例如:"0404axya9xxxx".lstrip("04") 实际输出为: "axya9xxxx" ,会导致公钥长度错误