Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't allow registration for phones with empty IMEI
  • Loading branch information
Bernd Wachter committed Oct 21, 2012
1 parent f821c53 commit cdad8ad
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions libssu/ssu.cpp
Expand Up @@ -108,6 +108,11 @@ QString Ssu::deviceModel(){
QString Ssu::deviceUid(){
QString IMEI;
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();
// this might not be completely unique (or might change on reflash), but works for now
if (IMEI == "")
Expand Down Expand Up @@ -298,6 +303,10 @@ void Ssu::sendRegistration(QString username, QString password){
ssuRegisterUrl = settings->value("register-url").toString();

QString IMEI = deviceUid();
if (IMEI == ""){
setError("No valid UID available for your device. For phones: is your modem online?");
return;
}

QSslConfiguration sslConfiguration;
if (!useSslVerify())
Expand Down Expand Up @@ -391,6 +400,11 @@ void Ssu::setRelease(QString release, bool rnd){
void Ssu::updateCredentials(bool force){
errorFlag = false;

if (deviceUid() == ""){
setError("No valid UID available for your device. For phones: is your modem online?");
return;
}

QString ssuCaCertificate, ssuCredentialsUrl;
if (!settings->contains("ca-certificate")){
setError("CA certificate for SSU not set (config key 'ca-certificate')");
Expand Down

0 comments on commit cdad8ad

Please sign in to comment.