Skip to content

Commit

Permalink
Change update URL + added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickpr committed May 4, 2016
1 parent 59744fe commit 403246c
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 15 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
Yet Another Openssl GUI : Qt base openssl GUI to create CSR, certificates, keys (RSA / DSA / EC)

This project aims to allow creating certificates in a quick and easy way.
Features :
Features :
- Single executable with no dependencies (openssl lib are included) : on Windows for now
- Create auto sign certificates, CSR with immediate PEM display to copy/paste
- Conversion from certificate to csr
- Allow RSA, DSA and elliptic curve keys
- Encrypt/descrypt keys, check certificate key match
- Set X509v3 extensions
- Import/export to PKCS#12
- Should work on any platform supported by Qt

Binary includes openssl library : https://www.openssl.org

Licence : GPL V3

26 changes: 25 additions & 1 deletion src/app/sslcertificates.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,39 @@ class SSLCertificates
* check ssl errors
*/
int create_csr();
/**
* @brief get_csr_PEM : put CSR in PEM format to a string
* @param Skey : string to receive CSR
* @param maxlength : max size to put in Skey
* @return
*/
int get_csr_PEM(char* Skey,size_t maxlength);
/**
* @brief get_csr_PEM : put CSR in human readable format to a string
* @param Skey : string to receive CSR
* @param maxlength : max size to put in Skey
* @return
*/
int get_csr_HUM(char* Skey,size_t maxlength);
/**
* @brief set_csr_PEM : load csr in Skey in openssl structure
* @param Skey : string containing CSR in PEM format
* @param password : password if encrypted cert, can be null
* @return 0: sucess, 1 : error reading csr, 2: wrong password
* check ssl errors
*/
int set_csr_PEM(const char* Skey, char* password);

void set_display_callback(void(*callback)(char*));
void clear_display_callback();

static int abortnow;
static int abortnow; //!< static var to abort key generation when set to 1

/**
* @brief print_ssl_errors : put all errors in buffer and clear them
* @param buffer
* @param size
*/
void print_ssl_errors(char* buffer,size_t size);
void empty_ssl_errors();
int SSLError; //!< set to 1 if at least one SSL error raised. reset with empty_ssl_errors (but not with print_ssl_errors)
Expand Down
20 changes: 15 additions & 5 deletions src/app/sslmainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1418,6 +1418,11 @@ void SSLMainWindow::on_pushButtonSave2p12_clicked() // TODO : finish this
fclose(file);
}

void SSLMainWindow::on_pushButtonLoadPKCS12_clicked()
{
QMessageBox::information(this,"Not yes","Not implemented yet","ok");
}


/************************ Settings ************************************************/

Expand Down Expand Up @@ -1514,7 +1519,7 @@ void SSLMainWindow::check_updates()
connect(network, SIGNAL(finished(QNetworkReply*)),
this, SLOT(network_reply_finished(QNetworkReply*)));

QUrl updateurl=QUrl("http://www.proy.org/update.php");
QUrl updateurl=QUrl("http://yaog.proy.org/update.php");

QUrlQuery postdata;
postdata.addQueryItem("version",YAOGVERSION);
Expand All @@ -1529,7 +1534,8 @@ void SSLMainWindow::check_updates()

void SSLMainWindow::network_reply_finished(QNetworkReply* reply) //TODO
{
QRegExp ok("^.*:OK");
QRegExp ok("^OK:.*");
QRegExp update("^UPDATE:.*");
QByteArray bts = reply->readAll();
QString str(bts);
reply->deleteLater();
Expand All @@ -1538,7 +1544,11 @@ void SSLMainWindow::network_reply_finished(QNetworkReply* reply) //TODO
//QMessageBox::information(this,"Reply",str,"Up to date");
return;
}
//TODO
QMessageBox::information(this,"Update Available",str,"ok");

if (update.exactMatch(str))
{ // TODO : make update automatic
QMessageBox::information(this,"Update Available",str,"Up to date");
return;
}
//TODO On all other errors, check last OK reply : if older than 1 month, alert user
//For now, silently die (alone)
}
2 changes: 2 additions & 0 deletions src/app/sslmainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ private slots:

void network_reply_finished(QNetworkReply* reply);

void on_pushButtonLoadPKCS12_clicked();

signals:
//extension_button_del_on_clicked(int row);
add_text_output(QString);
Expand Down
29 changes: 21 additions & 8 deletions src/app/sslmainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</sizepolicy>
</property>
<property name="windowTitle">
<string>SSLMainWindow</string>
<string>Yet Another OpenSSL GUI</string>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QGroupBox" name="groupBoxSubject">
Expand Down Expand Up @@ -359,9 +359,9 @@
<widget class="QPushButton" name="pushButtonGenerate">
<property name="geometry">
<rect>
<x>130</x>
<x>160</x>
<y>20</y>
<width>141</width>
<width>110</width>
<height>23</height>
</rect>
</property>
Expand All @@ -373,8 +373,8 @@
<property name="geometry">
<rect>
<x>280</x>
<y>50</y>
<width>47</width>
<y>80</y>
<width>70</width>
<height>20</height>
</rect>
</property>
Expand All @@ -386,7 +386,7 @@
<property name="geometry">
<rect>
<x>280</x>
<y>80</y>
<y>100</y>
<width>69</width>
<height>22</height>
</rect>
Expand All @@ -411,9 +411,9 @@
<widget class="QComboBox" name="comboBoxKeyType">
<property name="geometry">
<rect>
<x>50</x>
<x>70</x>
<y>20</y>
<width>69</width>
<width>80</width>
<height>22</height>
</rect>
</property>
Expand Down Expand Up @@ -739,6 +739,19 @@
<string>Save Settings</string>
</property>
</widget>
<widget class="QPushButton" name="pushButtonLoadPKCS12">
<property name="geometry">
<rect>
<x>100</x>
<y>240</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Load PKCS12</string>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
Expand Down

0 comments on commit 403246c

Please sign in to comment.