forked from rapid7/metasploit-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to an enum option for the signing
- Loading branch information
1 parent
6d915db
commit a9fd264
Showing
4 changed files
with
62 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module Rex::Proto::LDAP | ||
class LdapException < RuntimeError | ||
end | ||
end | ||
class LdapException < RuntimeError | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
module Rex::Proto::Sasl | ||
# Wrap the data in a SASL structure, per RFC 4422 (basically just prepends a big-endian encoded 32-bit integer representing the length) | ||
def wrap_sasl(data) | ||
length = [data.length].pack('N') | ||
# Wrap the data in a SASL structure, per RFC 4422 (basically just prepends a big-endian encoded 32-bit integer representing the length) | ||
def wrap_sasl(data) | ||
length = [data.length].pack('N') | ||
|
||
length + data | ||
end | ||
|
||
# Unwraps the data from a SASL structure, per RFC 4422 | ||
def unwrap_sasl(data) | ||
length = data[0,4].unpack('N')[0] | ||
if length != data.length + 4 | ||
raise ArgumentError.new('Invalid SASL structure') | ||
end | ||
length + data | ||
end | ||
|
||
data[4,length] | ||
# Unwraps the data from a SASL structure, per RFC 4422 | ||
def unwrap_sasl(data) | ||
length = data[0,4].unpack('N')[0] | ||
if length != data.length + 4 | ||
raise ArgumentError.new('Invalid SASL structure') | ||
end | ||
end | ||
|
||
data[4,length] | ||
end | ||
end |