2009-11-21 21:41:21 -06:00
|
|
|
# Defines basic Tcl procs for OpenOCD server modules
|
|
|
|
|
2011-03-16 21:22:12 -05:00
|
|
|
# Handle GDB 'R' packet. Can be overridden by configuration script,
|
2009-11-17 10:29:20 -06:00
|
|
|
# but it's not something one would expect target scripts to do
|
|
|
|
# normally
|
|
|
|
proc ocd_gdb_restart {target_id} {
|
|
|
|
# Fix!!! we're resetting all targets here! Really we should reset only
|
|
|
|
# one target
|
|
|
|
reset halt
|
|
|
|
}
|
2018-01-13 14:00:47 -06:00
|
|
|
|
|
|
|
proc prevent_cps {} {
|
|
|
|
echo "Possible SECURITY ATTACK detected."
|
|
|
|
echo "It looks like somebody is sending POST or Host: commands to OpenOCD."
|
|
|
|
echo "This is likely due to an attacker attempting to use Cross Protocol Scripting"
|
|
|
|
echo "to compromise your OpenOCD instance. Connection aborted."
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
|
|
|
proc POST {args} { prevent_cps }
|
|
|
|
proc Host: {args} { prevent_cps }
|