comparison ui/sslhelp.cpp @ 1377:c8a6a3e6bdeb

(issue178) Show checksums after installer creation
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 15 Jan 2015 11:22:47 +0100
parents 6c4f526a4c5b
children f3e2df6b49ba
comparison
equal deleted inserted replaced
1376:fdef94da2d70 1377:c8a6a3e6bdeb
5 * and comes with ABSOLUTELY NO WARRANTY! 5 * and comes with ABSOLUTELY NO WARRANTY!
6 * See LICENSE.txt for details. 6 * See LICENSE.txt for details.
7 */ 7 */
8 #include "sslhelp.h" 8 #include "sslhelp.h"
9 #include <polarssl/sha256.h> 9 #include <polarssl/sha256.h>
10 #include <polarssl/sha1.h>
10 #include <polarssl/pk.h> 11 #include <polarssl/pk.h>
11 #include <polarssl/entropy.h> 12 #include <polarssl/entropy.h>
12 #include <polarssl/ctr_drbg.h> 13 #include <polarssl/ctr_drbg.h>
13 #include <QApplication> 14 #include <QApplication>
14 #include <QUuid> 15 #include <QUuid>
25 QByteArray sha256sum(const QByteArray& data) 26 QByteArray sha256sum(const QByteArray& data)
26 { 27 {
27 unsigned char output[32]; 28 unsigned char output[32];
28 sha256((unsigned char *)data.constData(), (size_t)data.size(), output, 0); 29 sha256((unsigned char *)data.constData(), (size_t)data.size(), output, 0);
29 return QByteArray((const char *)output, 32); 30 return QByteArray((const char *)output, 32);
31 }
32
33 QByteArray sha1sum(const QByteArray& data)
34 {
35 unsigned char output[20];
36 sha1((unsigned char *)data.constData(), (size_t)data.size(), output);
37 return QByteArray((const char *)output, 20);
30 } 38 }
31 39
32 QByteArray rsaSignSHA256Hash(const QByteArray& hash, pk_context *pk) 40 QByteArray rsaSignSHA256Hash(const QByteArray& hash, pk_context *pk)
33 { 41 {
34 int ret = 0; 42 int ret = 0;

http://wald.intevation.org/projects/trustbridge/