]> git.mxchange.org Git - friendica.git/commitdiff
convert our native pkcs#8 to pkcs#1 for diaspora-public-key xrd field
authorFriendika <info@friendika.com>
Sat, 30 Jul 2011 08:03:24 +0000 (01:03 -0700)
committerFriendika <info@friendika.com>
Sat, 30 Jul 2011 08:03:24 +0000 (01:03 -0700)
include/certfns.php
mod/xrd.php

index db0e4645efc8dd34b5708ec2cb18439070849032..ffdc7f0c340d87273f4450a7ae592af2d25b5cf2 100644 (file)
@@ -121,6 +121,10 @@ function rsatopem($key) {
        return(metopem($m,$e));
 }
 
+function pemtorsa($key) {
+       pemtome($key,$m,$e);
+       return(metorsa($m,$e));
+}
 
 function pemtome($key,&$m,&$e) {
        require_once('include/salmon.php');
index accc2f68ef1f0388f8a9b193aa180dafccc3f311..4889639f07dcf7ca8b8cd6d26aedc56613d752cd 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
 require_once('salmon.php');
+require_once('certfns.php');
 
 function xrd_content(&$a) {
 
@@ -34,7 +35,7 @@ function xrd_content(&$a) {
                $dspr = replace_macros($tpl,array(
                        '$baseurl' => $a->get_baseurl(),
                        '$dspr_guid' => $r[0]['guid'],
-                       '$dspr_key' => base64_encode($r[0]['pubkey'])
+                       '$dspr_key' => base64_encode(pemtorsa($r[0]['pubkey']))
                ));
        }
        else