gPass

gPass Commit Details

Date:2017-09-14 20:20:42 (11 months 6 days ago)
Author:Grégory Soutadé
Branch:master
Commit:f98cc4a86357f0fe42e935e17d2bf93c062745ad
Parents: 5a1d6c73901c661ecd68f377bc8fdcee5bd80c4c
Message:Do simpler things to create wildcard domains

Changes:
Mchrome_addon/lib/main.js (1 diff)
Mcli/main.c (1 diff)

File differences

chrome_addon/lib/main.js
288288
289289
290290
291
291
292
292293
293
294
295
296
297
298
299
300
301
294
295
296
302297
303298
304299
305
300
306301
307302
308303
{
var parts = domain.split(".");
if (parts.length >= 3)
// Standard root domain (zzz.xxx.com) or more
if (parts.length > 2)
{
// Seems to be a two level root domain (ie zzz.xxx.co.uk ...)
if (parts[parts.length-2].lenght <= 3)
{
if (parts.length > 3)
return "*" + "." + parts[parts.length-3] + "." + parts[parts.length-2] + "." + parts[parts.length-1];
}
// Standard root domain (zzz.xxx.com)
else
return "*" + "." + parts[parts.length-2] + "." + parts[parts.length-1];
res = "*.";
for (i=1; i<parts.length; i++)
res += parts[i];
}
// Simple xxx.com
else if (parts.length == 2)
return "*" + "." + parts[0] + "." + parts[1];
return "*." + domain;
return "";
}
cli/main.c
297297
298298
299299
300
300
301301
302302
303
303
304304
305
306
307
308
309
310
311
312
313
305
306
314307
315308
316309
}
// Final level
level_length[cur_level] = tmp - level_ptr[cur_level-1];
level_length[cur_level-1] = tmp - level_ptr[cur_level-1];
tmp = NULL;
if (cur_level >= 3)
if (cur_level > 2)
{
// Seems to be a two level root domain (ie zzz.xxx.co.uk ...)
if (level_length[cur_level-2] <= 3)
{
if (cur_level > 3)
tmp = level_ptr[cur_level-3];
}
else
// Standard root domain (zzz.xxx.com)
tmp = level_ptr[cur_level-2];
// Standard root domain (zzz.xxx.com) or more
tmp = level_ptr[1];
}
// Simple xxx.com
else if (cur_level == 2)

Archive Download the corresponding diff file