]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - providers/implementations/signature/eddsa_sig.c
providers: Set the size of EC signature on s390.
[thirdparty/openssl.git] / providers / implementations / signature / eddsa_sig.c
index 41b0eb172f65502fbbc88ad33408527cca53270e..2dc6c5e9d1bfed3364514958559e9ab2950ce85c 100644 (file)
@@ -164,8 +164,14 @@ int ed25519_digest_sign(void *vpeddsactx, unsigned char *sigret,
         return 0;
     }
 #ifdef S390X_EC_ASM
-    if (S390X_CAN_SIGN(ED25519))
-        return s390x_ed25519_digestsign(edkey, sigret, tbs, tbslen);
+    if (S390X_CAN_SIGN(ED25519)) {
+           if (s390x_ed25519_digestsign(edkey, sigret, tbs, tbslen) == 0) {
+                   ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SIGN);
+                   return 0;
+           }
+           *siglen = ED25519_SIGSIZE;
+           return 1;
+    }
 #endif /* S390X_EC_ASM */
     if (ossl_ed25519_sign(sigret, tbs, tbslen, edkey->pubkey, edkey->privkey,
                           peddsactx->libctx, NULL) == 0) {
@@ -195,8 +201,14 @@ int ed448_digest_sign(void *vpeddsactx, unsigned char *sigret,
         return 0;
     }
 #ifdef S390X_EC_ASM
-    if (S390X_CAN_SIGN(ED448))
-        return s390x_ed448_digestsign(edkey, sigret, tbs, tbslen);
+    if (S390X_CAN_SIGN(ED448)) {
+        if (s390x_ed448_digestsign(edkey, sigret, tbs, tbslen) == 0) {
+               ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SIGN);
+               return 0;
+       }
+       *siglen = ED448_SIGSIZE;
+       return 1;
+    }
 #endif /* S390X_EC_ASM */
     if (ossl_ed448_sign(peddsactx->libctx, sigret, tbs, tbslen, edkey->pubkey,
                         edkey->privkey, NULL, 0, edkey->propq) == 0) {