lib/rex/zip/jar.rb in librex-0.0.65 vs lib/rex/zip/jar.rb in librex-0.0.66
- old
+ new
@@ -1,16 +1,17 @@
+# -*- coding: binary -*-
require 'rex/zip/archive'
module Rex
module Zip
#
# A Jar is a zip archive containing Java class files and a MANIFEST.MF listing
# those classes. Several variations exist based on the same idea of class
# files inside a zip, most notably:
-# - WAR files store XML files, Java classes, JSPs and other stuff for
+# - WAR files store XML files, Java classes, JSPs and other stuff for
# servlet-based webservers (e.g.: Tomcat and Glassfish)
# - APK files are Android Package files
#
class Jar < Archive
attr_accessor :manifest
@@ -40,11 +41,11 @@
@manifest = "Manifest-Version: 1.0\r\n"
@manifest << "Main-Class: #{main_class}\r\n" if main_class
@manifest << "\r\n"
@entries.each { |e|
next if e.name =~ %r|/$|
- if e.name == "META-INF/MANIFEST.MF"
+ if e.name == "META-INF/MANIFEST.MF"
existing_manifest = e
next
end
#next unless e.name =~ /\.class$/
@manifest << "Name: #{e.name}\r\n"
@@ -187,10 +188,10 @@
sigdata << "SHA1-Digest: #{[manifest_digest].pack('m')}\r\n"
new_manifest << manifest_section
end
end
- # Now overwrite with the new manifest
+ # Now overwrite with the new manifest
m.data = new_manifest
flags = 0
flags |= OpenSSL::PKCS7::BINARY
flags |= OpenSSL::PKCS7::DETACHED