Changeset 1777

Show
Ignore:
Timestamp:
12/30/10 22:45:44 (2 years ago)
Author:
ahu
Message:

fix up export-zone-key so that we set the algorithm field correctly

Location:
trunk/pdns/pdns
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/dnsseckeeper.hh

    r1773 r1777  
    6868 
    6969  void create(unsigned int bits); 
    70   std::string convertToISC(); 
     70  std::string convertToISC(unsigned int algorithm); 
    7171 
    7272private: 
  • trunk/pdns/pdns/fsdnsseckeeper.cc

    r1773 r1777  
    3232} 
    3333 
    34 std::string RSAContext::convertToISC() 
     34std::string RSAContext::convertToISC(unsigned int algorithm) 
    3535{ 
    3636  string ret; 
     
    4545    ("Coefficient",&d_context.QP); 
    4646 
    47   ret = "Private-key-format: v1.2\nAlgorithm: 5 (RSASHA1)\n"; 
     47  ret = "Private-key-format: v1.2\nAlgorithm: "+lexical_cast<string>(algorithm)+" (RSASHA1)\n"; 
    4848 
    4949  BOOST_FOREACH(outputs_t::value_type value, outputs) { 
     
    121121  dpk.d_key.create(bits); // for testing, 1024 
    122122 
    123   string isc = dpk.d_key.convertToISC(); 
     123  string isc = dpk.d_key.convertToISC(algorithm); 
    124124  DNSKEYRecordContent drc = dpk.getDNSKEY(); 
    125125  drc.d_flags = 256 + keyOrZone; // KSK 
  • trunk/pdns/pdns/pdnssec.cc

    r1773 r1777  
    325325    unsigned int id=atoi(cmds[2].c_str()); 
    326326    DNSSECPrivateKey dpk=dk.getKeyById(zone, id); 
    327     cout << dpk.d_key.convertToISC() <<endl; 
     327    cout << dpk.d_key.convertToISC(dpk.d_algorithm) <<endl; 
    328328  } 
    329329  else if(cmds[0]=="export-zone-dnskey") {