fortify license 破解

  • Comments Off on fortify license 破解
  • 26 views
  • A+
所属分类:安全工具

private static void doLoad(List lines, Map capmap, Properties metadata) throws InvalidLicenseFileException, NoSuchProviderException, NoSuchAlgorithmException, InvalidKeyException, InvalidKeySpecException, SignatureException {        Signature verifier = createVerifier();

      String key;

      do {

          if (lines.isEmpty()) {

              throw new InvalidLicenseFileException();

          }

          key = ((String)lines.remove(lines.size() - 1)).trim();

      } while(key.length() == 0);

      List tokens = new ArrayList();

      Iterator it = lines.iterator();

      while(true) {

          while(true) {

              String line;

              do {

                  do {

                      if (!it.hasNext()) {

                          if (key != null && key.length() == 64) {

                              byte[] sig = Base64.decode(key);

                              boolean verified = verifier.verify(sig);

                              if (!verified) {

                                  throw new InvalidLicenseFileException();

                              }

                              return;

                          }

                          throw new InvalidLicenseFileException();

                      }

                      line = (String)it.next();

                      verifier.update(getBytes(line));

                  } while(line.length() == 0);

              } while(line.charAt(0) == '#');

              if (line.startsWith("Metadata: ")) {

                  loadMetadataLine(metadata, line.substring("Metadata: ".length()));

              } else {

                  tokens.clear();

                  StringTokenizer stok = new StringTokenizer(line);

                  while(stok.hasMoreTokens()) {

                      tokens.add(stok.nextToken());

                  }

                  if (tokens.size() < 2) {

                      throw new InvalidLicenseFileException();

                  }

                  String capname = (String)tokens.get(0);

                  Date expdate = convertDate((String)tokens.get(1));

                  Properties params = new Properties();

                  ListIterator li = tokens.listIterator(2);

                  while(li.hasNext()) {

                      String token = (String)li.next();

                      int delim = token.indexOf(61);

                      if (delim != -1) {

                          params.setProperty(token.substring(0, delim), token.substring(delim + 1));

                      } else {

                          params.setProperty(token, "");

                      }

                  }

                  Config config = new Config(capname, expdate, params);

                  capmap.put(capname, config);

              }

          }

      }

  }

相关推荐: BrakTooth漏洞利用PoC发布

BrakTooth漏洞利用PoC发布,CISA督促厂商修复漏洞。BrakTooth漏洞概述9月,安全研究人员发现了商业BT栈中的多个安全漏洞——BrakTooth。研究人员对11个厂商的13个BT设备进行了测试,在其中发现了16个新的安全漏洞,获得20个CVE…