From 60caffcd7776043ee89e5939b81d7bd9d948cd4e Mon Sep 17 00:00:00 2001 From: Friendika Date: Sat, 30 Jul 2011 01:03:24 -0700 Subject: [PATCH] convert our native pkcs#8 to pkcs#1 for diaspora-public-key xrd field --- include/certfns.php | 4 ++++ mod/xrd.php | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/certfns.php b/include/certfns.php index db0e4645ef..ffdc7f0c34 100644 --- a/include/certfns.php +++ b/include/certfns.php @@ -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'); diff --git a/mod/xrd.php b/mod/xrd.php index accc2f68ef..4889639f07 100644 --- a/mod/xrd.php +++ b/mod/xrd.php @@ -1,6 +1,7 @@ $a->get_baseurl(), '$dspr_guid' => $r[0]['guid'], - '$dspr_key' => base64_encode($r[0]['pubkey']) + '$dspr_key' => base64_encode(pemtorsa($r[0]['pubkey'])) )); } else