Commit cdad8ada authored by Aard's avatar Aard

Don't allow registration for phones with empty IMEI

parent f821c53a
...@@ -108,6 +108,11 @@ QString Ssu::deviceModel(){ ...@@ -108,6 +108,11 @@ QString Ssu::deviceModel(){
QString Ssu::deviceUid(){ QString Ssu::deviceUid(){
QString IMEI; QString IMEI;
QSystemDeviceInfo devInfo; QSystemDeviceInfo devInfo;
// for all devices where we know that they have an IMEI we can't fall back other UID
if (deviceFamily() == "n950-n9" || deviceFamily() == "n900")
return devInfo.imei();
IMEI = devInfo.imei(); IMEI = devInfo.imei();
// this might not be completely unique (or might change on reflash), but works for now // this might not be completely unique (or might change on reflash), but works for now
if (IMEI == "") if (IMEI == "")
...@@ -298,6 +303,10 @@ void Ssu::sendRegistration(QString username, QString password){ ...@@ -298,6 +303,10 @@ void Ssu::sendRegistration(QString username, QString password){
ssuRegisterUrl = settings->value("register-url").toString(); ssuRegisterUrl = settings->value("register-url").toString();
QString IMEI = deviceUid(); QString IMEI = deviceUid();
if (IMEI == ""){
setError("No valid UID available for your device. For phones: is your modem online?");
return;
}
QSslConfiguration sslConfiguration; QSslConfiguration sslConfiguration;
if (!useSslVerify()) if (!useSslVerify())
...@@ -391,6 +400,11 @@ void Ssu::setRelease(QString release, bool rnd){ ...@@ -391,6 +400,11 @@ void Ssu::setRelease(QString release, bool rnd){
void Ssu::updateCredentials(bool force){ void Ssu::updateCredentials(bool force){
errorFlag = false; errorFlag = false;
if (deviceUid() == ""){
setError("No valid UID available for your device. For phones: is your modem online?");
return;
}
QString ssuCaCertificate, ssuCredentialsUrl; QString ssuCaCertificate, ssuCredentialsUrl;
if (!settings->contains("ca-certificate")){ if (!settings->contains("ca-certificate")){
setError("CA certificate for SSU not set (config key 'ca-certificate')"); setError("CA certificate for SSU not set (config key 'ca-certificate')");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment