That North Korea would detonate another A-bomb shouldn't surprise anyone. They have to test their bombs in order to perfect them, since I suppose they don't possess the computer modeling capacity to test their weapons any other way.
They probably have the same "codes" that Los Alamos uses, courtesy of the lax security there. If not, they surely have the Pakistani "codes" and other design information. I'm sure the Iranians have both as well.