]> andersk Git - gssapi-openssh.git/blame - openssh/makegssname.pl
Update announcement text for upcoming 3.5 release.
[gssapi-openssh.git] / openssh / makegssname.pl
CommitLineData
88928908 1#!/usr/bin/perl
2
3use Convert::ASN1 qw(:tag);
4use Digest::MD5 qw(md5);
5use MIME::Base64;
6use Data::Dumper;
7
8$oid=shift;
9my $asn=Convert::ASN1->new;
10$asn->prepare("oid OBJECT IDENTIFIER");
11$encoded=$asn->encode(oid => $oid);
12Convert::ASN1::asn_dump($encoded);
13print Dumper($asn->decode($encoded));
14
15@entries=unpack("C*",$encoded);
16
17print "DER representation: ";
18foreach $entry (@entries) {
19 print "\\x";
20 printf "%02X",$entry;
21}
22print "\n";
23
24$digest = md5($encoded);
25# We only want the first 10 characters;
26# Conversations with the authors suggest that we want to use all of the
27# characters of the digest.
28#$digest = substr($digest,0,10);
29print "gsskeyex representation: ",encode_base64($digest),"\n";
30
31sub encode_object_id {
32 $string="";
33
34 my @data = ($_[0] =~ /(\d+)/g);
35
36 if(@data < 2) {
37 @data = (0);
38 }
39 else {
40 my $first = $data[1] + ($data[0] * 40);
41 splice(@data,0,2,$first);
42 }
43
44# my $l = length $string;
45 $string .= pack("cw*", 0, @data);
46# substr($string,$l,1) = asn_encode_length(length($string) - $l - 1);
47 return $string;
48}
49
50
This page took 0.060623 seconds and 5 git commands to generate.