Mercurial > trustbridge
annotate ui/certificatetabledelegate.h @ 359:f6ce186cebc2
If DO_RELEASE_BUILD is set use pubkey-release and test with it
This currently fails because polarssl rejects keys with
a public exponent larger then 64 bit.
With the following patch all tests pass. But this
currently awaits upstream comment.
https://polarssl.org/discussions/bug-report-issues/rsa-keys-with-large-public-exponents-are-rejected
--- rsa.c.orig 2014-04-10 17:22:32.727290031 +0200
+++ rsa.c 2014-04-10 17:22:38.847410225 +0200
@@ -154,7 +154,7 @@
return( POLARSSL_ERR_RSA_KEY_CHECK_FAILED );
if( mpi_msb( &ctx->E ) < 2 ||
- mpi_msb( &ctx->E ) > 64 )
+ mpi_msb( &ctx->E ) > POLARSSL_MPI_MAX_BITS )
return( POLARSSL_ERR_RSA_KEY_CHECK_FAILED );
return( 0 );
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Thu, 10 Apr 2014 17:50:44 +0200 |
parents | dde533ba4fcc |
children | 17e1c8f37d72 |
rev | line source |
---|---|
347
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
1 #ifndef CERTIFICATETABLEDELEGATE_H |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
2 #define CERTIFICATETABLEDELEGATE_H |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
3 /** |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
4 * @file certificatetabledelegate.h |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
5 * @brief Item delegate drawing custom certificate items in table views. |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
6 * |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
7 */ |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
8 |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
9 #include <QStyledItemDelegate> |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
10 |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
11 class CertificateTableDelegate : public QStyledItemDelegate |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
12 { |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
13 Q_OBJECT |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
14 |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
15 public: |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
16 CertificateTableDelegate(QWidget *parent = 0) : QStyledItemDelegate(parent){} |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
17 |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
18 /** |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
19 * @brief Renders the delegate using the given painter and options. |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
20 * |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
21 * @param painter The painter to draw the item. |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
22 * @param option The style options. |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
23 * @param index The model index of the item to draw. |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
24 */ |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
25 void paint(QPainter *painter, const QStyleOptionViewItem &option, |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
26 const QModelIndex &index) const; |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
27 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
28 const QModelIndex &index) const; |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
29 |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
30 void setEditorData(QWidget *editor, const QModelIndex &index) const; |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
31 void setModelData(QWidget *editor, QAbstractItemModel *model, |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
32 const QModelIndex &index) const; |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
33 |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
34 void updateEditorGeometry(QWidget *editor, |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
35 const QStyleOptionViewItem &option, const QModelIndex &index) const; |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
36 private: |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
37 |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
38 /** |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
39 * @brief Draw the item using the given parameters. |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
40 * |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
41 * @param painter The painter to draw the item. |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
42 * @param option The style options. |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
43 * @param index The model index of the item to draw. |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
44 * @param icon The icon to display. |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
45 * @param font The font used to draw text. |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
46 */ |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
47 QWidget *drawComboBox(QWidget *parent, const QStyleOptionViewItem &option, |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
48 const QModelIndex &index) const; |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
49 }; |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
50 #endif |