Commit f4030af7 authored by Adin Schmahmann's avatar Adin Schmahmann

refactor: make Ed25519 keys less special cased

parent ab3d2c33
......@@ -183,11 +183,15 @@ func (key *pKey) VerifyPKCS1v15(method Method, data, sig []byte) error {
ctx := C.X_EVP_MD_CTX_new()
defer C.X_EVP_MD_CTX_free(ctx)
if len(sig) == 0 {
return errors.New("verifypkcs1v15: 0-length sig")
}
if key.KeyType() == KeyTypeED25519 {
// do ED specific one-shot sign
if method != nil || len(data) == 0 || len(sig) == 0 {
return errors.New("verifypkcs1v15: 0-length data or sig or non-null digest")
if method != nil || len(data) == 0 {
return errors.New("verifypkcs1v15: 0-length data or non-null digest")
}
if 1 != C.X_EVP_DigestVerifyInit(ctx, nil, nil, nil, key.key) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment