[Rpm-maint] [rpm-software-management/rpm] Add OpenSSL crypto backend (#129)

Igor Gnatenko notifications at github.com
Wed Jan 18 16:05:36 UTC 2017


ignatenkobrain commented on this pull request.



> +}
+
+int rpmDigestFinal(DIGEST_CTX ctx, void ** datap, size_t *lenp, int asAscii)
+{
+    int ret;
+    unsigned char *digest = NULL;
+    unsigned int digestlen;
+
+    if (ctx == NULL) return -1;
+
+    digestlen = EVP_MD_CTX_size(ctx->md_ctx);
+    digest = xcalloc(digestlen, sizeof(*digest));
+    if (digest == NULL) return -1;
+
+    ret = EVP_DigestFinal_ex(ctx->md_ctx, digest, &digestlen);
+    if (ret != 1) goto done;

shouldn't comparison be `if (!ret)`? I have not found much docs about return values, but I guess it is supposed to be used in such manner)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/129#pullrequestreview-17257705
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20170118/6a4a73ae/attachment.html>


More information about the Rpm-maint mailing list