This paper proposes and specifies a protocol for distributing and managing group keys in ad hoc environments, which applies for the Secure Optimized Link State Routing Protocol. Our protocol manages group keys taking into consideration the frequent network partitions and the absence of infrastructure. The analysis shows that the protocol is energy efficient for high key replacement rates and frequent network partitions. The proposal reduced up to 512 times the control traffic load and 356 times the energy spent with cryptographic operations when compared to contributory algorithms. The proposed protocol is robust even in the presence of non-cooperative nodes and provides an efficient key management in a timely manner.